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);
171 <<
"Cannot supply both 'insidePoint'" 189 if (surfacesDict.readIfPresent(
"zoneInside", inside))
198 if (surfacesDict.readIfPresent(
"cellZone", cellZoneName_))
210 <<
"Illegal entry zoneInside " 214 <<
" since surface is not closed." <<
endl;
220 <<
"Unused entry zoneInside for faceZone " 222 <<
" since no cellZone specified." 228 if (surfacesDict.readIfPresent(
"faceType", faceTypeMethod))
239 const word& cellZoneName,
240 const areaSelectionAlgo& zoneInside,
242 const faceZoneType& faceType
245 faceZoneNames_(faceZoneNames),
246 cellZoneName_(cellZoneName),
247 zoneInside_(zoneInside),
248 zoneInsidePoints_(zoneInsidePoints),
255 faceZoneNames_(
surfZone.faceZoneNames()),
256 cellZoneName_(
surfZone.cellZoneName()),
258 zoneInsidePoints_(
surfZone.zoneInsidePoints()),
273 if (surfList[surfI].faceZoneNames().empty())
275 anonymousSurfaces[i++] = surfI;
278 anonymousSurfaces.setSize(i);
280 return anonymousSurfaces;
297 && surfList[surfI].faceZoneNames().
size()
300 namedSurfaces[namedI++] = surfI;
305 return namedSurfaces;
322 && surfList[surfI].faceZoneNames().
size()
323 && !surfList[surfI].cellZoneName().
size()
326 namedSurfaces[namedI++] = surfI;
331 return namedSurfaces;
350 && surfList[surfI].cellZoneName().
size()
355 && allGeometry[surfaces[surfI]].hasVolumeType()
358 closed[closedI++] = surfI;
361 closed.setSize(closedI);
382 && !allGeometry[surfaces[surfI]].hasVolumeType()
385 unclosed[unclosedI++] = surfI;
388 unclosed.setSize(unclosedI);
409 && surfList[surfI].cellZoneName().
size()
410 && allGeometry[surfaces[surfI]].hasVolumeType()
413 closed[closedI++] = surfI;
416 closed.setSize(closedI);
435 && surfList[surfI].cellZoneName().
size()
439 closed[closedI++] = surfI;
442 closed.setSize(closedI);
461 zoneID = cellZones.
size();
478 const PtrList<surfaceZonesInfo>& surfList,
483 labelList surfaceToCellZone(surfList.size(), -1);
487 label surfI = namedSurfaces[i];
489 const word& cellZoneName = surfList[surfI].cellZoneName();
491 if (!cellZoneName.empty())
493 label zoneI = addCellZone
500 surfaceToCellZone[surfI] = zoneI;
509 for (label proci = 1; proci < allCellZones.size(); proci++)
511 if (allCellZones[proci] != allCellZones[0])
514 <<
"Zones not synchronised among processors." <<
nl 515 <<
" Processor0 has cellZones:" << allCellZones[0]
516 <<
" , processor" << proci
517 <<
" has cellZones:" << allCellZones[proci]
522 return surfaceToCellZone;
541 zoneID = faceZones.
size();
639 label surfI = namedSurfaces[i];
641 const wordList& faceZoneNames = surfList[surfI].faceZoneNames();
643 surfaceToFaceZones[surfI].
setSize(faceZoneNames.
size(), -1);
646 const word& faceZoneName = faceZoneNames[j];
648 label zoneI = addFaceZone
656 surfaceToFaceZones[surfI][j] = zoneI;
665 for (label proci = 1; proci < allFaceZones.size(); proci++)
667 if (allFaceZones[proci] != allFaceZones[0])
670 <<
"Zones not synchronised among processors." <<
nl 671 <<
" Processor0 has faceZones:" << allFaceZones[0]
672 <<
" , processor" << proci
673 <<
" has faceZones:" << allFaceZones[proci]
678 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.
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val, const bool warnOnly=false) const
Find an entry if present, and assign to T val.
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.
T & emplace_back(Args &&... args)
Construct and append an element to the end of the list, return reference to the new list element...
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 label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
vectorField pointField
pointField is a vectorField.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::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.
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'.
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()
static void allGatherList(UList< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses MPI_Allgather or manual linear/tree communicat...
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.
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)