openfoam/applications/utilities/mesh/manipulation/checkMesh/checkMeshQuality.C
Henry Weller e2336fefd3 checkMesh: Added writing of faceSets and cellSets containing errors
In parallel the sets are reconstructed. e.g.

mpirun -np 6 checkMesh -parallel -allGeometry -allTopology -writeSets vtk

will create a postProcessing/ folder with the vtk files of the
(reconstructed) faceSets and cellSets.

Also improved analysis of disconnected regions now also checks for point
connectivity with is useful for detecting if AMI regions have duplicate
points.

Patch contributed by Mattijs Janssens
2016-06-12 20:51:07 +01:00

41 lines
961 B
C

#include "checkMeshQuality.H"
#include "polyMesh.H"
#include "cellSet.H"
#include "faceSet.H"
#include "motionSmoother.H"
#include "surfaceWriter.H"
#include "checkTools.H"
Foam::label Foam::checkMeshQuality
(
const polyMesh& mesh,
const dictionary& dict,
const autoPtr<surfaceWriter>& writer
)
{
label noFailedChecks = 0;
{
faceSet faces(mesh, "meshQualityFaces", mesh.nFaces()/100+1);
motionSmoother::checkMesh(false, mesh, dict, faces);
label nFaces = returnReduce(faces.size(), sumOp<label>());
if (nFaces > 0)
{
noFailedChecks++;
Info<< " <<Writing " << nFaces
<< " faces in error to set " << faces.name() << endl;
faces.instance() = mesh.pointsInstance();
faces.write();
if (writer.valid())
{
mergeAndWrite(writer(), faces);
}
}
}
return noFailedChecks;
}