75label 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];
131 const entry* ePtr = surfacesDict.
findEntry(geomName, keyType::REGEX);
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();
207 if (regionDict.
found(
"patchInfo"))
209 regionPatchInfo[surfi].insert
220 if (shapeDict.
found(
"regions"))
225 allGeometry[surfaces[surfi]].regions();
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());
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) <<
"---------"
408 for (
const label patchi : includePatches)
411 patchSize.insert(pp.
name(), pp.size());
421 label sz = compactZoneID.size();
422 compactZoneID.insert(iter.key(), sz);
424 Pstream::broadcast(compactZoneID);
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(),
472 gatheredPoints[Pstream::myProcNo()] =
pointField
477 Pstream::gatherList(gatheredPoints);
481 gatheredFaces[Pstream::myProcNo()] = allBoundary.localFaces();
482 forAll(gatheredFaces[Pstream::myProcNo()], i)
486 Pstream::gatherList(gatheredFaces);
490 gatheredZones[Pstream::myProcNo()].transfer(compactZones);
491 Pstream::gatherList(gatheredZones);
494 if (Pstream::master())
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()
529 std::move(allPoints),
541 ?
runTime.globalPath()/outFileName
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;
602scalar 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
619 if (
mesh.time().writeFormat() == IOstream::ASCII && !dryRun)
621 const scalar writeTol = std::pow
624 -scalar(IOstream::defaultPrecision())
627 if (mergeTol < writeTol)
630 <<
"Your current settings specify ASCII writing with "
631 << IOstream::defaultPrecision() <<
" digits precision." <<
nl
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++;
706 fvMeshTools::reorderPatches(
mesh, oldToNew, nKeepPatches,
true);
726 processorMeshes::removeFiles(
mesh);
727 if (!debugLevel && !(writeLevel&meshRefinement::WRITELAYERSETS))
729 topoSet::removeFiles(
mesh);
731 refinementHistory::removeFiles(
mesh);
739 Info<<
"Wrote mesh in = "
740 <<
mesh.time().cpuTimeIncrement() <<
" s." <<
endl;
744int main(
int argc,
char *argv[])
748 "Automatic split hex mesher. Refines and snaps to surface"
754 argList::addBoolOption
757 "Check all surface geometry for quality"
759 argList::addDryRunOption
761 "Check case set-up only using a single time step"
767 "Simplify the surface using snappyHexMesh starting from a boundBox"
772 "(patch0 .. patchN)",
773 "Only triangulate selected patches (wildcards supported)"
779 "Name of the file to save the simplified surface to"
781 argList::addOption(
"dict",
"file",
"Alternative snappyHexMeshDict");
783 argList::noFunctionObjects();
788 const bool overwrite =
args.
found(
"overwrite");
790 const bool surfaceSimplify =
args.
found(
"surfaceSimplify");
795 Info<<
"Operating in dry-run mode to detect set-up errors"
801 Info<<
"Read mesh in = "
805 mesh.boundaryMesh().checkParallelSync(
true);
806 meshRefinement::checkCoupledFaceZones(
mesh);
811 checkAlignment(
mesh, 1
e-6, Pout);
824 meshRefinement::subDict(
meshDict,
"geometry", dryRun);
828 meshRefinement::subDict(
meshDict,
"castellatedMeshControls", dryRun);
832 meshRefinement::subDict(
meshDict,
"meshQualityControls", dryRun);
836 meshRefinement::subDict(
meshDict,
"snapControls", dryRun);
840 meshRefinement::subDict(
meshDict,
"addLayersControls", dryRun);
843 const scalar mergeDist = getMergeDistance
846 meshRefinement::get<scalar>
855 const bool keepPatches(
meshDict.getOrDefault(
"keepPatches",
false));
865 coordSetWriters::vtkWriter::typeName
869 setFormatter = coordSetWriter::New
877 const scalar maxSizeRatio
879 meshDict.getOrDefault<scalar>(
"maxSizeRatio", 100)
885 if (Pstream::parRun())
896 decompositionModel::canonicalName,
909 dictPtr->
rename(decompositionModel::canonicalName);
912 decomposeDict = *dictPtr;
916 decomposeDict.
add(
"method",
"none");
917 decomposeDict.
add(
"numberOfSubdomains", 1);
935 if (
meshDict.readIfPresent(
"debugFlags", flags))
939 meshRefinement::readFlags
941 meshRefinement::debugTypeNames,
949 meshRefinement::debug = debugLevel;
950 snappyRefineDriver::debug = debugLevel;
951 snappySnapDriver::debug = debugLevel;
952 snappyLayerDriver::debug = debugLevel;
958 if (
meshDict.readIfPresent(
"writeFlags", flags))
960 meshRefinement::writeLevel
964 meshRefinement::readFlags
966 meshRefinement::writeTypeNames,
994 profiling::writeNow();
1004 mesh.time().constant(),
1008 IOobject::MUST_READ,
1012 meshDict.getOrDefault(
"singleRegionName",
true)
1021 Info<<
"Reading refinement surfaces." <<
endl;
1023 if (surfaceSimplify)
1025 addProfiling(surfaceSimplify,
"snappyHexMesh::surfaceSimplify");
1033 IOobject::MUST_READ_IF_MODIFIED,
1041 "geometryToConformTo"
1045 foamyHexMeshDict.
subDict(
"motionControl");
1048 motionDict.
subDict(
"shapeControlFunctions");
1051 const scalar defaultCellSize =
1052 motionDict.
get<scalar>(
"defaultCellSize");
1054 const scalar initialCellSize = ::pow(
mesh.V()[0], 1.0/3.0);
1062 createRefinementSurfaces
1068 initialCellSize/defaultCellSize
1071 profiling::writeNow();
1080 meshRefinement::subDict
1083 "refinementSurfaces",
1091 Info<<
"Read refinement surfaces in = "
1092 <<
mesh.time().cpuTimeIncrement() <<
" s" <<
nl <<
endl;
1109 forAll(surfaceGeometry, surfi)
1111 label geomi = surfaceGeometry[surfi];
1115 forAll(regNames, regioni)
1117 label globalRegioni = surfaces.
globalRegion(surfi, regioni);
1119 if (patchInfo.
set(globalRegioni))
1122 meshRefinement::get<word>
1124 patchInfo[globalRegioni],
1133 patchTypes[geomi][regioni] = wallPolyPatch::typeName;
1162 Info<<
"Checking for geometry size relative to mesh." <<
endl;
1164 forAll(allGeometry, geomi)
1170 if (ratio > maxSizeRatio || ratio < 1.0/maxSizeRatio)
1173 <<
" " << allGeometry.
names()[geomi]
1174 <<
" bounds differ from mesh"
1175 <<
" by more than a factor " << maxSizeRatio <<
":" <<
nl
1176 <<
" bounding box : " << bb <<
nl
1177 <<
" mesh bounding box : " <<
meshBb
1180 if (!
meshBb.contains(bb))
1183 <<
" " << allGeometry.
names()[geomi]
1184 <<
" bounds not fully contained in mesh" <<
nl
1185 <<
" bounding box : " << bb <<
nl
1186 <<
" mesh bounding box : " <<
meshBb
1199 Info<<
"Reading refinement shells." <<
endl;
1203 meshRefinement::subDict(refineDict,
"refinementRegions", dryRun),
1206 Info<<
"Read refinement shells in = "
1207 <<
mesh.time().cpuTimeIncrement() <<
" s" <<
nl <<
endl;
1210 Info<<
"Setting refinement level of surface to be consistent"
1211 <<
" with shells." <<
endl;
1213 Info<<
"Checked shell refinement in = "
1214 <<
mesh.time().cpuTimeIncrement() <<
" s" <<
nl <<
endl;
1222 if (!limitDict.empty())
1224 Info<<
"Reading limit shells." <<
endl;
1229 if (!limitDict.empty())
1231 Info<<
"Read limit shells in = "
1232 <<
mesh.time().cpuTimeIncrement() <<
" s" <<
nl <<
endl;
1241 unusedGeometries.erase(surfaces.
surfaces());
1242 unusedGeometries.erase(shells.shells());
1243 unusedGeometries.erase(limitShells.shells());
1245 if (unusedGeometries.size())
1248 <<
"The following geometry entries are not used:" <<
nl;
1249 for (
const label geomi : unusedGeometries)
1251 Info<<
" " << allGeomNames[geomi] <<
nl;
1263 Info<<
"Reading features." <<
endl;
1273 Info<<
"Read features in = "
1274 <<
mesh.time().cpuTimeIncrement() <<
" s" <<
nl <<
endl;
1280 Info<<
"Checking for line geometry size relative to surface geometry."
1284 bool hasErrors = features.checkSizes
1302 <<
"Determining initial surface intersections" <<
nl
1303 <<
"-----------------------------------------" <<
nl
1323 Info<<
"Calculated surface intersections in = "
1324 <<
mesh.time().cpuTimeIncrement() <<
" s" <<
nl <<
endl;
1353 surfaceZonesInfo::getNamedSurfaces(surfaces.
surfZones())
1356 labelList surfaceToCellZone = surfaceZonesInfo::addCellZonesToMesh
1366 refineParams.addCellZonesToMesh(
mesh);
1381 <<
"Adding patches for surface regions" <<
nl
1382 <<
"----------------------------------" <<
nl
1392 <<
setw(6) <<
"Patch"
1393 <<
setw(20) <<
"Type"
1394 <<
setw(30) <<
"Region" <<
nl
1395 <<
setw(6) <<
"-----"
1396 <<
setw(20) <<
"----"
1404 forAll(surfaceGeometry, surfi)
1406 label geomi = surfaceGeometry[surfi];
1416 surfaces.
surfZones()[surfi].faceZoneNames();
1418 if (fzNames.
empty())
1427 if (surfacePatchInfo.
set(globalRegioni))
1432 surfacePatchInfo[globalRegioni]
1438 patchInfo.
set(
"type", wallPolyPatch::typeName);
1450 <<
setw(6) << patchi
1451 <<
setw(20) << pbm[patchi].type()
1452 <<
setw(30) << regNames[i] <<
nl;
1455 globalToMasterPatch[globalRegioni] = patchi;
1456 globalToSlavePatch[globalRegioni] = patchi;
1470 if (surfacePatchInfo.
set(globalRegioni))
1475 surfacePatchInfo[globalRegioni]
1481 patchInfo.
set(
"type", wallPolyPatch::typeName);
1493 <<
setw(6) << patchi
1494 <<
setw(20) << pbm[patchi].type()
1495 <<
setw(30) << regNames[i] <<
nl;
1498 globalToMasterPatch[globalRegioni] = patchi;
1502 const word slaveName = regNames[i] +
"_slave";
1505 if (surfacePatchInfo.
set(globalRegioni))
1510 surfacePatchInfo[globalRegioni]
1516 patchInfo.
set(
"type", wallPolyPatch::typeName);
1528 <<
setw(6) << patchi
1529 <<
setw(20) << pbm[patchi].type()
1530 <<
setw(30) << slaveName <<
nl;
1533 globalToSlavePatch[globalRegioni] = patchi;
1539 if (regNames.
size())
1543 const word& fzName = fzNames[fzi];
1544 label globalRegioni = surfaces.
globalRegion(surfi, fzi);
1549 pbm[globalToMasterPatch[globalRegioni]].
name(),
1550 pbm[globalToSlavePatch[globalRegioni]].
name(),
1562 Info<<
"Added patches in = "
1563 <<
mesh.time().cpuTimeIncrement() <<
" s" <<
nl <<
endl;
1574 const word& fzName =
mesh.faceZones()[zonei].name();
1585 if (i != string::npos)
1587 word cz0 = fzName.substr(0, i);
1588 word cz1 = fzName.substr(i+4, fzName.size()-i+4);
1589 word slaveName(cz1 +
"_to_" + cz0);
1595 const word slaveName = fzName +
"_slave";
1601 if (faceZoneToPatches.
size())
1603 snappyRefineDriver::addFaceZones
1630 const polyPatch& pp = pbm[adaptPatchIDs[i]];
1648 decompositionMethod::New
1658 <<
"You have selected decomposition method "
1659 << decomposer.typeName
1660 <<
" which is not parallel aware." <<
endl
1661 <<
"Please select one that is (hierarchical, ptscotch)"
1662 <<
exit(FatalError);
1675 const bool wantRefine
1677 meshRefinement::get<bool>(
meshDict,
"castellatedMesh", dryRun)
1681 meshRefinement::get<bool>(
meshDict,
"snap", dryRun)
1683 const bool wantLayers
1685 meshRefinement::get<bool>(
meshDict,
"addLayers", dryRun)
1693 if (errorMsg.size() || IOerrorMsg.size())
1702 <<
"Missing/incorrect required dictionary entries:" <<
nl
1704 << IOerrorMsg.c_str() <<
nl
1705 << errorMsg.c_str() <<
nl <<
nl
1706 <<
"Exiting dry-run" <<
nl <<
endl;
1718 meshRefinement::FaceMergeType::GEOMETRIC;
1720 const bool mergePatchFaces
1722 meshDict.getOrDefault(
"mergePatchFaces",
true)
1725 if (!mergePatchFaces)
1727 Info<<
"Not merging patch-faces of cell to preserve"
1728 <<
" (split)hex cell shape."
1730 mergeType = meshRefinement::FaceMergeType::NONE;
1734 const bool mergeAcrossPatches
1736 meshDict.getOrDefault(
"mergeAcrossPatches",
false)
1739 if (mergeAcrossPatches)
1741 Info<<
"Merging co-planar patch-faces of cells"
1742 <<
", regardless of patch assignment"
1744 mergeType = meshRefinement::FaceMergeType::IGNOREPATCH;
1760 globalToMasterPatch,
1767 if (!overwrite && !debugLevel)
1773 refineDriver.doRefine
1778 refineParams.handleSnapProblems(),
1784 if (!keepPatches && !wantSnap && !wantLayers)
1786 fvMeshTools::removeEmptyPatches(
mesh,
true);
1796 meshRefinement::writeLevel()
1800 Info<<
"Mesh refined in = "
1801 <<
timer.cpuTimeIncrement() <<
" s." <<
endl;
1803 profiling::writeNow();
1813 globalToMasterPatch,
1818 if (!overwrite && !debugLevel)
1824 scalar curvature = refineParams.curvature();
1825 scalar planarAngle = refineParams.planarAngle();
1838 if (!keepPatches && !wantLayers)
1840 fvMeshTools::removeEmptyPatches(
mesh,
true);
1850 meshRefinement::writeLevel()
1854 Info<<
"Mesh snapped in = "
1855 <<
timer.cpuTimeIncrement() <<
" s." <<
endl;
1857 profiling::writeNow();
1868 mesh.boundaryMesh(),
1875 globalToMasterPatch,
1883 (
mesh.nCells() >= refineParams.maxLocalCells()),
1888 if (!overwrite && !debugLevel)
1893 layerDriver.doLayers
1907 fvMeshTools::removeEmptyPatches(
mesh,
true);
1917 meshRefinement::writeLevel()
1921 Info<<
"Layers added in = "
1922 <<
timer.cpuTimeIncrement() <<
" s." <<
endl;
1924 profiling::writeNow();
1932 Info<<
"Checking final mesh ..." <<
endl;
1934 motionSmoother::checkMesh(
false,
mesh, motionDict, wrongFaces, dryRun);
1943 Info<<
"Finished meshing with " << nErrors <<
" illegal faces"
1944 <<
" (concave, zero area or negative cell pyramid volume)"
1950 Info<<
"Finished meshing without any errors" <<
endl;
1953 profiling::writeNow();
1957 if (surfaceSimplify)
1959 addProfiling(surfaceSimplify,
"snappyHexMesh::surfaceSimplify");
1967 includePatches =
bMesh.patchSet
1978 if (!isA<processorPolyPatch>(patch))
1980 includePatches.insert(patchi);
1990 "constant/triSurface/simplifiedSurface.stl"
2006 "internalCellCentres",
2010 IOobject::AUTO_WRITE
2015 cellCentres.write();
2018 profiling::writeNow();
2020 Info<<
"Finished meshing in = "
2029 if (errorMsg.size() || IOerrorMsg.size())
2037 <<
"Missing/incorrect required dictionary entries:" <<
nl
2039 << IOerrorMsg.c_str() <<
nl
2040 << errorMsg.c_str() <<
nl <<
nl
2041 <<
"Exiting dry-run" <<
nl <<
endl;
Istream and Ostream manipulators taking arguments.
reduce(hasMovingMesh, orOp< bool >())
label size_type
The type to represent the size of a buffer.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A HashTable similar to std::unordered_map.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
bool erase(T *item)
Remove the specified element from the list and delete it.
A primitive field of type <T> with automated input and output.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
void setSize(const label n)
Alias for resize()
A HashTable to objects of type <T> with a label key.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
An ordered pair of two objects of type <T> with first() and second() elements.
A list of faces which address into the list of points.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A List with indirect addressing. Like IndirectList but does not store addressing.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of elements in the list.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
int dryRun() const noexcept
Return the dry-run flag.
bool found(const word &optName) const
Return true if the named option is found.
List< T > getList(const label index) const
Get a List of values from the argument at index.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
void reset(autoPtr< T > &&other) noexcept
Delete managed object and set to new given pointer.
A bounding box defined in terms of min/max extrema points.
scalar mag() const
The magnitude of the bounding box span.
Starts timing CPU usage and return elapsed time from start.
Abstract base class for domain decomposition.
virtual bool parallelAware() const =0
Is method parallel aware?
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
autoPtr< dictionary > clone() const
Construct and return clone.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find for an entry (non-const access) with the given keyword.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
wordList toc() const
Return the table of contents.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A keyword and a list of tokens is an 'entry'.
const keyType & keyword() const noexcept
Return keyword.
virtual const dictionary & dict() const =0
Return dictionary, if entry is a dictionary.
string message() const
The accumulated error message.
void clear() const
Clear any messages.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Mesh data needed to do the Finite Volume discretisation.
Simple container to keep together layer specific information.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
label addFaceZone(const word &fzName, const word &masterPatch, const word &slavePatch, const surfaceZonesInfo::faceZoneType &fzType)
Add/lookup faceZone and update information. Return index of.
bool getFaceZoneInfo(const word &fzName, label &masterPatchID, label &slavePatchID, surfaceZonesInfo::faceZoneType &fzType) const
Lookup faceZone information. Return false if no information.
void updateIntersections(const labelList &changedFaces)
Find any intersection of surface. Store in surfaceIndex_.
writeType
Enumeration for what to write. Used as a bit-pattern.
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
debugType
Enumeration for what to debug. Used as a bit-pattern.
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
label addMeshedPatch(const word &name, const dictionary &)
Add patch originating from meshing. Update meshedPatches_.
const fvMesh & mesh() const
Reference to mesh.
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
bool write() const
Write mesh and all data.
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
label start() const
Return start label of this patch in the polyMesh face list.
Lookup type of boundary radiation properties.
Encapsulates queries for features.
Simple container to keep together refinement specific information.
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
const labelList & gapLevel() const
From global region number to small gap refinement level.
const PtrList< dictionary > & patchInfo() const
From global region number to patch type.
const wordList & names() const
Names of surfaces.
label globalRegion(const label surfI, const label regionI) const
From surface and region on surface to global region.
const labelList & surfaces() const
const labelList & minLevel() const
From global region number to refinement level.
const labelList & maxLevel() const
From global region number to refinement level.
void setMinLevelFields(const shellSurfaces &shells)
Calculate minLevelFields.
const PtrList< surfaceZonesInfo > & surfZones() const
virtual void rename(const word &newName)
Rename.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
const wordList & names() const
Surface names, not region names.
label checkTopology(const bool report) const
All topological checks. Return number of failed checks.
label checkGeometry(const scalar maxRatio, const scalar tolerance, autoPtr< coordSetWriter > &setWriter, const scalar minQuality, const bool report) const
All geometric checks. Return number of failed checks.
void writeStats(const List< wordList > &, Ostream &) const
Write some stats.
const List< wordList > & regionNames() const
Region names per surface.
Encapsulates queries for volume refinement ('refine all cells within shell').
Simple container to keep together snap specific information.
All to do with adding layers.
All to do with snapping to surface.
Identifies a surface patch/zone by name and index, with optional geometric type.
faceZoneType
What to do with faceZone faces.
Implements a timeout mechanism via sigalarm.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
const IOdictionary & meshDict
const word dictName("faMeshDefinition")
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
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))
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
void inplaceRenumber(const labelUList &oldToNew, IntListType &lists)
Inplace renumber the values (not the indices) of a list of lists.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
const std::string patch
OpenFOAM patch number as a std::string.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
label checkGeometry(const polyMesh &mesh, const bool allGeometry, autoPtr< surfaceWriter > &surfWriter, autoPtr< coordSetWriter > &setWriter)
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Omanip< int > setw(const int i)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
constexpr char nl
The newline '\n' character (0x0a)
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
wordList patchTypes(nPatches)
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
word setFormat(propsDict.getOrDefault< word >("setFormat", "vtk"))