ENH: blockMesh: Added support for automatically reordering cyclic patches

Patch contributed by Mattijs Janssens
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1692
This commit is contained in:
Henry Weller
2017-12-01 11:01:30 +00:00
committed by Andrew Heather
parent dcad66f7d3
commit 5ea75f8a95

View File

@ -60,7 +60,9 @@ Usage
#include "blockMesh.H"
#include "attachPolyTopoChanger.H"
#include "polyTopoChange.H"
#include "emptyPolyPatch.H"
#include "cyclicPolyPatch.H"
#include "cellSet.H"
#include "argList.H"
@ -381,6 +383,30 @@ int main(int argc, char *argv[])
mesh.addZones(List<pointZone*>(0), List<faceZone*>(0), cz);
}
// Detect any cyclic patches and force re-ordering of the faces
{
const polyPatchList& patches = mesh.boundaryMesh();
bool hasCyclic = false;
forAll(patches, patchi)
{
if (isA<cyclicPolyPatch>(patches[patchi]))
{
hasCyclic = true;
break;
}
}
if (hasCyclic)
{
Info<< nl << "Detected cyclic patches; ordering boundary faces"
<< endl;
polyTopoChange meshMod(mesh);
meshMod.changeMesh(mesh, false);
}
}
// Set the precision of the points data to 10
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
@ -409,9 +435,7 @@ int main(int argc, char *argv[])
}
}
//
// write some information
//
// Write summary
{
const polyPatchList& patches = mesh.boundaryMesh();