73 int main(
int argc,
char *argv[])
80 "write block edges and centres as .obj files" 85 "keep the existing files in the polyMesh" 92 " For a given block, the correspondence between the ordering of\n" 93 " vertex labels and face labels is shown below.\n" 94 " For vertex numbering in the sequence 0 to 7 (block, centre):\n" 95 " faces 0 (f0) and 1 are left and right, respectively;\n" 96 " faces 2 and 3 are front and back; \n" 97 " and faces 4 and 5 are bottom and top::\n" 124 Info<< nl <<
"Generating mesh for region " << regionName <<
endl;
139 Info<<
"Not deleting polyMesh directory " << nl
140 <<
" " << polyMeshPath << nl
145 Info<<
"Deleting polyMesh directory" << nl
146 <<
" " << polyMeshPath <<
endl;
157 if (!meshDictIO.headerOk())
160 <<
"Cannot find file " << meshDictIO.relativeObjectPath()
165 Info<<
"Creating block mesh from\n " 166 << meshDictIO.relativeObjectPath() <<
endl;
176 fileName objMeshFile(
"blockTopology.obj");
178 OFstream str(runTime.path()/objMeshFile);
180 Info<< nl <<
"Dumping block structure as Lightwave obj format" 181 <<
" to " << objMeshFile <<
endl;
183 blocks.writeTopology(str);
188 fileName objCcFile(
"blockCentres.obj");
190 OFstream str(runTime.path()/objCcFile);
192 Info<< nl <<
"Dumping block centres as Lightwave obj format" 193 <<
" to " << objCcFile <<
endl;
195 const polyMesh& topo = blocks.topology();
199 forAll(cellCentres, celli)
202 const point& cc = cellCentres[celli];
204 str <<
"v " << cc.
x() <<
' ' << cc.
y() <<
' ' << cc.
z() <<
nl;
214 Info<< nl <<
"Creating polyMesh from blockMesh" <<
endl;
216 word defaultFacesName =
"defaultFaces";
217 word defaultFacesType = emptyPolyPatch::typeName;
226 clone(blocks.points()),
237 if (meshDict.found(
"mergePatchPairs"))
241 meshDict.lookup(
"mergePatchPairs")
248 Info<< nl <<
"There are no merge patch pairs edges" <<
endl;
255 label nZones = blocks.numZonedBlocks();
259 Info<< nl <<
"Adding cell zones" <<
endl;
275 const block& b = blocks[blockI];
285 if (iter == zoneMap.end())
289 Info<<
" " << zoneI <<
'\t' << zoneName <<
endl;
291 zoneMap.insert(zoneName, zoneI);
300 zoneCells[zoneI].append(celli++);
305 celli += blockCells.
size();
314 label zoneI = iter();
319 zoneCells[zoneI].shrink(),
335 bool hasCyclic =
false;
338 if (isA<cyclicPolyPatch>(patches[
patchi]))
347 Info<< nl <<
"Detected cyclic patches; ordering boundary faces" 351 meshMod.changeMesh(
mesh,
false);
360 Info<< nl <<
"Writing polyMesh" <<
endl;
365 <<
"Failed writing polyMesh." 374 Info<<
"----------------" << nl
375 <<
"Mesh Information" << nl
376 <<
"----------------" << nl
383 Info<<
"----------------" << nl
385 <<
"----------------" <<
nl;
392 <<
" (start: " << p.
start()
393 <<
" size: " << p.size()
394 <<
") name: " << p.
name()
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
bool exists(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist (as directory or file) in the file system?
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const word & name() const
Return name.
A class for handling file names.
An STL-conforming const_iterator.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const meshCellZones & cellZones() const
Return cell zones.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
label nInternalFaces() const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Templated form of IOobject providing type information for file reading and header type checking...
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static unsigned int defaultPrecision()
Return the default precision.
void size(const label)
Override size to be inconsistent with allocated storage.
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.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
const meshPointZones & pointZones() const
Return point zones.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
const Key & key() const
Return the Key corresponding to the iterator.
A multi-block mesh generator.
void removeFiles(const fileName &instanceDir) const
Remove all files from mesh instance.
A class for handling words, derived from string.
An STL-conforming hash table.
void addZones(const List< pointZone *> &pz, const List< faceZone *> &fz, const List< cellZone *> &cz)
Add mesh zones.
const vectorField & cellCentres() const
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 directory and its contents.
void setInstance(const fileName &)
Set the instance for mesh files.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const meshFaceZones & faceZones() const
Return face zones.
Direct mesh changes based on v1.3 polyTopoChange syntax.
label start() const
Return start label of this patch in the polyMesh face list.
IOobject systemDictIO(const word &dictName, const argList &args, const objectRegistry &ob, const word ®ionName=polyMesh::defaultRegion)
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
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...
const word dictName("noiseDict")