From 25a6d068f0ea7e02a912a3d5605df11f68c92cb1 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 25 Nov 2021 09:42:19 +0000 Subject: [PATCH] sampledSets, streamlines: Various improvements Sampled sets and streamlines now write all their fields to the same file. This prevents excessive duplication of the geometry and makes post-processing tasks more convenient. "axis" entries are now optional in sampled sets and streamlines. When omitted, a default entry will be used, which is chosen appropriately for the coordinate set and the write format. Some combinations are not supported. For example, a scalar ("x", "y", "z" or "distance") axis cannot be used to write in the vtk format, as vtk requires 3D locations with which to associate data. Similarly, a point ("xyz") axis cannot be used with the gnuplot format, as gnuplot needs a single scalar to associate with the x-axis. Streamlines can now write out fields of any type, not just scalars and vectors, and there is no longer a strict requirement for velocity to be one of the fields. Streamlines now output to postProcessing//time/ in the same way as other functions. The additional "sets" subdirectory has been removed. The raw set writer now aligns columns correctly. The handling of segments in coordSet and sampledSet has been fixed/completed. Segments mean that a coordinate set can represent a number of contiguous lines, disconnected points, or some combination thereof. This works in parallel; segments remain contiguous across processor boundaries. Set writers now only need one write method, as the previous "writeTracks" functionality is now handled by streamlines providing the writer with the appropriate segment structure. Coordinate sets and set writers now have a convenient programmatic interface. To write a graph of A and B against some coordinate X, in gnuplot format, we can call the following: setWriter::New("gnuplot")->write ( directoryName, graphName, coordSet(true, "X", X), // <-- "true" indicates a contiguous "A", // line, "false" would mean A, // disconnected points "B", B ); This write function is variadic. It supports any number of field-name-field pairs, and they can be of any primitive type. Support for Jplot and Xmgrace formats has been removed. Raw, CSV, Gnuplot, VTK and Ensight formats are all still available. The old "graph" functionality has been removed from the code, with the exception of the randomProcesses library and associated applications (noise, DNSFoam and boxTurb). The intention is that these should also eventually be converted to use the setWriters. For now, so that it is clear that the "graph" functionality is not to be used elsewhere, it has been moved into a subdirectory of the randomProcesses library. --- .../financial/financialFoam/financialFoam.C | 21 +- .../boundaryFoam/boundaryFoam.C | 3 +- .../incompressible/boundaryFoam/makeGraphs.H | 37 +- .../sizeDistribution/sizeDistribution.C | 127 +-- .../sizeDistribution/sizeDistribution.H | 38 +- applications/test/graph/Make/files | 3 - applications/test/graph/Make/options | 7 - applications/test/graph/Test-graph.C | 70 -- applications/test/graph/graphTest2.C | 64 -- applications/test/graphXi/Make/files | 3 - applications/test/graphXi/Make/options | 7 - applications/test/graphXi/Test-graphXi.C | 66 -- applications/test/graphXi/r.agr | 107 --- applications/test/graphXi/r.dat | 103 -- applications/test/graphXi/r.gplt | 110 --- applications/test/graphXi/r.ps | 0 applications/test/graphXi/r.xy | 100 -- .../automatic/automatic.C | 3 +- .../manipulation/checkMesh/checkGeometry.C | 8 +- .../manipulation/checkMesh/checkGeometry.H | 2 +- .../mesh/manipulation/checkMesh/checkMesh.C | 11 +- .../mesh/manipulation/checkMesh/checkTools.C | 41 +- .../mesh/manipulation/checkMesh/checkTools.H | 2 +- .../manipulation/checkMesh/checkTopology.C | 2 +- .../manipulation/checkMesh/checkTopology.H | 2 +- .../particleTracks/particleTracks.C | 47 +- .../miscellaneous/pdfPlot/createFields.H | 7 +- .../miscellaneous/pdfPlot/pdfPlot.C | 15 +- .../miscellaneous/postChannel/collapse.H | 49 +- .../miscellaneous/postChannel/postChannel.C | 4 +- .../surface/surfaceCheck/surfaceCheck.C | 2 +- .../postProcessing/graphs/graphCellFace | 26 + .../postProcessing/graphs/graphCellFace.cfg | 22 + etc/caseDicts/postProcessing/graphs/graphFace | 26 + .../postProcessing/graphs/graphFace.cfg | 22 + .../postProcessing/probes/boundaryProbes.cfg | 1 - .../postProcessing/probes/internalProbes | 2 + .../postProcessing/probes/internalProbes.cfg | 3 +- .../streamlines/streamlinesLine.cfg | 1 - .../streamlines/streamlinesPatch.cfg | 1 - .../streamlines/streamlinesPoints.cfg | 1 - .../streamlines/streamlinesSphere.cfg | 1 - src/OpenFOAM/Make/files | 9 - .../fields/Fields/DynamicField/DynamicField.H | 19 +- .../field/histogram/histogram.C | 49 +- .../field/histogram/histogram.H | 12 +- .../field/interfaceHeight/interfaceHeight.C | 9 +- .../regionSizeDistribution.C | 304 +++--- .../regionSizeDistribution.H | 55 +- .../field/streamlines/streamlines.C | 890 ++++++++---------- .../field/streamlines/streamlines.H | 82 +- .../field/streamlines/streamlinesParticle.C | 234 +++-- .../field/streamlines/streamlinesParticle.H | 92 +- src/lagrangian/basic/particle/particle.C | 4 +- .../ParticleCollector/ParticleCollector.C | 2 +- src/randomProcesses/Make/files | 9 + .../graph/curve/curve.C | 2 +- .../graph/curve/curve.H | 2 +- .../graph/curve/curveTools.C | 0 .../graph/curve/curveTools.H | 0 .../graph/graph.C | 2 +- .../graph/graph.H | 2 +- .../graph/writers/gnuplotGraph/gnuplotGraph.C | 2 +- .../graph/writers/gnuplotGraph/gnuplotGraph.H | 2 +- .../graph/writers/jplotGraph/jplotGraph.C | 2 +- .../graph/writers/jplotGraph/jplotGraph.H | 2 +- .../graph/writers/rawGraph/rawGraph.C | 2 +- .../graph/writers/rawGraph/rawGraph.H | 2 +- .../graph/writers/xmgrGraph/xmgrGraph.C | 2 +- .../graph/writers/xmgrGraph/xmgrGraph.H | 2 +- src/sampling/Make/files | 22 +- src/sampling/coordSet/coordSet.C | 502 ++++++++-- src/sampling/coordSet/coordSet.H | 143 ++- .../coordSetTemplates.C} | 50 +- src/sampling/graphField/makeGraph.C | 111 --- src/sampling/graphField/makeGraph.H | 84 -- src/sampling/graphField/writeCellGraph.C | 68 -- src/sampling/graphField/writeCellGraph.H | 60 -- src/sampling/graphField/writePatchGraph.H | 61 -- .../sampledSet/arcUniform/arcUniform.C | 86 +- .../sampledSet/arcUniform/arcUniform.H | 10 +- .../boundaryPoints/boundaryPoints.C | 43 +- .../boundaryPoints/boundaryPoints.H | 9 +- .../boundaryRandom/boundaryRandom.C | 44 +- .../boundaryRandom/boundaryRandom.H | 9 +- .../sampledSet/boxUniform/boxUniform.C | 47 +- .../sampledSet/boxUniform/boxUniform.H | 14 +- .../cellSetSampledSet/cellSetSampledSet.C | 12 +- .../sampledSet/circleRandom/circleRandom.C | 44 +- .../sampledSet/circleRandom/circleRandom.H | 9 +- .../faceSetSampledSet/faceSetSampledSet.C | 14 +- src/sampling/sampledSet/lineCell/lineCell.C | 142 +-- src/sampling/sampledSet/lineCell/lineCell.H | 31 +- .../sampledSet/lineCellFace/lineCellFace.C | 106 +-- .../sampledSet/lineCellFace/lineCellFace.H | 10 +- src/sampling/sampledSet/lineFace/lineFace.C | 380 ++++---- src/sampling/sampledSet/lineFace/lineFace.H | 20 +- .../sampledSet/lineUniform/lineUniform.C | 103 +- .../sampledSet/lineUniform/lineUniform.H | 10 +- src/sampling/sampledSet/points/points.C | 268 ++++-- src/sampling/sampledSet/points/points.H | 33 +- .../sampledSet/sampledSet/sampledSet.C | 133 ++- .../sampledSet/sampledSet/sampledSet.H | 43 +- .../sampledSetCloud.C} | 47 +- .../sampledSetCloud.H} | 80 +- .../sampledSet/sampledSetParticle.C | 312 ++++++ .../sampledSet/sampledSetParticle.H | 279 ++++++ .../sampledSet/sampledSets/IOsampledSets.H | 49 - .../sampledSet/sampledSets/sampledSets.C | 248 +++-- .../sampledSet/sampledSets/sampledSets.H | 171 +--- .../sampledSets/sampledSetsGrouping.C | 109 --- .../sampledSets/sampledSetsTemplates.C | 308 ++---- .../sampledSet/sphereRandom/sphereRandom.C | 44 +- .../sampledSet/sphereRandom/sphereRandom.H | 9 +- .../triSurfaceMeshSampledSet.C | 42 +- .../triSurfaceMeshSampledSet.H | 9 +- .../sampledSet/writers/csv/csvSetWriter.C | 206 ++-- .../sampledSet/writers/csv/csvSetWriter.H | 57 +- .../writers/csv/csvSetWriterRunTime.C | 37 - .../writers/ensight/ensightSetWriter.C | 382 +++----- .../writers/ensight/ensightSetWriter.H | 42 +- .../writers/ensight/ensightSetWriterRunTime.C | 37 - .../writers/gnuplot/gnuplotSetWriter.C | 186 ++-- .../writers/gnuplot/gnuplotSetWriter.H | 45 +- .../writers/gnuplot/gnuplotSetWriterRunTime.C | 37 - .../sampledSet/writers/jplot/jplotSetWriter.C | 103 -- .../sampledSet/writers/jplot/jplotSetWriter.H | 118 --- .../sampledSet/writers/raw/rawSetWriter.C | 141 +-- .../sampledSet/writers/raw/rawSetWriter.H | 65 +- .../writers/raw/rawSetWriterRunTime.C | 37 - src/sampling/sampledSet/writers/setWriter.C | 439 +++++---- src/sampling/sampledSet/writers/setWriter.H | 372 ++++++-- ...etWriterRunTime.C => setWriterTemplates.C} | 25 +- src/sampling/sampledSet/writers/setWriters.H | 79 -- .../sampledSet/writers/vtk/vtkSetWriter.C | 186 +--- .../sampledSet/writers/vtk/vtkSetWriter.H | 41 +- .../writers/vtk/vtkSetWriterRunTime.C | 37 - .../writers/xmgrace/xmgraceSetWriter.C | 131 --- .../writers/xmgrace/xmgraceSetWriterRunTime.C | 37 - .../sampledSurfaces/sampledSurfaces.C | 5 +- .../sampledSurfaces/sampledSurfaces.H | 6 +- .../sampledSurfacesTemplates.C | 10 +- .../writers/ensight/ensightSurfaceWriter.C | 22 +- .../writers/ensight/ensightSurfaceWriter.H | 7 +- .../writers/foam/foamSurfaceWriter.C | 68 +- .../writers/foam/foamSurfaceWriter.H | 4 +- .../writers/none/noSurfaceWriter.C | 9 +- .../writers/none/noSurfaceWriter.H | 4 +- .../writers/proxy/proxySurfaceWriter.C | 2 +- .../writers/raw/rawSurfaceWriter.C | 182 +--- .../writers/raw/rawSurfaceWriter.H | 47 +- .../sampledSurface/writers/surfaceWriter.C | 97 +- .../sampledSurface/writers/surfaceWriter.H | 141 ++- .../writers/vtk/vtkSurfaceWriter.C | 12 +- .../writers/vtk/vtkSurfaceWriter.H | 4 +- .../binaryBreakup/system/controlDict | 2 + .../binaryBreakup/validation/createGraphs | 2 +- .../breakup/system/controlDict | 2 + .../breakup/validation/createGraphs | 2 +- .../coalescence/system/controlDict | 2 + .../coalescence/validation/createGraphs | 2 +- .../drift/system/controlDict | 4 + .../drift/validation/createGraphs | 2 +- .../isothermalGrowth/validation/createGraphs | 2 +- .../negativeDrift/system/controlDict | 4 + .../negativeDrift/validation/createGraphs | 2 +- .../system/controlDict | 4 + .../validation/createGraphs | 4 +- .../pimpleFoam/LES/channel395/Allclean | 9 - .../motorBike/motorBike/system/streamlines | 7 +- .../simpleFoam/T3A/validation/createGraphs | 7 +- .../simpleFoam/motorBike/system/streamlines | 23 +- .../pitzDailyExptInlet/system/controlDict | 7 +- .../RAS/bubblePipe/system/controlDict | 4 + .../RAS/bubblePipe/validation/createGraphs | 31 +- .../RAS/wallBoiling/validation/createGraphs | 2 +- .../wallBoilingIATE/validation/createGraphs | 2 +- .../system/controlDict.orig | 3 + .../validation/createGraphs | 2 +- .../system/controlDict.orig | 3 + .../validation/createGraphs | 2 +- .../titaniaSynthesis/system/controlDict | 1 + .../titaniaSynthesis/validation/createGraphs | 24 +- .../system/controlDict | 1 + .../validation/createGraphs | 24 +- 185 files changed, 4727 insertions(+), 6308 deletions(-) delete mode 100644 applications/test/graph/Make/files delete mode 100644 applications/test/graph/Make/options delete mode 100644 applications/test/graph/Test-graph.C delete mode 100644 applications/test/graph/graphTest2.C delete mode 100644 applications/test/graphXi/Make/files delete mode 100644 applications/test/graphXi/Make/options delete mode 100644 applications/test/graphXi/Test-graphXi.C delete mode 100644 applications/test/graphXi/r.agr delete mode 100644 applications/test/graphXi/r.dat delete mode 100644 applications/test/graphXi/r.gplt delete mode 100644 applications/test/graphXi/r.ps delete mode 100644 applications/test/graphXi/r.xy create mode 100644 etc/caseDicts/postProcessing/graphs/graphCellFace create mode 100644 etc/caseDicts/postProcessing/graphs/graphCellFace.cfg create mode 100644 etc/caseDicts/postProcessing/graphs/graphFace create mode 100644 etc/caseDicts/postProcessing/graphs/graphFace.cfg rename src/{OpenFOAM => randomProcesses}/graph/curve/curve.C (96%) rename src/{OpenFOAM => randomProcesses}/graph/curve/curve.H (98%) rename src/{OpenFOAM => randomProcesses}/graph/curve/curveTools.C (100%) rename src/{OpenFOAM => randomProcesses}/graph/curve/curveTools.H (100%) rename src/{OpenFOAM => randomProcesses}/graph/graph.C (98%) rename src/{OpenFOAM => randomProcesses}/graph/graph.H (99%) rename src/{OpenFOAM => randomProcesses}/graph/writers/gnuplotGraph/gnuplotGraph.C (97%) rename src/{OpenFOAM => randomProcesses}/graph/writers/gnuplotGraph/gnuplotGraph.H (97%) rename src/{OpenFOAM => randomProcesses}/graph/writers/jplotGraph/jplotGraph.C (96%) rename src/{OpenFOAM => randomProcesses}/graph/writers/jplotGraph/jplotGraph.H (97%) rename src/{OpenFOAM => randomProcesses}/graph/writers/rawGraph/rawGraph.C (96%) rename src/{OpenFOAM => randomProcesses}/graph/writers/rawGraph/rawGraph.H (97%) rename src/{OpenFOAM => randomProcesses}/graph/writers/xmgrGraph/xmgrGraph.C (97%) rename src/{OpenFOAM => randomProcesses}/graph/writers/xmgrGraph/xmgrGraph.H (97%) rename src/sampling/{graphField/writePatchGraph.C => coordSet/coordSetTemplates.C} (60%) delete mode 100644 src/sampling/graphField/makeGraph.C delete mode 100644 src/sampling/graphField/makeGraph.H delete mode 100644 src/sampling/graphField/writeCellGraph.C delete mode 100644 src/sampling/graphField/writeCellGraph.H delete mode 100644 src/sampling/graphField/writePatchGraph.H rename src/sampling/sampledSet/{writers/setWriters.C => sampledSet/sampledSetCloud.C} (69%) rename src/sampling/sampledSet/{writers/xmgrace/xmgraceSetWriter.H => sampledSet/sampledSetCloud.H} (63%) create mode 100644 src/sampling/sampledSet/sampledSet/sampledSetParticle.C create mode 100644 src/sampling/sampledSet/sampledSet/sampledSetParticle.H delete mode 100644 src/sampling/sampledSet/sampledSets/IOsampledSets.H delete mode 100644 src/sampling/sampledSet/sampledSets/sampledSetsGrouping.C delete mode 100644 src/sampling/sampledSet/writers/csv/csvSetWriterRunTime.C delete mode 100644 src/sampling/sampledSet/writers/ensight/ensightSetWriterRunTime.C delete mode 100644 src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriterRunTime.C delete mode 100644 src/sampling/sampledSet/writers/jplot/jplotSetWriter.C delete mode 100644 src/sampling/sampledSet/writers/jplot/jplotSetWriter.H delete mode 100644 src/sampling/sampledSet/writers/raw/rawSetWriterRunTime.C rename src/sampling/sampledSet/writers/{jplot/jplotSetWriterRunTime.C => setWriterTemplates.C} (75%) delete mode 100644 src/sampling/sampledSet/writers/setWriters.H delete mode 100644 src/sampling/sampledSet/writers/vtk/vtkSetWriterRunTime.C delete mode 100644 src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C delete mode 100644 src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriterRunTime.C delete mode 100755 tutorials/incompressible/pimpleFoam/LES/channel395/Allclean diff --git a/applications/solvers/financial/financialFoam/financialFoam.C b/applications/solvers/financial/financialFoam/financialFoam.C index 8b21f09285..68b3f9fbbe 100644 --- a/applications/solvers/financial/financialFoam/financialFoam.C +++ b/applications/solvers/financial/financialFoam/financialFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,8 +30,9 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "writeCellGraph.H" #include "OSspecific.H" +#include "setWriter.H" +#include "writeFile.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,8 +74,20 @@ int main(int argc, char *argv[]) if (runTime.writeTime()) { - writeCellGraph(V, runTime.graphFormat()); - writeCellGraph(delta, runTime.graphFormat()); + setWriter::New(runTime.graphFormat())->write + ( + runTime.globalPath() + /functionObjects::writeFile::outputPrefix + /args.executable() + /runTime.timeName(), + + args.executable(), + + coordSet(true, word::null, mesh.C().primitiveField(), "x"), + + "V", V.primitiveField(), + "delta", delta.primitiveField() + ); } Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" diff --git a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C index a7c67c5fbe..4441e5a29c 100644 --- a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C +++ b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C @@ -41,7 +41,8 @@ Description #include "fvModels.H" #include "fvConstraints.H" #include "wallFvPatch.H" -#include "makeGraph.H" +#include "setWriter.H" +#include "writeFile.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/boundaryFoam/makeGraphs.H b/applications/solvers/incompressible/boundaryFoam/makeGraphs.H index 2691a796fa..17bbdaf89f 100644 --- a/applications/solvers/incompressible/boundaryFoam/makeGraphs.H +++ b/applications/solvers/incompressible/boundaryFoam/makeGraphs.H @@ -13,21 +13,32 @@ volSymmTensorField R runTime.write(); -const word& gFormat = runTime.graphFormat(); +setWriter::New(runTime.graphFormat())->write +( + runTime.globalPath() + /functionObjects::writeFile::outputPrefix + /args.executable() + /runTime.timeName(), -makeGraph(y, flowDirection & U, "Uf", gFormat); + args.executable(), -makeGraph(y, turbulence->nu(), gFormat); -makeGraph(y, turbulence->k(), gFormat); -makeGraph(y, turbulence->epsilon(), gFormat); + coordSet(true, "y", y), -makeGraph(y, flowDirection & R & flowDirection, "Rff", gFormat); -makeGraph(y, wallNormal & R & wallNormal, "Rww", gFormat); -makeGraph(y, flowDirection & R & wallNormal, "Rfw", gFormat); + "Uf", (flowDirection & U)().primitiveField(), -makeGraph(y, sqrt(mag(R.component(symmTensor::XX))), "u", gFormat); -makeGraph(y, sqrt(mag(R.component(symmTensor::YY))), "v", gFormat); -makeGraph(y, sqrt(mag(R.component(symmTensor::ZZ))), "w", gFormat); -makeGraph(y, R.component(symmTensor::XY), "uv", gFormat); + "nu", turbulence->nu()().primitiveField(), + "k", turbulence->nu()().primitiveField(), + "epsilon", turbulence->nu()().primitiveField(), -makeGraph(y, mag(fvc::grad(U)), "gammaDot", gFormat); + "Rff", (flowDirection & R & flowDirection)().primitiveField(), + "Rww", (wallNormal & R & wallNormal)().primitiveField(), + "Rfw", (flowDirection & R & wallNormal)().primitiveField(), + + "u", sqrt(mag(R.component(symmTensor::XX)))().primitiveField(), + "v", sqrt(mag(R.component(symmTensor::YY)))().primitiveField(), + "w", sqrt(mag(R.component(symmTensor::ZZ)))().primitiveField(), + + "uv", R.component(symmTensor::XY)().primitiveField(), + + "gammaDot", mag(fvc::grad(U))().primitiveField() +); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C index 6fe1fc5871..02b761dc47 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C @@ -130,16 +130,10 @@ void Foam::functionObjects::sizeDistribution::correctVolAverages() } N_[i] = gSum(V*Ni)/this->V(); + V_[i] = fi.x().value(); a_[i] = gSum(V*ai)/this->V(); d_[i] = gSum(V*di)/this->V(); } - - forAll(bins_, i) - { - const Foam::diameterModels::sizeGroup& fi = popBal_.sizeGroups()[i]; - - bins_[i] = point(fi.x().value(), a_[i], d_[i]); - } } @@ -154,13 +148,15 @@ void Foam::functionObjects::sizeDistribution::writeMoments() writeTime(file()); } + const scalarField& bin = this->bin(); + for (label k = 0; k <= maxOrder_; k++) { scalar result = 0; forAll(N_, i) { - result += pow(bins_[i][binCmpt_], k)*N_[i]; + result += pow(bin[i], k)*N_[i]; } if (Pstream::master()) @@ -192,23 +188,25 @@ void Foam::functionObjects::sizeDistribution::writeStdDev() scalar mean = 0; scalar var = 0; - if(sum(N_) != 0) + const scalarField& bin = this->bin(); + + if (sum(N_) != 0) { if (geometric_) { - mean = exp(sum(Foam::log(bins_.component(binCmpt_))*N_/sum(N_))); + mean = exp(sum(Foam::log(bin)*N_/sum(N_))); var = - sum(sqr(Foam::log(bins_.component(binCmpt_)) - Foam::log(mean)) + sum(sqr(Foam::log(bin) - Foam::log(mean)) *N_/sum(N_)); stdDev = exp(sqrt(var)); } else { - mean = sum(bins_.component(binCmpt_)*N_/sum(N_)); + mean = sum(bin*N_/sum(N_)); - var = sum(sqr(bins_.component(binCmpt_) - mean)*N_/sum(N_)); + var = sum(sqr(bin - mean)*N_/sum(N_)); stdDev = sqrt(var); } @@ -225,6 +223,8 @@ void Foam::functionObjects::sizeDistribution::writeDistribution() { scalarField result(N_); + const scalarField& bin = this->bin(); + switch (functionType_) { case ftNumber: @@ -239,7 +239,7 @@ void Foam::functionObjects::sizeDistribution::writeDistribution() Log << " writing volume distribution. " << endl; - result *= bins_.component(0); + result *= V_; break; } @@ -263,12 +263,12 @@ void Foam::functionObjects::sizeDistribution::writeDistribution() { List bndrs(N_.size() + 1); - bndrs.first() = bins_.first()[binCmpt_]; - bndrs.last() = bins_.last()[binCmpt_]; + bndrs.first() = bin.first(); + bndrs.last() = bin.last(); for (label i = 1; i < N_.size(); i++) { - bndrs[i] = (bins_[i][binCmpt_] + bins_[i-1][binCmpt_])/2.0; + bndrs[i] = (bin[i]+ bin[i-1])/2.0; } forAll(result, i) @@ -287,15 +287,19 @@ void Foam::functionObjects::sizeDistribution::writeDistribution() if (Pstream::master()) { - const coordSet coords + formatterPtr_->write ( - "sizeDistribution", - "xyz", - bins_, - mag(bins_) + file_.baseTimeDir(), + name(), + coordSet(true, "volume", V_), + "area", + a_, + "diameter", + d_, + word(functionTypeNames_[functionType_]) + + (densityFunction_ ? "Density" : "Concentration"), + result ); - - writeGraph(coords, functionTypeNames_[functionType_], result); } } @@ -347,44 +351,6 @@ void Foam::functionObjects::sizeDistribution::writeFileHeader } -void Foam::functionObjects::sizeDistribution::writeGraph -( - const coordSet& coords, - const word& functionTypeName, - const scalarField& values -) -{ - const wordList functionTypeNames(1, functionTypeName); - - fileName outputPath = file_.baseTimeDir(); - - mkDir(outputPath); - OFstream graphFile - ( - outputPath/(this->name() + ".dat") - ); - - volRegion::writeFileHeader(file_, graphFile); - - file_.writeCommented(graphFile, "Volume area diameter " + functionTypeName); - - if (densityFunction_) - { - graphFile << "Density"; - } - else - { - graphFile << "Concentration"; - } - - graphFile << endl; - - List yPtrs(1); - yPtrs[0] = &values; - scalarFormatter_().write(coords, functionTypeNames, yPtrs, graphFile); -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::functionObjects::sizeDistribution::sizeDistribution @@ -409,42 +375,11 @@ Foam::functionObjects::sizeDistribution::sizeDistribution functionType_(functionTypeNames_.read(dict.lookup("functionType"))), coordinateType_(coordinateTypeNames_.read(dict.lookup("coordinateType"))), N_(popBal_.sizeGroups().size(), 0), + V_(popBal_.sizeGroups().size(), 0), a_(popBal_.sizeGroups().size(), 0), - d_(popBal_.sizeGroups().size(), 0), - bins_(N_.size()), - binCmpt_(0) + d_(popBal_.sizeGroups().size(), 0) { read(dict); - - switch (coordinateType_) - { - case ctVolume: - { - binCmpt_ = 0; - - break; - } - case ctArea: - { - binCmpt_ = 1; - - break; - } - case ctDiameter: - { - binCmpt_ = 2; - - break; - } - case ctProjectedAreaDiameter: - { - binCmpt_ = 2; - - break; - } - } - - scalarFormatter_ = setWriter::New("raw"); } @@ -465,6 +400,8 @@ bool Foam::functionObjects::sizeDistribution::read(const dictionary& dict) geometric_ = dict.lookupOrDefault("geometric", false); maxOrder_ = dict.lookupOrDefault("maxOrder", 3); + formatterPtr_ = setWriter::New(dict.lookup("setFormat"), dict); + resetName(name()); return false; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.H b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.H index 3a2c859f4e..ea684746cc 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.H @@ -134,8 +134,8 @@ protected: //- File containing data for all functionTypes except moments writeFile file_; - //- Output formatter, set to raw - autoPtr> scalarFormatter_; + //- Output formatter + autoPtr formatterPtr_; //- Reference to populationBalanceModel const Foam::diameterModels::populationBalanceModel& popBal_; @@ -149,6 +149,9 @@ protected: //- List of volume-averaged number concentrations scalarField N_; + //- ??? + scalarField V_; + //- List of volume-averaged surface areas scalarField a_; @@ -167,18 +170,29 @@ protected: //- Highest moment order label maxOrder_; - //- Bins (representative volume/area/diameter) - pointField bins_; - - //- Bin component used according to chosen coordinate type - label binCmpt_; - // Protected Member Functions //- Filter field according to cellIds tmp filterField(const scalarField& field) const; + //- Bin component used according to chosen coordinate type + inline const scalarField& bin() const + { + switch (coordinateType_) + { + case ctVolume: + return V_; + case ctArea: + return a_; + case ctDiameter: + return d_; + case ctProjectedAreaDiameter: + return d_; + } + return scalarField::null(); + } + //- Correct volume averages void correctVolAverages(); @@ -194,14 +208,6 @@ protected: //- Output file header information for functionType moments virtual void writeFileHeader(const label i); - //- Output function for all functionType number/volume - void writeGraph - ( - const coordSet& coords, - const word& functionTypeName, - const scalarField& values - ); - public: diff --git a/applications/test/graph/Make/files b/applications/test/graph/Make/files deleted file mode 100644 index 337a894c04..0000000000 --- a/applications/test/graph/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -Test-graph.C - -EXE = $(FOAM_USER_APPBIN)/Test-graph diff --git a/applications/test/graph/Make/options b/applications/test/graph/Make/options deleted file mode 100644 index 73db7f9560..0000000000 --- a/applications/test/graph/Make/options +++ /dev/null @@ -1,7 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lsampling \ - -lmeshTools diff --git a/applications/test/graph/Test-graph.C b/applications/test/graph/Test-graph.C deleted file mode 100644 index 42dc9d735d..0000000000 --- a/applications/test/graph/Test-graph.C +++ /dev/null @@ -1,70 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - graphTest - -Description - Test program for making graphs - -\*---------------------------------------------------------------------------*/ - -#include "graph.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main() -{ - scalarField alpha(200); - scalarField phie(alpha.size()); - scalarField phic(alpha.size()); - - forAll(alpha, i) - { - alpha[i] = scalar(i)/50.0; - } - - scalar R = 5.0; - - phie = (R - 1)/(sqrt(R/(alpha + 1.0e-6)) + 1.0) + 1.0; - phic = (R - 1)/(sqrt(R*alpha) + 1.0) + 1.0; - - - graph phi("@f! (R = 5)", "@a!", "@f!", alpha); - phi.insert - ( - "@f!&e!", new curve("@f!&e!", curve::curveStyle::CONTINUOUS, phie) - ); - phi.insert - ( - "@f!&c!", new curve("@f!&c!", curve::curveStyle::CONTINUOUS, phic) - ); - phi.write("phi", "xmgr"); - - Info<< "end" << endl; -} - - -// ************************************************************************* // diff --git a/applications/test/graph/graphTest2.C b/applications/test/graph/graphTest2.C deleted file mode 100644 index 9a463e836e..0000000000 --- a/applications/test/graph/graphTest2.C +++ /dev/null @@ -1,64 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - graphTest - -Description - Test program for making graphs - -\*---------------------------------------------------------------------------*/ - -#include "graph.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main() -{ - scalarField eta(200); - scalarField C1mR(eta.size()); - - forAll(eta, i) - { - eta[i] = scalar(i)/10.0; - } - - scalar C1 = 1.42; - scalar eta0 = 4.38; - scalar beta = 0.012; - - C1mR = C1 - ((eta*(1.0 - eta/eta0))/(1.0 + beta*pow(eta, 3.0))); - - graph("C&1! - R", "C&1! - R", "@h!", eta, C1mR).write - ( - "C1mR", - "xmgr" - ); - - Info<< "end" << endl; -} - - -// ************************************************************************* // diff --git a/applications/test/graphXi/Make/files b/applications/test/graphXi/Make/files deleted file mode 100644 index 344e4ddc20..0000000000 --- a/applications/test/graphXi/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -Test-graphXi.C - -EXE = $(FOAM_USER_APPBIN)/Test-graphXi diff --git a/applications/test/graphXi/Make/options b/applications/test/graphXi/Make/options deleted file mode 100644 index 73db7f9560..0000000000 --- a/applications/test/graphXi/Make/options +++ /dev/null @@ -1,7 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lsampling \ - -lmeshTools diff --git a/applications/test/graphXi/Test-graphXi.C b/applications/test/graphXi/Test-graphXi.C deleted file mode 100644 index b507ee2bdb..0000000000 --- a/applications/test/graphXi/Test-graphXi.C +++ /dev/null @@ -1,66 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - graphTest - -Description - Test program for making graphs - -\*---------------------------------------------------------------------------*/ - -#include "graph.H" -#include "OFstream.H" -#include "mathematicalConstants.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main() -{ - scalarField x(100); - scalarField r(x.size()); - - forAll(x, i) - { - x[i] = -3 + 0.06*i; - } - - scalarField b(0.5*(1.0 + erf(x))); - scalarField c(1.0 - b); - scalarField gradb((1/::sqrt(constant::mathematical::pi))*exp(-sqr(x))); - scalarField lapb(-2*x*gradb); - - r = lapb*b*c/(gradb*gradb); - - - graph("r", "x", "r", x, r).write("r", "xmgr"); - - Info<< "end" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/test/graphXi/r.agr b/applications/test/graphXi/r.agr deleted file mode 100644 index d012ca6512..0000000000 --- a/applications/test/graphXi/r.agr +++ /dev/null @@ -1,107 +0,0 @@ -@title "r" -@xaxis label "x" -@yaxis label "r" -@s0 legend "r" -@target G0.S0 -@type xy --3 0.951803 --2.94 0.950065 --2.88 0.948234 --2.82 0.946302 --2.76 0.944261 --2.7 0.942103 --2.64 0.939817 --2.58 0.937392 --2.52 0.934816 --2.46 0.932074 --2.4 0.929149 --2.34 0.926023 --2.28 0.922673 --2.22 0.919075 --2.16 0.915199 --2.1 0.911012 --2.04 0.906476 --1.98 0.901547 --1.92 0.896176 --1.86 0.890307 --1.8 0.883875 --1.74 0.87681 --1.68 0.869032 --1.62 0.860453 --1.56 0.850978 --1.5 0.840503 --1.44 0.828916 --1.38 0.8161 --1.32 0.801931 --1.26 0.786282 --1.2 0.769024 --1.14 0.750029 --1.08 0.729172 --1.02 0.706337 --0.96 0.681414 --0.9 0.654311 --0.84 0.624951 --0.78 0.59328 --0.72 0.559268 --0.66 0.522911 --0.6 0.48424 --0.54 0.443314 --0.48 0.40023 --0.42 0.355116 --0.36 0.308137 --0.3 0.259489 --0.24 0.2094 --0.18 0.158121 --0.12 0.10593 --0.06 0.0531214 --1.11022e-16 9.8391e-17 -0.06 -0.0531214 -0.12 -0.10593 -0.18 -0.158121 -0.24 -0.2094 -0.3 -0.259489 -0.36 -0.308137 -0.42 -0.355116 -0.48 -0.40023 -0.54 -0.443314 -0.6 -0.48424 -0.66 -0.522911 -0.72 -0.559268 -0.78 -0.59328 -0.84 -0.624951 -0.9 -0.654311 -0.96 -0.681414 -1.02 -0.706337 -1.08 -0.729172 -1.14 -0.750029 -1.2 -0.769024 -1.26 -0.786282 -1.32 -0.801931 -1.38 -0.8161 -1.44 -0.828916 -1.5 -0.840503 -1.56 -0.850978 -1.62 -0.860453 -1.68 -0.869032 -1.74 -0.87681 -1.8 -0.883875 -1.86 -0.890307 -1.92 -0.896176 -1.98 -0.901547 -2.04 -0.906476 -2.1 -0.911012 -2.16 -0.915199 -2.22 -0.919075 -2.28 -0.922673 -2.34 -0.926023 -2.4 -0.929149 -2.46 -0.932074 -2.52 -0.934816 -2.58 -0.937392 -2.64 -0.939817 -2.7 -0.942103 -2.76 -0.944261 -2.82 -0.946302 -2.88 -0.948234 -2.94 -0.950065 - diff --git a/applications/test/graphXi/r.dat b/applications/test/graphXi/r.dat deleted file mode 100644 index 28642e4680..0000000000 --- a/applications/test/graphXi/r.dat +++ /dev/null @@ -1,103 +0,0 @@ -# JPlot file -# column 1: x -# column 2: r --3 0.951803 --2.94 0.950065 --2.88 0.948234 --2.82 0.946302 --2.76 0.944261 --2.7 0.942103 --2.64 0.939817 --2.58 0.937392 --2.52 0.934816 --2.46 0.932074 --2.4 0.929149 --2.34 0.926023 --2.28 0.922673 --2.22 0.919075 --2.16 0.915199 --2.1 0.911012 --2.04 0.906476 --1.98 0.901547 --1.92 0.896176 --1.86 0.890307 --1.8 0.883875 --1.74 0.87681 --1.68 0.869032 --1.62 0.860453 --1.56 0.850978 --1.5 0.840503 --1.44 0.828916 --1.38 0.8161 --1.32 0.801931 --1.26 0.786282 --1.2 0.769024 --1.14 0.750029 --1.08 0.729172 --1.02 0.706337 --0.96 0.681414 --0.9 0.654311 --0.84 0.624951 --0.78 0.59328 --0.72 0.559268 --0.66 0.522911 --0.6 0.48424 --0.54 0.443314 --0.48 0.40023 --0.42 0.355116 --0.36 0.308137 --0.3 0.259489 --0.24 0.2094 --0.18 0.158121 --0.12 0.10593 --0.06 0.0531214 --1.11022e-16 9.8391e-17 -0.06 -0.0531214 -0.12 -0.10593 -0.18 -0.158121 -0.24 -0.2094 -0.3 -0.259489 -0.36 -0.308137 -0.42 -0.355116 -0.48 -0.40023 -0.54 -0.443314 -0.6 -0.48424 -0.66 -0.522911 -0.72 -0.559268 -0.78 -0.59328 -0.84 -0.624951 -0.9 -0.654311 -0.96 -0.681414 -1.02 -0.706337 -1.08 -0.729172 -1.14 -0.750029 -1.2 -0.769024 -1.26 -0.786282 -1.32 -0.801931 -1.38 -0.8161 -1.44 -0.828916 -1.5 -0.840503 -1.56 -0.850978 -1.62 -0.860453 -1.68 -0.869032 -1.74 -0.87681 -1.8 -0.883875 -1.86 -0.890307 -1.92 -0.896176 -1.98 -0.901547 -2.04 -0.906476 -2.1 -0.911012 -2.16 -0.915199 -2.22 -0.919075 -2.28 -0.922673 -2.34 -0.926023 -2.4 -0.929149 -2.46 -0.932074 -2.52 -0.934816 -2.58 -0.937392 -2.64 -0.939817 -2.7 -0.942103 -2.76 -0.944261 -2.82 -0.946302 -2.88 -0.948234 -2.94 -0.950065 diff --git a/applications/test/graphXi/r.gplt b/applications/test/graphXi/r.gplt deleted file mode 100644 index 29092adf71..0000000000 --- a/applications/test/graphXi/r.gplt +++ /dev/null @@ -1,110 +0,0 @@ -#set term postscript color -set output "r.ps" -set title "r" 0,0 -show title -set xlabel "x" 0,0 -show xlabel -set ylabel "r" 0,0 -show ylabel -plot'-' title "r" with lines; pause -1 - --3 0.951803 --2.94 0.950065 --2.88 0.948234 --2.82 0.946302 --2.76 0.944261 --2.7 0.942103 --2.64 0.939817 --2.58 0.937392 --2.52 0.934816 --2.46 0.932074 --2.4 0.929149 --2.34 0.926023 --2.28 0.922673 --2.22 0.919075 --2.16 0.915199 --2.1 0.911012 --2.04 0.906476 --1.98 0.901547 --1.92 0.896176 --1.86 0.890307 --1.8 0.883875 --1.74 0.87681 --1.68 0.869032 --1.62 0.860453 --1.56 0.850978 --1.5 0.840503 --1.44 0.828916 --1.38 0.8161 --1.32 0.801931 --1.26 0.786282 --1.2 0.769024 --1.14 0.750029 --1.08 0.729172 --1.02 0.706337 --0.96 0.681414 --0.9 0.654311 --0.84 0.624951 --0.78 0.59328 --0.72 0.559268 --0.66 0.522911 --0.6 0.48424 --0.54 0.443314 --0.48 0.40023 --0.42 0.355116 --0.36 0.308137 --0.3 0.259489 --0.24 0.2094 --0.18 0.158121 --0.12 0.10593 --0.06 0.0531214 --1.11022e-16 9.8391e-17 -0.06 -0.0531214 -0.12 -0.10593 -0.18 -0.158121 -0.24 -0.2094 -0.3 -0.259489 -0.36 -0.308137 -0.42 -0.355116 -0.48 -0.40023 -0.54 -0.443314 -0.6 -0.48424 -0.66 -0.522911 -0.72 -0.559268 -0.78 -0.59328 -0.84 -0.624951 -0.9 -0.654311 -0.96 -0.681414 -1.02 -0.706337 -1.08 -0.729172 -1.14 -0.750029 -1.2 -0.769024 -1.26 -0.786282 -1.32 -0.801931 -1.38 -0.8161 -1.44 -0.828916 -1.5 -0.840503 -1.56 -0.850978 -1.62 -0.860453 -1.68 -0.869032 -1.74 -0.87681 -1.8 -0.883875 -1.86 -0.890307 -1.92 -0.896176 -1.98 -0.901547 -2.04 -0.906476 -2.1 -0.911012 -2.16 -0.915199 -2.22 -0.919075 -2.28 -0.922673 -2.34 -0.926023 -2.4 -0.929149 -2.46 -0.932074 -2.52 -0.934816 -2.58 -0.937392 -2.64 -0.939817 -2.7 -0.942103 -2.76 -0.944261 -2.82 -0.946302 -2.88 -0.948234 -2.94 -0.950065 diff --git a/applications/test/graphXi/r.ps b/applications/test/graphXi/r.ps deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/applications/test/graphXi/r.xy b/applications/test/graphXi/r.xy deleted file mode 100644 index d6d8f2b40c..0000000000 --- a/applications/test/graphXi/r.xy +++ /dev/null @@ -1,100 +0,0 @@ --3 0.951803 --2.94 0.950065 --2.88 0.948234 --2.82 0.946302 --2.76 0.944261 --2.7 0.942103 --2.64 0.939817 --2.58 0.937392 --2.52 0.934816 --2.46 0.932074 --2.4 0.929149 --2.34 0.926023 --2.28 0.922673 --2.22 0.919075 --2.16 0.915199 --2.1 0.911012 --2.04 0.906476 --1.98 0.901547 --1.92 0.896176 --1.86 0.890307 --1.8 0.883875 --1.74 0.87681 --1.68 0.869032 --1.62 0.860453 --1.56 0.850978 --1.5 0.840503 --1.44 0.828916 --1.38 0.8161 --1.32 0.801931 --1.26 0.786282 --1.2 0.769024 --1.14 0.750029 --1.08 0.729172 --1.02 0.706337 --0.96 0.681414 --0.9 0.654311 --0.84 0.624951 --0.78 0.59328 --0.72 0.559268 --0.66 0.522911 --0.6 0.48424 --0.54 0.443314 --0.48 0.40023 --0.42 0.355116 --0.36 0.308137 --0.3 0.259489 --0.24 0.2094 --0.18 0.158121 --0.12 0.10593 --0.06 0.0531214 --1.11022e-16 9.8391e-17 -0.06 -0.0531214 -0.12 -0.10593 -0.18 -0.158121 -0.24 -0.2094 -0.3 -0.259489 -0.36 -0.308137 -0.42 -0.355116 -0.48 -0.40023 -0.54 -0.443314 -0.6 -0.48424 -0.66 -0.522911 -0.72 -0.559268 -0.78 -0.59328 -0.84 -0.624951 -0.9 -0.654311 -0.96 -0.681414 -1.02 -0.706337 -1.08 -0.729172 -1.14 -0.750029 -1.2 -0.769024 -1.26 -0.786282 -1.32 -0.801931 -1.38 -0.8161 -1.44 -0.828916 -1.5 -0.840503 -1.56 -0.850978 -1.62 -0.860453 -1.68 -0.869032 -1.74 -0.87681 -1.8 -0.883875 -1.86 -0.890307 -1.92 -0.896176 -1.98 -0.901547 -2.04 -0.906476 -2.1 -0.911012 -2.16 -0.915199 -2.22 -0.919075 -2.28 -0.922673 -2.34 -0.926023 -2.4 -0.929149 -2.46 -0.932074 -2.52 -0.934816 -2.58 -0.937392 -2.64 -0.939817 -2.7 -0.942103 -2.76 -0.944261 -2.82 -0.946302 -2.88 -0.948234 -2.94 -0.950065 diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C index 49cc85a356..392a580224 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C @@ -300,7 +300,8 @@ Foam::tmp Foam::automatic::load() vtkSurfaceWriter ( - surface_.searchableSurface::time().writeFormat() + surface_.searchableSurface::time().writeFormat(), + surface_.searchableSurface::time().writeCompression() ).write ( surface_.searchableSurface::time().constant()/ diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index f539b5ef14..08d6a28e2d 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -523,7 +523,11 @@ void Foam::writeAMIWeightsSum // Write the surface if (Pstream::master()) { - vtkSurfaceWriter(mesh.time().writeFormat()).write + vtkSurfaceWriter + ( + mesh.time().writeFormat(), + mesh.time().writeCompression() + ).write ( file.path(), "weightsSum_" + file.name(), @@ -581,7 +585,7 @@ Foam::label Foam::checkGeometry const polyMesh& mesh, const bool allGeometry, const autoPtr& surfWriter, - const autoPtr>& setWriter + const autoPtr& setWriter ) { label noFailedChecks = 0; diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.H b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.H index ba95d7488f..21c7234f94 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.H +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.H @@ -40,6 +40,6 @@ namespace Foam const polyMesh& mesh, const bool allGeometry, const autoPtr&, - const autoPtr>& + const autoPtr& ); } diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C index d3d976c855..94bf2a252e 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C @@ -160,17 +160,20 @@ int main(int argc, char *argv[]) autoPtr surfWriter; - autoPtr> setWriter; + autoPtr setWriter; if (writeSets) { surfWriter = surfaceWriter::New ( surfaceFormat, - mesh.time().writeFormat() + mesh.time().writeFormat(), + mesh.time().writeCompression() ); - setWriter = Foam::setWriter::New + setWriter = Foam::setWriter::New ( - vtkSetWriter::typeName + vtkSetWriter::typeName, + mesh.time().writeFormat(), + mesh.time().writeCompression() ); } diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTools.C b/applications/utilities/mesh/manipulation/checkMesh/checkTools.C index 827ac5dea0..e182adaacf 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTools.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTools.C @@ -42,6 +42,7 @@ License #include "globalIndex.H" #include "PatchTools.H" #include "writeFile.H" +#include "coordSet.H" void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology) @@ -377,7 +378,7 @@ void Foam::mergeAndWrite void Foam::mergeAndWrite ( - const setWriter& writer, + const setWriter& writer, const pointSet& set ) { @@ -447,41 +448,19 @@ void Foam::mergeAndWrite mergedPts = pointField(mesh.points(), mergedIDs); } - // Write with scalar pointID if (Pstream::master()) { - scalarField scalarPointIDs(mergedIDs.size()); - forAll(mergedIDs, i) - { - scalarPointIDs[i] = 1.0*mergedIDs[i]; - } - - coordSet points(set.name(), "distance", mergedPts, mag(mergedPts)); - - List flds(1, &scalarPointIDs); - - wordList fldNames(1, "pointID"); - - // Output e.g. pointSet p0 to - // postProcessing/