Skip to content

Commit

Permalink
ENH: snappyHexMesh: writing pointLevel,cellLevel under switch
Browse files Browse the repository at this point in the history
  • Loading branch information
mattijs committed Jul 9, 2013
1 parent 6a2b4f4 commit 7441c73
Showing 1 changed file with 18 additions and 8 deletions.
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -96,6 +96,7 @@ void writeMesh
(
const string& msg,
const meshRefinement& meshRefiner,
const bool writeLevel,
const label debug
)
{
Expand All @@ -104,21 +105,21 @@ void writeMesh
meshRefiner.printMeshInfo(debug, msg);
Info<< "Writing mesh to time " << meshRefiner.timeName() << endl;

meshRefiner.write(meshRefinement::MESH|meshRefinement::SCALARLEVELS, "");
label flag = meshRefinement::MESH;
if (writeLevel)
{
flag |= meshRefinement::SCALARLEVELS;
}
if (debug & meshRefinement::OBJINTERSECTIONS)
{
meshRefiner.write
(
meshRefinement::OBJINTERSECTIONS,
mesh.time().path()/meshRefiner.timeName()
);
flag |= meshRefinement::OBJINTERSECTIONS;
}
meshRefiner.write(flag, mesh.time().path()/meshRefiner.timeName());
Info<< "Wrote mesh in = "
<< mesh.time().cpuTimeIncrement() << " s." << endl;
}



int main(int argc, char *argv[])
{
# include "addOverwriteOption.H"
Expand All @@ -127,6 +128,11 @@ int main(int argc, char *argv[])
"checkGeometry",
"check all surface geometry for quality"
);
Foam::argList::addBoolOption
(
"writeLevel",
"write pointLevel and cellLevel postprocessing files"
);

# include "setRootCase.H"
# include "createTime.H"
Expand All @@ -138,6 +144,7 @@ int main(int argc, char *argv[])

const bool overwrite = args.optionFound("overwrite");
const bool checkGeometry = args.optionFound("checkGeometry");
const bool writeLevel = args.optionFound("writeLevel");

// Check patches and faceZones are synchronised
mesh.boundaryMesh().checkParallelSync(true);
Expand Down Expand Up @@ -576,6 +583,7 @@ int main(int argc, char *argv[])
(
"Refined mesh",
meshRefiner,
writeLevel,
debug
);

Expand Down Expand Up @@ -614,6 +622,7 @@ int main(int argc, char *argv[])
(
"Snapped mesh",
meshRefiner,
writeLevel,
debug
);

Expand Down Expand Up @@ -667,6 +676,7 @@ int main(int argc, char *argv[])
(
"Layer mesh",
meshRefiner,
writeLevel,
debug
);

Expand Down

0 comments on commit 7441c73

Please sign in to comment.