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"
126 "Write block edges and centres as obj files and exit",
134 "Write topology as VTU file and exit"
138 "Force verbose output. (Can be used multiple times)"
144 "Geometric point merging instead of topological merging"
145 " [default for 1912 and earlier]."
151 "Do not remove polyMesh/ directory or files"
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");
181 args.found(
"merge-points")
195 bool useTime =
false;
200 args.readIfPresent(
"time", meshInstance)
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;
237 if (
args.found(
"write-obj"))
244 if (
args.found(
"write-vtk"))
261 Info<<
"Writing polyMesh to " << meshInstance <<
nl <<
endl;
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."
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,...
static unsigned int minPrecision(unsigned int prec) noexcept
Set the minimum default precision.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addVerboseOption(const string &usage="", bool advanced=false)
Enable a 'verbose' bool option, with usage information.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void noParallel()
Remove the parallel options.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
Specify an alias for the option name.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A multi-block mesh generator.
mergeStrategy
The block merging strategy.
@ DEFAULT_MERGE
Default (TOPOLOGY), not selectable.
@ MERGE_POINTS
"points" merge by point geometry
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.
static const word & regionName(const word ®ion)
The mesh region name or word::null if polyMesh::defaultRegion.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
A class for handling words, derived from Foam::string.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
Foam::word regionName(args.getOrDefault< word >("region", 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.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)