Commit 9a47b26f authored by Alen Cukrov's avatar Alen Cukrov
Browse files

Disallow empty patches on 3D meshes.

parent 366d854f
......@@ -188,7 +188,7 @@ void cartesian2DMeshGenerator::refBoundaryLayers()
void cartesian2DMeshGenerator::replaceBoundaries()
{
renameBoundaryPatches rbp(mesh_, meshDict_);
renameBoundaryPatches rbp(mesh_, meshDict_, true);
}
void cartesian2DMeshGenerator::renumberMesh()
......
......@@ -248,19 +248,40 @@ void renameBoundaryPatches::calculateNewBoundary()
Info << "Finished renaming boundary patches" << endl;
}
void renameBoundaryPatches::checkEmptyPatches()
{
polyMeshGenModifier meshModifier(mesh_);
forAll(mesh_.boundaries(), patchI)
{
boundaryPatch& patch = meshModifier.boundariesAccess()[patchI];
if( patch.patchType() == "empty" )
{
patch.patchType() = "wall";
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
renameBoundaryPatches::renameBoundaryPatches
(
polyMeshGen& mesh,
const IOdictionary& meshDict
const IOdictionary& meshDict,
const bool allowEmptyPatches
)
:
mesh_(mesh),
meshDict_(meshDict)
{
if( !allowEmptyPatches )
{
checkEmptyPatches();
}
if( meshDict.found("renameBoundary") )
calculateNewBoundary();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
......
......@@ -61,6 +61,9 @@ class renameBoundaryPatches
// Private member functions
//- calculate new boundary and replace the existing one
void calculateNewBoundary();
//- find empty patches in 3D meshes and change them to wall
void checkEmptyPatches();
//- Disallow default bitwise copy construct
renameBoundaryPatches(const renameBoundaryPatches&);
......@@ -76,7 +79,8 @@ public:
renameBoundaryPatches
(
polyMeshGen& mesh,
const IOdictionary& meshDict
const IOdictionary& meshDict,
const bool allowEmptyPatches = false
);
// Destructor
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment