95int main(
int argc,
char *argv[])
99 "Block mesh generator.\n"
101 " The ordering of vertex and face labels within a block as shown "
103 " For the local vertex numbering in the sequence 0 to 7:\n"
104 " Faces 0, 1 (x-direction) are left, right.\n"
105 " Faces 2, 3 (y-direction) are front, back.\n"
106 " Faces 4, 5 (z-direction) are bottom, top.\n"
115 " \\ | f0 ------ f1\n"
120 argList::noParallel();
121 argList::noFunctionObjects();
123 argList::addBoolOption
126 "Write block edges and centres as obj files and exit",
129 argList::addOptionCompat(
"write-obj", {
"blockTopology", 1912});
131 argList::addBoolOption
134 "Write topology as VTU file and exit"
136 argList::addVerboseOption
138 "Force verbose output. (Can be used multiple times)"
141 argList::addBoolOption
144 "Geometric point merging instead of topological merging"
145 " [default for 1912 and earlier]."
148 argList::addBoolOption
151 "Do not remove polyMesh/ directory or files"
153 argList::addOptionCompat(
"no-clean", {
"noClean", -2006});
155 argList::addOption(
"dict",
"file",
"Alternative blockMeshDict");
156 argList::addBoolOption
159 "Write cellZones as cellSets too (for processing purposes)"
165 "Specify a time to write mesh to (default: constant)"
173 const bool removeOldFiles = !
args.
found(
"no-clean");
176 const bool writeCellSets =
args.
found(
"sets");
182 ? blockMesh::MERGE_POINTS
183 : blockMesh::DEFAULT_MERGE
195 bool useTime =
false;
201 &&
runTime.constant() != meshInstance
207 useTime = readScalar(meshInstance, timeValue);
211 <<
"Bad input value: " << meshInstance
212 <<
"Should be a scalar or 'constant'"
229 <<
"Did not generate any blocks. Stopping." <<
nl <<
endl;
235 bool quickExit =
false;
261 Info<<
"Writing polyMesh to " << meshInstance <<
nl <<
endl;
271 #include "cleanMeshDirectory.H"
276 blocks.verbose(
true);
293 IOstream::defaultPrecision(
max(10u, IOstream::defaultPrecision()));
295 Info<<
nl <<
"Writing polyMesh with "
296 <<
mesh.cellZones().size() <<
" cellZones";
298 if (writeCellSets && !
mesh.cellZones().empty())
300 Info<<
" (written as cellSets too)";
308 <<
"Failed writing polyMesh."
320 #include "printMeshSummary.H"
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
int verbose() const noexcept
Return the verbose flag.
bool found(const word &optName) const
Return true if the named option is found.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
const word & executable() const noexcept
Name of executable without the path.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A multi-block mesh generator.
mergeStrategy
The block merging strategy.
A collection of cell labels.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
Mesh consisting of general polyhedral cells.
virtual bool write(const bool valid=true) const
Write using setting from DB.
A class for handling words, derived from Foam::string.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
Foam::word regionName(Foam::polyMesh::defaultRegion)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const IOdictionary & meshDict
#define WarningIn(functionName)
Report a warning using Foam::Warning.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)