Go to the documentation of this file.
95 int main(
int argc,
char *argv[])
99 "Block mesh generator.\n"
100 " The ordering of vertex and face labels within a block as shown "
102 " For the local vertex numbering in the sequence 0 to 7:\n"
103 " Faces 0, 1 (x-direction) are left, right.\n"
104 " Faces 2, 3 (y-direction) are front, back.\n"
105 " Faces 4, 5 (z-direction) are bottom, top.\n"
114 " \\ | f0 ------ f1\n"
125 "Write block edges and centres as obj files and exit"
132 "Write topology as VTK file and exit"
138 "Geometric (point) merging instead of topological merging "
139 "(slower, fails with high-aspect cells. default for 1912 and earlier)",
145 "Do not remove any existing polyMesh/ directory or files"
151 "Write cellZones as cellSets too (for processing purposes)"
157 "Specify a time to write mesh to (default: constant)"
165 const bool removeOldFiles = !
args.
found(
"noClean");
187 bool useTime =
false;
199 useTime = readScalar(meshInstance, timeValue);
203 <<
"Bad input value: " << meshInstance
204 <<
"Should be a scalar or 'constant'"
221 <<
"Did not generate any blocks. Stopping." <<
nl <<
endl;
227 bool quickExit =
false;
239 Info<<
"Writing block structure in obj format: "
240 << os.name().name() <<
endl;
242 blocks.writeTopology(os);
249 Info<<
"Writing block centres in obj format: "
250 << os.name().name() <<
endl;
252 for (
const point& cc : blocks.topology().cellCentres())
254 os <<
"v " << cc.x() <<
' ' << cc.y() <<
' ' << cc.z() <<
nl;
268 const polyMesh& topoMesh = blocks.topology();
279 Info<<
"Writing block topology in vtk format: "
299 Info<<
"Writing polyMesh to " << meshInstance <<
nl <<
endl;
318 Info<<
"Not deleting polyMesh directory "
324 Info<<
"Deleting polyMesh directory "
332 Info<<
nl <<
"Creating polyMesh from blockMesh" <<
endl;
348 emptyPolyPatch::typeName
361 bool hasCyclic =
false;
364 if (isA<cyclicPolyPatch>(pp))
373 Info<<
nl <<
"Detected cyclic patches; ordering boundary faces"
377 meshMod.changeMesh(
mesh,
false);
386 Info<<
nl <<
"Writing polyMesh with "
391 Info<<
" (written as cellSets too)";
399 <<
"Failed writing polyMesh."
413 Info<<
"----------------" <<
nl
414 <<
"Mesh Information" <<
nl
415 <<
"----------------" <<
nl
422 Info<<
"----------------" <<
nl
424 <<
"----------------" <<
nl;
428 Info<<
" " <<
"patch " <<
p.index()
429 <<
" (start: " <<
p.start()
430 <<
" size: " <<
p.size()
431 <<
") name: " <<
p.name()
Encapsulated combinations of output format options. This is primarily useful when defining the output...
vectorField pointField
pointField is a vectorField.
virtual const pointField & points() const
Return raw points.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
A class for handling words, derived from Foam::string.
A class for handling file names.
Default (TOPOLOGY), not selectable.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
static word defaultRegion
Return the default region name.
label nInternalFaces() const
Number of internal faces.
XML inline ASCII, asciiFormatter.
label nFaces() const
Number of mesh faces.
const fileName & instance() const
mergeStrategy
The block merging strategy.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Direct mesh changes based on v1.3 polyTopoChange syntax.
static void addNote(const string ¬e)
Add extra notes for the usage information.
const word dictName("blockMeshDict")
const cellZoneMesh & cellZones() const
Return cell zone mesh.
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
Specify an alias for the option name.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Mesh consisting of general polyhedral cells.
fileName relativePath(const fileName &input, const bool caseTag=false) const
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
label nCells() const
Number of mesh cells.
const word & executable() const
Name of executable without the path.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
void removeFiles(const fileName &instanceDir) const
Remove all files from mesh instance.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Base class for graphics format writing. Entry points are.
"points" merge by point geometry
A collection of cell labels.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
fileName path() const
Return path.
static unsigned int defaultPrecision()
Return the default precision.
bool rmDir(const fileName &directory, const bool silent=false)
Remove a directory and its contents (optionally silencing warnings)
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
A deep-copy description of an OpenFOAM volume mesh in data structures suitable for VTK UnstructuredGr...
label nPoints() const
Number of mesh points.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
A bounding box defined in terms of min/max extrema points.
An instant of time. Contains the time value and name.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
Write an OpenFOAM volume (internal) geometry and internal fields as a vtu file or a legacy vtk file.
static void noParallel()
Remove the parallel options.
const word & constant() const
Return constant name.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
const IOdictionary & meshDict
fileName relativePath(const fileName &input, const bool caseTag=false) const
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
bool found(const word &optName) const
Return true if the named option is found.
const word & name() const
Return reference to name.
A multi-block mesh generator.