71 int main(
int argc,
char *argv[])
77 "write block edges and centres as .obj files" 83 "specify alternative dictionary for the blockMesh description" 98 Info<< nl <<
"Generating mesh for region " << regionName <<
endl;
109 dictPath =
args[
"dict"];
123 runTime.path()/runTime.constant()
135 dictPath = runTime.system()/regionPath/
dictName;
147 if (!meshDictIO.headerOk())
150 << meshDictIO.objectPath()
155 Info<<
"Creating block mesh from\n " 156 << meshDictIO.objectPath() <<
endl;
168 fileName objMeshFile(
"blockTopology.obj");
170 OFstream str(runTime.path()/objMeshFile);
172 Info<< nl <<
"Dumping block structure as Lightwave obj format" 173 <<
" to " << objMeshFile <<
endl;
175 blocks.writeTopology(str);
180 fileName objCcFile(
"blockCentres.obj");
182 OFstream str(runTime.path()/objCcFile);
184 Info<< nl <<
"Dumping block centres as Lightwave obj format" 185 <<
" to " << objCcFile <<
endl;
187 const polyMesh& topo = blocks.topology();
191 forAll(cellCentres, celli)
194 const point& cc = cellCentres[celli];
196 str <<
"v " << cc.
x() <<
' ' << cc.
y() <<
' ' << cc.
z() <<
nl;
206 Info<< nl <<
"Creating polyMesh from blockMesh" <<
endl;
208 word defaultFacesName =
"defaultFaces";
209 word defaultFacesType = emptyPolyPatch::typeName;
229 if (meshDict.found(
"mergePatchPairs"))
233 meshDict.lookup(
"mergePatchPairs")
240 Info<< nl <<
"There are no merge patch pairs edges" <<
endl;
247 label nZones = blocks.numZonedBlocks();
251 Info<< nl <<
"Adding cell zones" <<
endl;
267 const block& b = blocks[blockI];
277 if (iter == zoneMap.
end())
281 Info<<
" " << zoneI <<
'\t' << zoneName <<
endl;
283 zoneMap.insert(zoneName, zoneI);
292 zoneCells[zoneI].append(celli++);
304 Info<< nl <<
"Writing cell zones as cellSets" <<
endl;
308 label zoneI = iter();
313 zoneCells[zoneI].
shrink(),
332 Info<< nl <<
"Writing polyMesh" <<
endl;
337 <<
"Failed writing polyMesh." 348 Info<<
"----------------" << nl
349 <<
"Mesh Information" << nl
350 <<
"----------------" << nl
357 Info<<
"----------------" << nl
359 <<
"----------------" <<
nl;
366 <<
" (start: " << p.
start()
367 <<
" size: " << p.size()
368 <<
") name: " << p.
name()
#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.
A class for handling file names.
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.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void noParallel()
Remove the parallel options.
const blockDescriptor & blockDef() const
Return the block definition.
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 isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
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.
label start() const
Return start label of this patch in the polyMesh face list.
bool optionFound(const word &opt) const
Return true if the named option is found.
A class for handling words, derived from string.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
const vectorField & cellCentres() const
const word & name() const
Return name.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
static void verbose(const bool on=true)
Enable/disable verbose information about the progress.
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
const word & zoneName() const
Return the (optional) zone name.
const pointZoneMesh & pointZones() const
Return point zone mesh.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
bool exists(const fileName &, const bool checkGzip=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
word dictName("noiseDict")
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.
virtual bool write() const
Write using setting from DB.
const faceZoneMesh & faceZones() const
Return face zone mesh.
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
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.
A patch is a list of labels that address the faces in the global face list.
Foam::argList args(argc, argv)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label nInternalFaces() const
virtual bool write() const
Write mesh using IO settings from time.
void removeFiles(const fileName &instanceDir) const
Remove all files from mesh instance.
void shrink()
Shrink the allocated table to approx. twice number of elements.
const labelListList & cells() const
Return the cells for filling the block.