snappyHexMesh: Added "noRefinement" writeFlag to control the writing of cellLevel, pointLevel etc. files

By default snappyHexMesh writes files relating to the hex-splitting process into
the polyMesh directory: cellLevel level0Edge pointLevel surfaceIndex

but by setting the noRefinement flag:

writeFlags
(
    noRefinement
    .
    .
    .
);

these optional files which are generally not needed are not written.

If you run the three stages of snappyHexMesh separately or run a dynamic mesh
solver supporting refinement and unrefinement these files are needed
and "noRefinement" should not be set.
This commit is contained in:
Henry Weller
2017-01-24 22:28:36 +00:00
parent 9b319dab61
commit 4e5dc43418
4 changed files with 24 additions and 137 deletions

View File

@ -70,7 +70,6 @@ namespace Foam
>::names[] =
{
"mesh",
//"scalarLevels",
"intersections",
"featureSeeds",
"attraction",
@ -91,10 +90,11 @@ namespace Foam
const char* Foam::NamedEnum
<
Foam::meshRefinement::IOwriteType,
4
5
>::names[] =
{
"mesh",
"noRefinement",
"scalarLevels",
"layerSets",
"layerFields"
@ -108,7 +108,7 @@ Foam::meshRefinement::IOdebugTypeNames;
const Foam::NamedEnum<Foam::meshRefinement::IOoutputType, 1>
Foam::meshRefinement::IOoutputTypeNames;
const Foam::NamedEnum<Foam::meshRefinement::IOwriteType, 4>
const Foam::NamedEnum<Foam::meshRefinement::IOwriteType, 5>
Foam::meshRefinement::IOwriteTypeNames;
@ -2565,11 +2565,7 @@ void Foam::meshRefinement::updateMesh
bool Foam::meshRefinement::write() const
{
bool writeOk =
mesh_.write()
&& meshCutter_.write()
&& surfaceIndex_.write();
bool writeOk = mesh_.write();
// Make sure that any distributed surfaces (so ones which probably have
// been changed) get written as well.
@ -2908,10 +2904,18 @@ void Foam::meshRefinement::write
{
write();
}
if (writeFlags && !(writeFlags & NOWRITEREFINEMENT))
{
meshCutter_.write();
surfaceIndex_.write();
}
if (writeFlags & WRITELEVELS)
{
dumpRefinementLevel();
}
if (debugFlags & OBJINTERSECTIONS && prefix.size())
{
dumpIntersections(prefix);