96 int main(
int argc,
char *argv[])
100 "Checks validity of a mesh" 109 "Skip checking the mesh topology" 114 "Include bounding box checks" 119 "Include extra topology checks" 124 "Write volFields with mesh quality parameters" 128 "writeAllSurfaceFields",
129 "Write surfaceFields with mesh quality parameters" 135 "Write volFields with selected mesh quality parameters" 140 "Read user-defined mesh quality criteria from system/meshQualityDict" 146 "Reconstruct and write all faceSets and cellSets in selected format" 151 "Write bad edges (possibly relevant for finite-area) in vtk format" 160 const bool noTopology =
args.
found(
"noTopology");
161 const bool allGeometry =
args.
found(
"allGeometry");
162 const bool allTopology =
args.
found(
"allTopology");
163 const bool meshQuality =
args.
found(
"meshQuality");
164 const bool optWriteEdges =
args.
found(
"write-edges");
167 const bool writeSets = surfaceFormat.size();
190 const bool writeFaceFields =
args.
found(
"writeAllSurfaceFields");
195 const wordHashSet badFields(selectedFields - allFields);
197 if (!badFields.empty())
200 <<
"Illegal field(s): " 209 selectedFields = allFields;
211 else if (writeFaceFields)
214 <<
"Option 'writeAllSurfaceFields' only valid in combination" 215 <<
" with 'writeFields' or 'writeAllFields'" 220 Info<<
"Check mesh..." <<
nl;
226 <<
"Disabling all topology checks." <<
nl;
231 <<
"Enabling all (cell, face, edge, point) topology checks." <<
nl;
236 <<
"Enabling all geometry checks." <<
nl;
241 <<
"Enabling user-defined geometry checks." <<
nl;
246 <<
"Reconstructing and writing " << surfaceFormat
247 <<
" representation of all faceSets and cellSets." <<
nl;
249 if (selectedFields.
size())
252 <<
"Writing mesh quality as fields " 258 <<
"Writing any bad edges in vtk format" <<
nl;
327 label nFailedChecks = 0;
361 if (nFailedChecks == 0)
367 Info<<
"\nFailed " << nFailedChecks <<
" mesh checks.\n" 401 Info<<
"\nFailed " << nFailedChecks <<
" mesh checks.\n"
static void addNote(const string ¬e)
Add extra notes for the usage information.
Ostream & indent(Ostream &os)
Indent stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
label checkTopology(const polyMesh &mesh, const bool allTopology, const bool allGeometry, autoPtr< surfaceWriter > &surfWriter, autoPtr< coordSetWriter > &setWriter, const bool writeBadEdges=false)
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< T > getList(const label index) const
Get a List of values from the argument at index.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Ignore writing from objectRegistry::writeObject()
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
#define forAll(list, i)
Loop across all elements in list.
label size() const noexcept
The number of elements in table.
static autoPtr< coordSetWriter > New(const word &writeFormat)
Return a reference to the selected writer.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
A class for handling words, derived from Foam::string.
label size() const noexcept
The number of entries in the list.
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
const globalMeshData & globalData() const
Return parallel info.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields, const bool writeFaceFields)
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options and also set the runTime to the first i...
label checkMeshQuality(const polyMesh &mesh, const dictionary &dict, autoPtr< surfaceWriter > &writer)
void printMeshStats(const polyMesh &mesh, const bool allTopology)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
readUpdateState
Enumeration defining the state of the mesh after a read update.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
static autoPtr< surfaceWriter > New(const word &writeType)
Return a reference to the selected surfaceWriter.
bool found(const word &optName) const
Return true if the named option is found.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
label checkGeometry(const polyMesh &mesh, const bool allGeometry, autoPtr< surfaceWriter > &surfWriter, autoPtr< coordSetWriter > &setWriter)