Go to the documentation of this file.
75 label sizeCoeffToRefinement
77 const scalar level0Coeff,
78 const scalar sizeCoeff
81 return round(::
log(level0Coeff/sizeCoeff)/::
log(2));
90 const label gapLevelIncrement,
91 const scalar level0Coeff
100 const word& geomName = allGeometry.
names()[geomi];
102 if (surfacesDict.
found(geomName))
129 const word& geomName = allGeometry.
names()[geomi];
138 names[surfi] = geomName;
139 surfaces[surfi] = geomi;
146 const word scsFuncName =
147 shapeDict.
get<
word>(
"surfaceCellSizeFunction");
152 const scalar surfaceCellSize =
153 scsDict.
get<scalar>(
"surfaceCellSizeCoeff");
155 const label refLevel = sizeCoeffToRefinement
161 globalMinLevel[surfi] = refLevel;
162 globalMaxLevel[surfi] = refLevel;
163 globalLevelIncr[surfi] = gapLevelIncrement;
179 if (shapeDict.
found(
"patchInfo"))
191 if (shapeDict.
found(
"regions"))
195 allGeometry[surfaces[surfi]].regions();
197 forAll(regionNames, regioni)
199 if (regionsDict.
found(regionNames[regioni]))
207 if (regionDict.
found(
"patchInfo"))
209 regionPatchInfo[surfi].insert
220 if (shapeDict.
found(
"regions"))
225 allGeometry[surfaces[surfi]].regions();
227 forAll(regionNames, regioni)
229 if (shapeControlRegionsDict.
found(regionNames[regioni]))
232 shapeControlRegionsDict.
subDict
237 const word scsFuncName =
238 shapeControlRegionDict.
get<
word>
240 "surfaceCellSizeFunction"
245 scsFuncName +
"Coeffs"
248 const scalar surfaceCellSize =
249 scsDict.
get<scalar>(
"surfaceCellSizeCoeff");
251 const label refLevel = sizeCoeffToRefinement
257 regionMinLevel[surfi].insert(regioni, refLevel);
258 regionMaxLevel[surfi].insert(regioni, refLevel);
259 regionLevelIncr[surfi].insert(regioni, 0);
273 regionOffset[surfi] = nRegions;
274 nRegions += allGeometry[surfaces[surfi]].regions().size();
283 forAll(globalMinLevel, surfi)
285 label nRegions = allGeometry[surfaces[surfi]].regions().size();
288 for (label i = 0; i < nRegions; i++)
290 label globalRegioni = regionOffset[surfi] + i;
291 minLevel[globalRegioni] = globalMinLevel[surfi];
292 maxLevel[globalRegioni] = globalMaxLevel[surfi];
293 gapLevel[globalRegioni] =
294 maxLevel[globalRegioni]
295 + globalLevelIncr[surfi];
297 if (globalPatchInfo.set(surfi))
302 globalPatchInfo[surfi].clone()
310 label globalRegioni = regionOffset[surfi] + iter.key();
312 minLevel[globalRegioni] = iter();
313 maxLevel[globalRegioni] = regionMaxLevel[surfi][iter.key()];
314 gapLevel[globalRegioni] =
315 maxLevel[globalRegioni]
316 + regionLevelIncr[surfi][iter.key()];
322 label globalRegioni = regionOffset[surfi] + iter.key();
323 patchInfo.
set(globalRegioni, iter()().clone());
354 forAll(regionNames, regioni)
356 maxLen =
Foam::max(maxLen, label(regionNames[regioni].size()));
362 <<
setw(10) <<
"Min Level"
363 <<
setw(10) <<
"Max Level"
364 <<
setw(10) <<
"Gap Level" <<
nl
365 <<
setw(maxLen) <<
"------"
366 <<
setw(10) <<
"---------"
367 <<
setw(10) <<
"---------"
378 forAll(regionNames, regioni)
382 Info<<
setw(maxLen) << regionNames[regioni]
408 for (
const label patchi : includePatches)
411 patchSize.insert(pp.
name(), pp.size());
421 label sz = compactZoneID.size();
422 compactZoneID.insert(iter.key(), sz);
431 label patchi =
bMesh.findPatchID(iter.key());
434 patchToCompactZone[patchi] = iter();
441 for (
const label patchi : includePatches)
446 faceLabels.append(pp.
start()+i);
447 compactZones.append(patchToCompactZone[pp.
index()]);
464 allBoundary.meshPoints(),
465 allBoundary.meshPointMap(),
501 gatheredPoints.clear();
503 faceList allFaces = ListListOps::combine<faceList>
508 gatheredFaces.clear();
510 labelList allZones = ListListOps::combine<labelList>
515 gatheredZones.clear();
523 Info<<
"surfZone " << iter() <<
" : " << surfZones[iter()].name()
544 globalCasePath.
clean();
546 Info<<
"Writing merged surface to " << globalCasePath <<
endl;
548 sortedFace.
write(globalCasePath);
559 label nUnaligned = 0;
563 const face&
f = faces[facei];
566 label fp1 =
f.fcIndex(fp);
569 const scalar magV(
mag(v));
570 if (magV > ROOTVSMALL)
575 dir < pTraits<vector>::nComponents;
579 const scalar
s(
mag(v[dir]));
580 if (
s > magV*tol &&
s < magV*(1-tol))
594 os <<
"Initial mesh has " << nUnaligned
595 <<
" edges unaligned with any of the coordinate axes" <<
nl <<
endl;
602 scalar getMergeDistance
605 const scalar mergeTol,
610 scalar mergeDist = mergeTol *
meshBb.mag();
613 <<
"Overall mesh bounding box : " <<
meshBb <<
nl
614 <<
"Relative tolerance : " << mergeTol <<
nl
615 <<
"Absolute matching distance : " << mergeDist <<
nl
627 if (mergeTol < writeTol)
630 <<
"Your current settings specify ASCII writing with "
632 <<
"Your merging tolerance (" << mergeTol
633 <<
") is finer than this." <<
nl
634 <<
"Change to binary writeFormat, "
635 <<
"or increase the writePrecision" <<
endl
636 <<
"or adjust the merge tolerance (mergeTol)."
661 if (!isA<processorPolyPatch>(pp))
665 isA<coupledPolyPatch>(pp)
670 oldToNew[patchi] = newPatchi++;
679 if (isA<processorPolyPatch>(pp))
681 oldToNew[patchi] = newPatchi++;
686 const label nKeepPatches = newPatchi;
689 if (nKeepPatches != pbm.size())
696 if (oldToNew[patchi] == -1)
699 <<
" type " << pbm[patchi].type()
700 <<
" at position " << patchi <<
endl;
701 oldToNew[patchi] = newPatchi++;
739 Info<<
"Wrote mesh in = "
744 int main(
int argc,
char *argv[])
748 "Automatic split hex mesher. Refines and snaps to surface"
757 "Check all surface geometry for quality"
762 "Check case set-up only using a single time step"
768 "Simplify the surface using snappyHexMesh starting from a boundBox"
773 "(patch0 .. patchN)",
774 "Only triangulate selected patches (wildcards supported)"
780 "Name of the file to save the simplified surface to"
789 const bool overwrite =
args.
found(
"overwrite");
791 const bool surfaceSimplify =
args.
found(
"surfaceSimplify");
792 const bool dryRun =
args.
found(
"dry-run");
796 Info<<
"Operating in dry-run mode to detect set-up errors"
802 Info<<
"Read mesh in = "
844 const scalar mergeDist = getMergeDistance
847 meshRefinement::get<scalar>
872 const scalar maxSizeRatio
907 decomposeDict = *dictPtr;
911 decomposeDict.
add(
"method",
"none");
912 decomposeDict.
add(
"numberOfSubdomains", 1);
1016 Info<<
"Reading refinement surfaces." <<
endl;
1018 if (surfaceSimplify)
1020 addProfiling(surfaceSimplify,
"snappyHexMesh::surfaceSimplify");
1036 "geometryToConformTo"
1040 foamyHexMeshDict.
subDict(
"motionControl");
1043 motionDict.
subDict(
"shapeControlFunctions");
1046 const scalar defaultCellSize =
1047 motionDict.
get<scalar>(
"defaultCellSize");
1049 const scalar initialCellSize =
::pow(
mesh.
V()[0], 1.0/3.0);
1057 createRefinementSurfaces
1063 initialCellSize/defaultCellSize
1078 "refinementSurfaces",
1086 Info<<
"Read refinement surfaces in = "
1104 forAll(surfaceGeometry, surfi)
1106 label geomi = surfaceGeometry[surfi];
1110 forAll(regNames, regioni)
1112 label globalRegioni = surfaces.
globalRegion(surfi, regioni);
1114 if (patchInfo.
set(globalRegioni))
1117 meshRefinement::get<word>
1119 patchInfo[globalRegioni],
1128 patchTypes[geomi][regioni] = wallPolyPatch::typeName;
1157 Info<<
"Checking for geometry size relative to mesh." <<
endl;
1159 forAll(allGeometry, geomi)
1165 if (ratio > maxSizeRatio || ratio < 1.0/maxSizeRatio)
1168 <<
" " << allGeometry.
names()[geomi]
1169 <<
" bounds differ from mesh"
1170 <<
" by more than a factor " << maxSizeRatio <<
":" <<
nl
1171 <<
" bounding box : " << bb <<
nl
1172 <<
" mesh bounding box : " <<
meshBb
1175 if (!
meshBb.contains(bb))
1178 <<
" " << allGeometry.
names()[geomi]
1179 <<
" bounds not fully contained in mesh" <<
nl
1180 <<
" bounding box : " << bb <<
nl
1181 <<
" mesh bounding box : " <<
meshBb
1194 Info<<
"Reading refinement shells." <<
endl;
1201 Info<<
"Read refinement shells in = "
1205 Info<<
"Setting refinement level of surface to be consistent"
1206 <<
" with shells." <<
endl;
1208 Info<<
"Checked shell refinement in = "
1217 if (!limitDict.empty())
1219 Info<<
"Reading limit shells." <<
endl;
1224 if (!limitDict.empty())
1226 Info<<
"Read limit shells in = "
1236 unusedGeometries.erase(surfaces.
surfaces());
1237 unusedGeometries.erase(shells.shells());
1238 unusedGeometries.erase(limitShells.shells());
1240 if (unusedGeometries.size())
1243 <<
"The following geometry entries are not used:" <<
nl;
1244 for (
const label geomi : unusedGeometries)
1246 Info<<
" " << allGeomNames[geomi] <<
nl;
1258 Info<<
"Reading features." <<
endl;
1268 Info<<
"Read features in = "
1275 Info<<
"Checking for line geometry size relative to surface geometry."
1279 bool hasErrors = features.checkSizes
1297 <<
"Determining initial surface intersections" <<
nl
1298 <<
"-----------------------------------------" <<
nl
1318 Info<<
"Calculated surface intersections in = "
1361 refineParams.addCellZonesToMesh(
mesh);
1376 <<
"Adding patches for surface regions" <<
nl
1377 <<
"----------------------------------" <<
nl
1387 <<
setw(6) <<
"Patch"
1388 <<
setw(20) <<
"Type"
1389 <<
setw(30) <<
"Region" <<
nl
1390 <<
setw(6) <<
"-----"
1391 <<
setw(20) <<
"----"
1399 forAll(surfaceGeometry, surfi)
1401 label geomi = surfaceGeometry[surfi];
1411 surfaces.
surfZones()[surfi].faceZoneNames();
1413 if (fzNames.empty())
1422 if (surfacePatchInfo.
set(globalRegioni))
1427 surfacePatchInfo[globalRegioni]
1433 patchInfo.
set(
"type", wallPolyPatch::typeName);
1445 <<
setw(6) << patchi
1446 <<
setw(20) << pbm[patchi].type()
1447 <<
setw(30) << regNames[i] <<
nl;
1450 globalToMasterPatch[globalRegioni] = patchi;
1451 globalToSlavePatch[globalRegioni] = patchi;
1465 if (surfacePatchInfo.
set(globalRegioni))
1470 surfacePatchInfo[globalRegioni]
1476 patchInfo.
set(
"type", wallPolyPatch::typeName);
1488 <<
setw(6) << patchi
1489 <<
setw(20) << pbm[patchi].type()
1490 <<
setw(30) << regNames[i] <<
nl;
1493 globalToMasterPatch[globalRegioni] = patchi;
1497 const word slaveName = regNames[i] +
"_slave";
1500 if (surfacePatchInfo.
set(globalRegioni))
1505 surfacePatchInfo[globalRegioni]
1511 patchInfo.
set(
"type", wallPolyPatch::typeName);
1523 <<
setw(6) << patchi
1524 <<
setw(20) << pbm[patchi].type()
1525 <<
setw(30) << slaveName <<
nl;
1528 globalToSlavePatch[globalRegioni] = patchi;
1534 if (regNames.size())
1538 const word& fzName = fzNames[fzi];
1539 label globalRegioni = surfaces.
globalRegion(surfi, fzi);
1544 pbm[globalToMasterPatch[globalRegioni]].
name(),
1545 pbm[globalToSlavePatch[globalRegioni]].
name(),
1557 Info<<
"Added patches in = "
1580 if (i != string::npos)
1582 word cz0 = fzName.substr(0, i);
1583 word cz1 = fzName.substr(i+4, fzName.size()-i+4);
1584 word slaveName(cz1 +
"_to_" + cz0);
1590 const word slaveName = fzName +
"_slave";
1596 if (faceZoneToPatches.
size())
1618 nFaces += pbm[adaptPatchIDs[i]].size();
1625 const polyPatch& pp = pbm[adaptPatchIDs[i]];
1628 faceLabels[nFaces++] = pp.
start()+i;
1653 <<
"You have selected decomposition method "
1654 << decomposer.typeName
1655 <<
" which is not parallel aware." <<
endl
1656 <<
"Please select one that is (hierarchical, ptscotch)"
1670 const bool wantRefine
1672 meshRefinement::get<bool>(
meshDict,
"castellatedMesh", dryRun)
1676 meshRefinement::get<bool>(
meshDict,
"snap", dryRun)
1678 const bool wantLayers
1680 meshRefinement::get<bool>(
meshDict,
"addLayers", dryRun)
1688 if (errorMsg.size() || IOerrorMsg.size())
1697 <<
"Missing/incorrect required dictionary entries:" <<
nl
1699 << IOerrorMsg.c_str() <<
nl
1700 << errorMsg.c_str() <<
nl <<
nl
1701 <<
"Exiting dry-run" <<
nl <<
endl;
1713 meshRefinement::FaceMergeType::GEOMETRIC;
1715 const bool mergePatchFaces
1720 if (!mergePatchFaces)
1722 Info<<
"Not merging patch-faces of cell to preserve"
1723 <<
" (split)hex cell shape."
1725 mergeType = meshRefinement::FaceMergeType::NONE;
1729 const bool mergeAcrossPatches
1734 if (mergeAcrossPatches)
1736 Info<<
"Merging co-planar patch-faces of cells"
1737 <<
", regardless of patch assignment"
1739 mergeType = meshRefinement::FaceMergeType::IGNOREPATCH;
1755 globalToMasterPatch,
1762 if (!overwrite && !debugLevel)
1768 refineDriver.doRefine
1773 refineParams.handleSnapProblems(),
1779 if (!keepPatches && !wantSnap && !wantLayers)
1795 Info<<
"Mesh refined in = "
1796 <<
timer.cpuTimeIncrement() <<
" s." <<
endl;
1808 globalToMasterPatch,
1813 if (!overwrite && !debugLevel)
1819 scalar curvature = refineParams.curvature();
1820 scalar planarAngle = refineParams.planarAngle();
1833 if (!keepPatches && !wantLayers)
1849 Info<<
"Mesh snapped in = "
1850 <<
timer.cpuTimeIncrement() <<
" s." <<
endl;
1870 globalToMasterPatch,
1878 (
mesh.
nCells() >= refineParams.maxLocalCells()),
1883 if (!overwrite && !debugLevel)
1888 layerDriver.doLayers
1916 Info<<
"Layers added in = "
1917 <<
timer.cpuTimeIncrement() <<
" s." <<
endl;
1927 Info<<
"Checking final mesh ..." <<
endl;
1938 Info<<
"Finished meshing with " << nErrors <<
" illegal faces"
1939 <<
" (concave, zero area or negative cell pyramid volume)"
1945 Info<<
"Finished meshing without any errors" <<
endl;
1952 if (surfaceSimplify)
1954 addProfiling(surfaceSimplify,
"snappyHexMesh::surfaceSimplify");
1962 includePatches =
bMesh.patchSet
1973 if (!isA<processorPolyPatch>(
patch))
1975 includePatches.insert(patchi);
1985 "constant/triSurface/simplifiedSurface.stl"
2001 "internalCellCentres",
2010 cellCentres.write();
2015 Info<<
"Finished meshing in = "
2024 if (errorMsg.size() || IOerrorMsg.size())
2032 <<
"Missing/incorrect required dictionary entries:" <<
nl
2034 << IOerrorMsg.c_str() <<
nl
2035 << errorMsg.c_str() <<
nl <<
nl
2036 <<
"Exiting dry-run" <<
nl <<
endl;
int debug
Static debugging option.
static void mapCombineGather(const List< commsStruct > &comms, Container &Values, const CombineOp &cop, const int tag, const label comm)
A keyword and a list of tokens is an 'entry'.
List< label > labelList
A List of labels.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
vectorField pointField
pointField is a vectorField.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
label size() const noexcept
The number of elements in table.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
virtual const pointField & points() const
Return raw points.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
scalar mag() const
The magnitude of the bounding box span.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const labelList & maxLevel() const
From global region number to refinement level.
faceZoneType
What to do with faceZone faces.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
A class for handling file names.
A primitive field of type <T> with automated input and output.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
const keyType & keyword() const
Return keyword.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
static ITstream & lookup(const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt=keyType::REGEX)
Wrapper around dictionary::lookup which does not exit.
static constexpr const zero Zero
Global zero (0)
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
const labelList & surfaces() const
const word setFormat(propsDict.getOrDefault< word >("setFormat", "vtk"))
IOstream::streamFormat writeFormat() const
The write stream format.
label nFaces() const
Number of mesh faces.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static writeType writeLevel()
Get/set write level.
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
label addFaceZone(const word &fzName, const word &masterPatch, const word &slavePatch, const surfaceZonesInfo::faceZoneType &fzType)
Add/lookup faceZone and update information. Return index of.
label checkTopology(const bool report) const
All topological checks. Return number of failed checks.
static bool & parRun()
Is this a parallel run?
static word timeName(const scalar t, const int precision=precision_)
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static const dictionary & subDict(const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt=keyType::REGEX)
Wrapper around dictionary::subDict which does not exit.
static void addNote(const string ¬e)
Add extra notes for the usage information.
const word dictName("blockMeshDict")
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
A HashTable to objects of type <T> with a label key.
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces, const bool dryRun=false)
Check mesh with mesh settings in dict. Collects incorrect faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeStats(const List< wordList > &, Ostream &) const
Write some stats.
All to do with snapping to surface.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
const fvMesh & mesh() const
Reference to mesh.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
const labelList & gapLevel() const
From global region number to small gap refinement level.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
Mesh consisting of general polyhedral cells.
Identifies a surface patch/zone by name, patch index and geometricType.
#define forAll(list, i)
Loop across all elements in list.
wordList patchTypes(nPatches)
const faceZoneMesh & faceZones() const
Return face zone mesh.
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
autoPtr< globalIndex > mergePoints(labelList &pointToGlobal, labelList &uniquePoints) const
Helper for merging (collocated!) mesh point data.
static const word canonicalName
Simple container to keep together snap specific information.
virtual bool parallelAware() const =0
Is method parallel aware?
const PtrList< surfaceZonesInfo > & surfZones() const
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
Encapsulates queries for volume refinement ('refine all cells within shell').
label nCells() const
Number of mesh cells.
const wordList & names() const
Names of surfaces.
static void checkCoupledFaceZones(const polyMesh &)
Helper function: check that face zones are synced.
static int readFlags(const EnumContainer &namedEnum, const wordList &words)
Helper: convert wordList into bit pattern using provided Enum.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
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.
word name(const complex &c)
Return string representation of complex.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
const labelList & minLevel() const
From global region number to refinement level.
Istream and Ostream manipulators taking arguments.
Simple container to keep together refinement specific information.
static IOobject selectIO(const IOobject &io, const fileName &altFile, const word &ioName="")
Return the IOobject, but also consider an alternative file name.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
graph_traits< Graph >::vertices_size_type size_type
label checkGeometry(const polyMesh &mesh, const bool allGeometry, autoPtr< surfaceWriter > &surfWriter, const autoPtr< writer< scalar >> &setWriter)
double elapsedCpuTime() const
Return CPU time (in seconds) from the start.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Simple container to keep together layer specific information.
static const Enum< writeType > writeTypeNames
Starts timing CPU usage and return elapsed time from start.
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
label globalRegion(const label surfI, const label regionI) const
From surface and region on surface to global region.
dimensionedScalar log(const dimensionedScalar &ds)
Abstract base class for domain decomposition.
Base class for graphics format writing. Entry points are.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
string message() const
The accumulated error message.
Mesh data needed to do the Finite Volume discretisation.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
Omanip< int > setw(const int i)
virtual const dictionary & dict() const =0
Return dictionary, if entry is a dictionary.
Ostream & indent(Ostream &os)
Indent stream.
label start() const
Return start label of this patch in the polyMesh face list.
const List< wordList > & regionNames() const
Region names per surface.
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
const PtrList< dictionary > & patchInfo() const
From global region number to patch type.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
All to do with adding layers.
static bool master(const label communicator=0)
Am I the master process.
const boundBox & bounds() const
Return mesh bounding box.
prefixOSstream Perr
An Ostream wrapper for parallel output to std::cerr.
Foam::string str() const
Get the string - as Foam::string rather than std::string.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const vectorField & cellCentres() const
label checkGeometry(const scalar maxRatio, const scalar tolerance, const autoPtr< writer< scalar >> &setWriter, const scalar minQuality, const bool report) const
All geometric checks. Return number of failed checks.
const word & system() const
Return system name.
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
fileName path() const
Return path.
forAllConstIters(mixture.phases(), phase)
static void mapCombineScatter(const List< commsStruct > &comms, Container &Values, const int tag, const label comm)
Scatter data. Reverse of combineGather.
static unsigned int defaultPrecision()
Return the default precision.
bool erase(T *item)
Remove the specified element from the list and delete it.
Encapsulates queries for features.
const std::string patch
OpenFOAM patch number as a std::string.
virtual void rename(const word &newName)
Rename.
writeType
Enumeration for what to write. Used as a bit-pattern.
Output to string buffer, using a OSstream.
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Implements a timeout mechanism via sigalarm.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
static void removeFiles(const polyMesh &mesh)
Helper: remove all procAddressing files from mesh instance.
entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find for an entry (non-const access) with the given keyword.
const dimensionedScalar e
Elementary charge.
autoPtr< dictionary > clone() const
Construct and return clone.
bool write() const
Write mesh and all data.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
static const word null
An empty word.
void clear() const
Clear any messages.
label addMeshedPatch(const word &name, const dictionary &)
Add patch originating from meshing. Update meshedPatches_.
List< T > getList(const label index) const
Get a List of values from the argument at index.
static void addFaceZones(meshRefinement &meshRefiner, const refinementParameters &refineParams, const HashTable< Pair< word >> &faceZoneToPatches)
Helper: add faceZones and patches.
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
void setMinLevelFields(const shellSurfaces &shells)
Calculate minLevelFields.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
A bounding box defined in terms of min/max extrema points.
fileName globalPath() const
Return global path for the case.
static bool clean(std::string &str)
Cleanup filename.
double cpuTimeIncrement() const
Return CPU time (in seconds) since last call to cpuTimeIncrement()
const Time & time() const
Return the top-level database.
A List with indirect addressing.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
A face is a list of labels corresponding to mesh vertices.
void updateIntersections(const labelList &changedFaces)
Find any intersection of surface. Store in surfaceIndex_.
wordList toc() const
Return the table of contents.
const wordList & names() const
Surface names, not region names.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
const globalMeshData & globalData() const
Return parallel info.
bool processorCase() const
Return true if this is a processor case.
static const Enum< debugType > debugTypeNames
void setSize(const label newSize)
Alias for resize(const label)
const word & constant() const
Return constant name.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
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)
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
const word & name() const
The patch name.
const IOdictionary & meshDict
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
label index() const
The index of this patch in the boundaryMesh.
static autoPtr< decompositionMethod > New(const dictionary &decompDict)
Return a reference to the selected decomposition method.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
bool getFaceZoneInfo(const word &fzName, label &masterPatchID, label &slavePatchID, surfaceZonesInfo::faceZoneType &fzType) const
Lookup faceZone information. Return false if no information.
bool found(const word &optName) const
Return true if the named option is found.
A list of faces which address into the list of points.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
static labelList addCellZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
debugType
Enumeration for what to debug. Used as a bit-pattern.
static bool writeNow()
Write profiling information now.