- checkMesh has option to write faceSets or (outside of) cellSets as sampledSurface format. It automatically reconstructs the set on the master and writes it to the postProcessing folder (as any sampledSurface). E.g. mpirun -np 6 checkMesh -allTopology -allGeometry -writeSets vtk -parallel - fixed order writing of symmTensor in Ensight writers
41 lines
961 B
C
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;
|
|
}
|