72 int main(
int argc,
char *argv[])
78 "write block edges and centres as .obj files" 83 "keep the existing files in the polyMesh" 89 "specify alternative dictionary for the blockMesh description" 96 " For a given block, the correspondence between the ordering of\n" 97 " vertex labels and face labels is shown below.\n" 98 " For vertex numbering in the sequence 0 to 7 (block, centre):\n" 99 " faces 0 (f0) and 1 are left and right, respectively;\n" 100 " faces 2 and 3 are front and back; \n" 101 " and faces 4 and 5 are bottom and top::\n" 128 Info<< nl <<
"Generating mesh for region " << regionName <<
endl;
139 dictPath =
args[
"dict"];
179 Info<<
"Not deleting polyMesh directory " << nl
180 <<
" " << polyMeshPath << nl
185 Info<<
"Deleting polyMesh directory" << nl
186 <<
" " << polyMeshPath <<
endl;
204 << meshDictIO.objectPath()
209 Info<<
"Creating block mesh from\n " 210 << meshDictIO.objectPath() <<
endl;
220 fileName objMeshFile(
"blockTopology.obj");
224 Info<< nl <<
"Dumping block structure as Lightwave obj format" 225 <<
" to " << objMeshFile <<
endl;
227 blocks.writeTopology(str);
232 fileName objCcFile(
"blockCentres.obj");
236 Info<< nl <<
"Dumping block centres as Lightwave obj format" 237 <<
" to " << objCcFile <<
endl;
239 const polyMesh& topo = blocks.topology();
243 forAll(cellCentres, celli)
246 const point& cc = cellCentres[celli];
248 str <<
"v " << cc.
x() <<
' ' << cc.
y() <<
' ' << cc.
z() <<
nl;
258 Info<< nl <<
"Creating polyMesh from blockMesh" <<
endl;
260 word defaultFacesName =
"defaultFaces";
261 word defaultFacesType = emptyPolyPatch::typeName;
281 if (meshDict.found(
"mergePatchPairs"))
285 meshDict.lookup(
"mergePatchPairs")
292 Info<< nl <<
"There are no merge patch pairs edges" <<
endl;
299 label nZones = blocks.numZonedBlocks();
303 Info<< nl <<
"Adding cell zones" <<
endl;
319 const block& b = blocks[blockI];
329 if (iter == zoneMap.
end())
333 Info<<
" " << zoneI <<
'\t' << zoneName <<
endl;
335 zoneMap.insert(zoneName, zoneI);
344 zoneCells[zoneI].append(celli++);
349 celli += b.
cells().size();
358 label zoneI = iter();
363 zoneCells[zoneI].
shrink(),
379 bool hasCyclic =
false;
382 if (isA<cyclicPolyPatch>(patches[
patchi]))
391 Info<< nl <<
"Detected cyclic patches; ordering boundary faces" 395 meshMod.changeMesh(
mesh,
false);
404 Info<< nl <<
"Writing polyMesh" <<
endl;
409 <<
"Failed writing polyMesh." 418 Info<<
"----------------" << nl
419 <<
"Mesh Information" << nl
420 <<
"----------------" << nl
427 Info<<
"----------------" << nl
429 <<
"----------------" <<
nl;
436 <<
" (start: " << p.
start()
437 <<
" size: " << p.size()
438 <<
") name: " << p.
name()
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
fileName path() const
Return path.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
A class for handling file names.
const faceZoneMesh & faceZones() const
Return face zone mesh.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static unsigned int defaultPrecision()
Return the default precision.
List< FixedList< label, 8 > > cells() const
Return the cells for filling the block.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
static void noParallel()
Remove the parallel options.
A bounding box defined in terms of the points at its extremities.
Xfer< T > xferCopy(const T &)
Construct by copying the contents of the arg.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A multi-block mesh generator.
void removeFiles(const fileName &instanceDir) const
Remove all files from mesh instance.
const pointZoneMesh & pointZones() const
Return point zone mesh.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
A class for handling words, derived from string.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
const word & constant() const
Return constant name.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
const word dictName("particleTrackDict")
void addZones(const List< pointZone *> &pz, const List< faceZone *> &fz, const List< cellZone *> &cz)
Add mesh zones.
const vectorField & cellCentres() const
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
const word & system() const
Return system name.
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
bool rmDir(const fileName &)
Remove a directory and its contents.
void setInstance(const fileName &)
Set the instance for mesh files.
const fileName & instance() const
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Direct mesh changes based on v1.3 polyTopoChange syntax.
label start() const
Return start label of this patch in the polyMesh face list.
Mesh consisting of general polyhedral cells.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
A patch is a list of labels that address the faces in the global face list.
const word & zoneName() const
Return the (optional) zone name.
Foam::argList args(argc, argv)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
bool exists(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
void shrink()
Shrink the allocated table to approx. twice number of elements.