71 int main(
int argc,
char *argv[])
77 "write block edges and centres as .obj files" 82 "keep the existing files in the polyMesh" 88 "specify alternative dictionary for the blockMesh description" 95 " For a given block, the correspondence between the ordering of\n" 96 " vertex labels and face labels is shown below.\n" 97 " For vertex numbering in the sequence 0 to 7 (block, centre):\n" 98 " faces 0 (f0) and 1 are left and right, respectively;\n" 99 " faces 2 and 3 are bottom and top;\n" 100 " and faces 4 and 5 are front the back:\n" 124 Info<< nl <<
"Generating mesh for region " << regionName <<
endl;
135 dictPath =
args[
"dict"];
149 runTime.path()/runTime.constant()
161 dictPath = runTime.system()/regionPath/
dictName;
175 Info<<
"Not deleting polyMesh directory " << nl
176 <<
" " << polyMeshPath << nl
181 Info<<
"Deleting polyMesh directory" << nl
182 <<
" " << polyMeshPath <<
endl;
200 << meshDictIO.objectPath()
205 Info<<
"Creating block mesh from\n " 206 << meshDictIO.objectPath() <<
endl;
216 fileName objMeshFile(
"blockTopology.obj");
218 OFstream str(runTime.path()/objMeshFile);
220 Info<< nl <<
"Dumping block structure as Lightwave obj format" 221 <<
" to " << objMeshFile <<
endl;
223 blocks.writeTopology(str);
228 fileName objCcFile(
"blockCentres.obj");
230 OFstream str(runTime.path()/objCcFile);
232 Info<< nl <<
"Dumping block centres as Lightwave obj format" 233 <<
" to " << objCcFile <<
endl;
235 const polyMesh& topo = blocks.topology();
239 forAll(cellCentres, celli)
242 const point& cc = cellCentres[celli];
244 str <<
"v " << cc.
x() <<
' ' << cc.
y() <<
' ' << cc.
z() <<
nl;
254 Info<< nl <<
"Creating polyMesh from blockMesh" <<
endl;
256 word defaultFacesName =
"defaultFaces";
257 word defaultFacesType = emptyPolyPatch::typeName;
277 if (meshDict.found(
"mergePatchPairs"))
281 meshDict.lookup(
"mergePatchPairs")
288 Info<< nl <<
"There are no merge patch pairs edges" <<
endl;
295 label nZones = blocks.numZonedBlocks();
299 Info<< nl <<
"Adding cell zones" <<
endl;
315 const block& b = blocks[blockI];
325 if (iter == zoneMap.
end())
329 Info<<
" " << zoneI <<
'\t' << zoneName <<
endl;
331 zoneMap.insert(zoneName, zoneI);
340 zoneCells[zoneI].append(celli++);
345 celli += b.
cells().size();
352 Info<< nl <<
"Writing cell zones as cellSets" <<
endl;
356 label zoneI = iter();
361 zoneCells[zoneI].
shrink(),
380 Info<< nl <<
"Writing polyMesh" <<
endl;
385 <<
"Failed writing polyMesh." 396 Info<<
"----------------" << nl
397 <<
"Mesh Information" << nl
398 <<
"----------------" << nl
405 Info<<
"----------------" << nl
407 <<
"----------------" <<
nl;
414 <<
" (start: " << p.
start()
415 <<
" size: " << p.size()
416 <<
") name: " << p.
name()
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
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.
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.
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
bool rmDir(const fileName &)
Remove a dirctory and its contents.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A collection of cell labels.
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.
virtual bool write(const bool valid=true) const
Write using setting from DB.
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.