43 { areaSelectionAlgo::INSIDE,
"inside" },
44 { areaSelectionAlgo::OUTSIDE,
"outside" },
45 { areaSelectionAlgo::INSIDEPOINT,
"insidePoint" },
46 { areaSelectionAlgo::NONE,
"none" },
56 { faceZoneNaming::NOZONE,
"none" },
57 { faceZoneNaming::SINGLE,
"single" },
58 { faceZoneNaming::REGION,
"region" }
68 { faceZoneType::INTERNAL,
"internal" },
69 { faceZoneType::BAFFLE,
"baffle" },
70 { faceZoneType::BOUNDARY,
"boundary" },
89 const label nRegions = surface.regions().
size();
99 if (surfacesDict.
found(
"faceZoneNaming"))
102 <<
"Cannot provide both \"faceZone\" and \"faceZoneNaming\""
107 faceZoneNames_.
setSize(nRegions, faceZoneName);
109 else if (surfacesDict.
readIfPresent(
"faceZoneNaming", namingMethod))
126 surfacesDict.
get<
word>(
"faceZone")
139 if (faceZoneNames_.
size())
141 if (faceZoneNames_.
size() != nRegions)
144 <<
"Number of faceZones (through 'faceZones' keyword)"
145 <<
" does not correspond to the number of regions "
146 << nRegions <<
" in surface " << surface.name()
153 bool hasSide = surfacesDict.
readIfPresent(
"cellZoneInside", method);
159 surfacesDict.
readEntry(
"insidePoint", zoneInsidePoint_);
184 && !surface.hasVolumeType()
188 <<
"Illegal entry zoneInside "
192 <<
" since surface is not closed." <<
endl;
198 <<
"Unused entry zoneInside for faceZone "
200 <<
" since no cellZone specified."
217 const word& cellZoneName,
219 const point& zoneInsidePoint,
223 faceZoneNames_(faceZoneNames),
224 cellZoneName_(cellZoneName),
225 zoneInside_(zoneInside),
226 zoneInsidePoint_(zoneInsidePoint),
233 faceZoneNames_(
surfZone.faceZoneNames()),
234 cellZoneName_(
surfZone.cellZoneName()),
236 zoneInsidePoint_(
surfZone.zoneInsidePoint()),
251 if (surfList[surfI].faceZoneNames().empty())
253 anonymousSurfaces[i++] = surfI;
258 return anonymousSurfaces;
275 && surfList[surfI].faceZoneNames().
size()
278 namedSurfaces[namedI++] = surfI;
283 return namedSurfaces;
300 && surfList[surfI].faceZoneNames().
size()
301 && !surfList[surfI].cellZoneName().
size()
304 namedSurfaces[namedI++] = surfI;
309 return namedSurfaces;
328 && surfList[surfI].cellZoneName().
size()
333 && allGeometry[surfaces[surfI]].hasVolumeType()
336 closed[closedI++] = surfI;
360 && !allGeometry[surfaces[surfI]].hasVolumeType()
363 unclosed[unclosedI++] = surfI;
387 && surfList[surfI].cellZoneName().
size()
388 && allGeometry[surfaces[surfI]].hasVolumeType()
391 closed[closedI++] = surfI;
413 && surfList[surfI].cellZoneName().
size()
417 closed[closedI++] = surfI;
439 zoneI = cellZones.
size();
468 label surfI = namedSurfaces[i];
470 const word& cellZoneName = surfList[surfI].cellZoneName();
474 label zoneI = addCellZone
481 surfaceToCellZone[surfI] = zoneI;
490 for (label proci = 1; proci < allCellZones.
size(); proci++)
492 if (allCellZones[proci] != allCellZones[0])
495 <<
"Zones not synchronised among processors." <<
nl
496 <<
" Processor0 has cellZones:" << allCellZones[0]
497 <<
" , processor" << proci
498 <<
" has cellZones:" << allCellZones[proci]
503 return surfaceToCellZone;
522 zoneI = faceZones.
size();
624 label surfI = namedSurfaces[i];
626 const wordList& faceZoneNames = surfList[surfI].faceZoneNames();
628 surfaceToFaceZones[surfI].
setSize(faceZoneNames.
size(), -1);
631 const word& faceZoneName = faceZoneNames[j];
633 label zoneI = addFaceZone
641 surfaceToFaceZones[surfI][j] = zoneI;
650 for (label proci = 1; proci < allFaceZones.
size(); proci++)
652 if (allFaceZones[proci] != allFaceZones[0])
655 <<
"Zones not synchronised among processors." <<
nl
656 <<
" Processor0 has faceZones:" << allFaceZones[0]
657 <<
" , processor" << proci
658 <<
" has faceZones:" << allFaceZones[proci]
663 return surfaceToFaceZones;
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
void setSize(const label n)
Alias for resize()
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
static void allGatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
void setSize(const label newLen)
Same as resize()
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of elements in the list.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
wordList names() const
A list of the zone names.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A subset of mesh faces organised as a primitive patch.
Mesh consisting of general polyhedral cells.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
int myProcNo() const noexcept
Return processor number.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
A surface zone on a MeshedSurface.
faceZoneNaming
How to generate faceZone name.
static labelList getInsidePointNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of surfaces with a cellZone that have 'insidePoint'.
areaSelectionAlgo
Types of selection of area.
static labelList getUnnamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of unnamed surfaces (surfaces without faceZoneName)
static labelList getStandaloneNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces without a cellZone.
faceZoneType
What to do with faceZone faces.
static label addFaceZone(const word &name, const labelList &addressing, const boolList &flipMap, polyMesh &mesh)
static const Enum< faceZoneType > faceZoneTypeNames
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
static labelList getAllClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed.
static const Enum< faceZoneNaming > faceZoneNamingNames
static labelList addCellZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
static labelList getUnclosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are unclosed.
static labelListList addFaceZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
static const Enum< areaSelectionAlgo > areaSelectionAlgoNames
static label addCellZone(const word &name, const labelList &addressing, polyMesh &mesh)
static labelList getClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed and.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
List< bool > boolList
A List of bools.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.