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" },
78 const searchableSurface&
surface,
79 const dictionary& surfacesDict,
96 if (surfacesDict.readIfPresent(
"faceZone", faceZoneName))
99 if (surfacesDict.found(
"faceZoneNaming"))
102 <<
"Cannot provide both \"faceZone\" and \"faceZoneNaming\"" 106 namingType = faceZoneNaming::SINGLE;
107 faceZoneNames_.
setSize(nRegions, faceZoneName);
109 else if (surfacesDict.readIfPresent(
"faceZoneNaming", namingMethod))
117 case faceZoneNaming::NOZONE:
120 case faceZoneNaming::SINGLE:
126 surfacesDict.get<word>(
"faceZone")
131 case faceZoneNaming::REGION:
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_);
167 if (surfacesDict.readIfPresent(
"zoneInside", inside))
176 if (surfacesDict.readIfPresent(
"cellZone", cellZoneName_))
188 <<
"Illegal entry zoneInside " 192 <<
" since surface is not closed." <<
endl;
198 <<
"Unused entry zoneInside for faceZone " 200 <<
" since no cellZone specified." 206 if (surfacesDict.readIfPresent(
"faceType", faceTypeMethod))
217 const word& cellZoneName,
218 const areaSelectionAlgo& zoneInside,
219 const point& zoneInsidePoint,
220 const faceZoneType& faceType
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;
256 anonymousSurfaces.setSize(i);
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;
339 closed.setSize(closedI);
360 && !allGeometry[surfaces[surfI]].hasVolumeType()
363 unclosed[unclosedI++] = surfI;
366 unclosed.setSize(unclosedI);
387 && surfList[surfI].cellZoneName().
size()
388 && allGeometry[surfaces[surfI]].hasVolumeType()
391 closed[closedI++] = surfI;
394 closed.setSize(closedI);
413 && surfList[surfI].cellZoneName().
size()
417 closed[closedI++] = surfI;
420 closed.setSize(closedI);
439 zoneI = cellZones.
size();
459 const PtrList<surfaceZonesInfo>& surfList,
464 labelList surfaceToCellZone(surfList.size(), -1);
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;
static const Enum< areaSelectionAlgo > areaSelectionAlgoNames
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A surface zone on a MeshedSurface.
constexpr char nl
The newline '\n' character (0x0a)
static labelListList addFaceZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static const Enum< faceZoneNaming > faceZoneNamingNames
static labelList addCellZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
static const Enum< faceZoneType > faceZoneTypeNames
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
static labelList getStandaloneNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces without a cellZone.
static labelList getUnclosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are unclosed.
static labelList getAllClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed.
#define forAll(list, i)
Loop across all elements in list.
static void allGatherList(List< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses linear/tree communication. ...
bool readEntry(const word &key, const dictionary &dict, EnumType &val, const bool mandatory=true) const
Find entry and assign to T val.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
A class for handling words, derived from Foam::string.
label size() const noexcept
The number of entries in the list.
static const word null
An empty word.
Container for searchableSurfaces. The collection is specified as a dictionary. For example...
static labelList getInsidePointNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of surfaces with a cellZone that have 'insidePoint'.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static labelList getUnnamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of unnamed surfaces (surfaces without faceZoneName)
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
void setSize(const label newLen)
Same as resize()
List< word > wordList
List of word.
vector point
Point is a vector.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
surfaceZonesInfo(const searchableSurface &surface, const dictionary &surfacesDict, const wordList ®ionNames)
Construct from surfaces and dictionary and fully resolved.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
faceZoneNaming
How to generate faceZone name.
const cellZoneMesh & cellZones() const noexcept
Return cell zone 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.
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
wordList names() const
A list of the zone names.
faceZoneType
What to do with faceZone faces.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
Mesh consisting of general polyhedral cells.
A subset of mesh faces organised as a primitive patch.
List< label > labelList
A List of labels.
List< bool > boolList
A List of bools.
areaSelectionAlgo
Types of selection of area.
static label addFaceZone(const word &name, const labelList &addressing, const boolList &flipMap, polyMesh &mesh)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static label addCellZone(const word &name, const labelList &addressing, polyMesh &mesh)