checkMeshQuality.C
Go to the documentation of this file.
1 #include "checkMeshQuality.H"
2 #include "polyMesh.H"
3 #include "cellSet.H"
4 #include "faceSet.H"
5 #include "motionSmoother.H"
6 #include "surfaceWriter.H"
7 #include "checkTools.H"
8 
10 (
11  const polyMesh& mesh,
12  const dictionary& dict,
13  const autoPtr<surfaceWriter>& writer
14 )
15 {
16  label noFailedChecks = 0;
17 
18  {
19  faceSet faces(mesh, "meshQualityFaces", mesh.nFaces()/100+1);
20  motionSmoother::checkMesh(false, mesh, dict, faces);
21 
22  label nFaces = returnReduce(faces.size(), sumOp<label>());
23 
24  if (nFaces > 0)
25  {
26  noFailedChecks++;
27 
28  Info<< " <<Writing " << nFaces
29  << " faces in error to set " << faces.name() << endl;
30  faces.instance() = mesh.pointsInstance();
31  faces.write();
32  if (writer.valid())
33  {
34  mergeAndWrite(writer(), faces);
35  }
36  }
37  }
38 
39  return noFailedChecks;
40 }
Foam::polyMeshGenChecks::checkMesh
bool checkMesh(const polyMeshGen &mesh, const bool report)
Check mesh for correctness. Returns false for no error.
Definition: polyMeshGenChecks.C:104
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:86
motionSmoother.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
surfaceWriter.H
polyMesh.H
Foam::checkMeshQuality
label checkMeshQuality(const polyMesh &, const dictionary &, const autoPtr< surfaceWriter > &)
Definition: checkMeshQuality.C:10
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Info
messageStream Info
faceSet.H
Foam::mergeAndWrite
void mergeAndWrite(const surfaceWriter &, const faceSet &)
Write vtk representation of (assembled) faceSet to vtk file in.
Definition: checkTools.C:205
dict
dictionary dict
Definition: searchingEngine.H:14
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
cellSet.H