91 int main(
int argc,
char *argv[])
99 "skip checking the mesh topology"
104 "include bounding box checks"
109 "include extra topology checks"
114 "read user-defined mesh quality criterions from system/meshQualityDict"
119 "reconstruct and write faceSets and cellSets of the problem faces"
125 "Format for faceSets and cellSets of the problem faces, defaults to vtk"
130 "reconstruct and write pointSets of the problem points"
136 "Format for pointSets of the problem points, defaults to vtk"
142 "Threshold in degrees "
143 "for reporting non-orthogonality errors, default: 70"
149 "Threshold for reporting non-orthogonality errors, default: 4"
164 word surfaceFormat(vtkSurfaceWriter::typeName);
170 scalar nonOrthThreshold = 70;
172 nonOrthThreshold =
degToRad(nonOrthThreshold);
174 scalar skewThreshold = 4;
179 Info<<
"Disabling all topology checks." <<
nl <<
endl;
183 Info<<
"Enabling all (cell, face, edge, point) topology checks."
188 Info<<
"Enabling all geometry checks." <<
nl <<
endl;
192 Info<<
"Enabling user-defined geometry checks." <<
nl <<
endl;
196 Info<<
"Reconstructing and writing surface representation of the "
197 <<
"faceSets and cellSets of problem faces in "
198 << surfaceFormat <<
" format" <<
nl <<
endl;
202 Info<<
"Reconstructing and writing the problem points in "
252 runTime.setTime(
timeDirs[timeI], timeI);
263 Info<<
"Time = " << runTime.userTimeName() <<
nl <<
endl;
270 label nFailedChecks = 0;
303 if (nFailedChecks == 0)
309 Info<<
"\nFailed " << nFailedChecks <<
" mesh checks.\n"
315 Info<<
"Time = " << runTime.userTimeName() <<
nl <<
endl;
336 Info<<
"\nFailed " << nFailedChecks <<
" mesh checks.\n"
#define forAll(list, i)
Loop across all elements in list.
Routines for checking mesh quality.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static const word & system()
Return system name.
IOstream::streamFormat writeFormat() const
Default write format.
IOstream::compressionType writeCompression() const
Default write compression.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
void reset(T *=nullptr)
If object pointer already set, delete object and set to given.
const Time & time() const
Return the top-level database.
readUpdateState readUpdate(const stitchType stitch=stitchType::geometric)
Update the mesh based on the mesh files saved in time.
readUpdateState
Enumeration defining the state of the mesh after a read update.
const globalMeshData & globalData() const
Return parallel info.
Base class for writing coordinate sets with data.
static autoPtr< setWriter > New(const word &writeType, const IOstream::streamFormat writeFormat=IOstream::ASCII, const IOstream::compressionType writeCompression=IOstream::UNCOMPRESSED)
Select given write options.
Base class for surface writers.
static autoPtr< surfaceWriter > New(const word &writeType, const IOstream::streamFormat writeFormat, const IOstream::compressionType writeCompression)
Select given write options.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
int main(int argc, char *argv[])
static instantList timeDirs
Functions for checking mesh topology and geometry.
label checkTopology(const polyMesh &mesh, const bool allTopology, const autoPtr< surfaceWriter > &surfWriter, const autoPtr< setWriter > &setWriter)
Check the topology.
label checkGeometry(const polyMesh &mesh, const bool allGeometry, const scalar nonOrthThreshold, const scalar skewThreshold, const autoPtr< surfaceWriter > &, const autoPtr< setWriter > &)
Check the geometry.
void printMeshStats(const polyMesh &mesh, const bool allTopology)
Print mesh statistics.
scalar degToRad(const scalar deg)
Convert degrees to radians.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label checkMeshQuality(const polyMesh &, const dictionary &, const autoPtr< surfaceWriter > &)
Foam::argList args(argc, argv)
word setFormat(propsDict.lookup< word >("setFormat"))