mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: snappyHexMesh: writing pointLevel,cellLevel under switch
This commit is contained in:
@ -655,6 +655,7 @@ void writeMesh
|
|||||||
(
|
(
|
||||||
const string& msg,
|
const string& msg,
|
||||||
const meshRefinement& meshRefiner,
|
const meshRefinement& meshRefiner,
|
||||||
|
const bool writeLevel,
|
||||||
const label debug
|
const label debug
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -663,21 +664,21 @@ void writeMesh
|
|||||||
meshRefiner.printMeshInfo(debug, msg);
|
meshRefiner.printMeshInfo(debug, msg);
|
||||||
Info<< "Writing mesh to time " << meshRefiner.timeName() << endl;
|
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)
|
if (debug & meshRefinement::OBJINTERSECTIONS)
|
||||||
{
|
{
|
||||||
meshRefiner.write
|
flag |= meshRefinement::OBJINTERSECTIONS;
|
||||||
(
|
|
||||||
meshRefinement::OBJINTERSECTIONS,
|
|
||||||
mesh.time().path()/meshRefiner.timeName()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
meshRefiner.write(flag, mesh.time().path()/meshRefiner.timeName());
|
||||||
Info<< "Wrote mesh in = "
|
Info<< "Wrote mesh in = "
|
||||||
<< mesh.time().cpuTimeIncrement() << " s." << endl;
|
<< mesh.time().cpuTimeIncrement() << " s." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
# include "addOverwriteOption.H"
|
# include "addOverwriteOption.H"
|
||||||
@ -692,20 +693,24 @@ int main(int argc, char *argv[])
|
|||||||
"boundBox",
|
"boundBox",
|
||||||
"simplify the surface using snappyHexMesh starting from a boundBox"
|
"simplify the surface using snappyHexMesh starting from a boundBox"
|
||||||
);
|
);
|
||||||
|
Foam::argList::addBoolOption
|
||||||
|
(
|
||||||
|
"writeLevel",
|
||||||
|
"write pointLevel and cellLevel postprocessing files"
|
||||||
|
);
|
||||||
Foam::argList::addOption
|
Foam::argList::addOption
|
||||||
(
|
(
|
||||||
"patches",
|
"patches",
|
||||||
"(patch0 .. patchN)",
|
"(patch0 .. patchN)",
|
||||||
"only triangulate selected patches (wildcards supported)"
|
"only triangulate selected patches (wildcards supported)"
|
||||||
);
|
);
|
||||||
|
|
||||||
Foam::argList::addOption
|
Foam::argList::addOption
|
||||||
(
|
(
|
||||||
"outFile",
|
"outFile",
|
||||||
"fileName",
|
"fileName",
|
||||||
"name of the file to save the simplified surface to"
|
"name of the file to save the simplified surface to"
|
||||||
);
|
);
|
||||||
|
# include "addDictOption.H"
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -714,6 +719,7 @@ int main(int argc, char *argv[])
|
|||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.optionFound("overwrite");
|
||||||
const bool checkGeometry = args.optionFound("checkGeometry");
|
const bool checkGeometry = args.optionFound("checkGeometry");
|
||||||
const bool surfaceSimplify = args.optionFound("surfaceSimplify");
|
const bool surfaceSimplify = args.optionFound("surfaceSimplify");
|
||||||
|
const bool writeLevel = args.optionFound("writeLevel");
|
||||||
|
|
||||||
autoPtr<fvMesh> meshPtr;
|
autoPtr<fvMesh> meshPtr;
|
||||||
|
|
||||||
@ -853,17 +859,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// Read meshing dictionary
|
// Read meshing dictionary
|
||||||
IOdictionary meshDict
|
const word dictName("snappyHexMeshDict");
|
||||||
(
|
#include "setSystemMeshDictionaryIO.H"
|
||||||
IOobject
|
const IOdictionary meshDict(dictIO);
|
||||||
(
|
|
||||||
"snappyHexMeshDict",
|
|
||||||
runTime.system(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// all surface geometry
|
// all surface geometry
|
||||||
const dictionary& geometryDict = meshDict.subDict("geometry");
|
const dictionary& geometryDict = meshDict.subDict("geometry");
|
||||||
@ -1360,6 +1359,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"Refined mesh",
|
"Refined mesh",
|
||||||
meshRefiner,
|
meshRefiner,
|
||||||
|
writeLevel,
|
||||||
debug
|
debug
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1392,6 +1392,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"Snapped mesh",
|
"Snapped mesh",
|
||||||
meshRefiner,
|
meshRefiner,
|
||||||
|
writeLevel,
|
||||||
debug
|
debug
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1440,6 +1441,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"Layer mesh",
|
"Layer mesh",
|
||||||
meshRefiner,
|
meshRefiner,
|
||||||
|
writeLevel,
|
||||||
debug
|
debug
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user