Go to the documentation of this file.
43 { areaSelectionAlgo::INSIDE,
"inside" },
44 { areaSelectionAlgo::OUTSIDE,
"outside" },
45 { areaSelectionAlgo::INSIDEPOINT,
"insidePoint" },
46 { areaSelectionAlgo::NONE,
"none" },
56 { faceZoneType::INTERNAL,
"internal" },
57 { faceZoneType::BAFFLE,
"baffle" },
58 { faceZoneType::BOUNDARY,
"boundary" },
82 bool hasSide = surfacesDict.
readIfPresent(
"cellZoneInside", method);
85 zoneInside_ = areaSelectionAlgoNames[method];
86 if (zoneInside_ == INSIDEPOINT)
88 surfacesDict.
readEntry(
"insidePoint", zoneInsidePoint_);
99 zoneInside_ = (inside ? INSIDE : OUTSIDE);
110 zoneInside_ == INSIDE
111 || zoneInside_ == OUTSIDE
117 <<
"Illegal entry zoneInside "
118 << areaSelectionAlgoNames[zoneInside_]
121 <<
" since surface is not closed." <<
endl;
127 <<
"Unused entry zoneInside for faceZone "
129 <<
" since no cellZone specified."
137 faceType_ = faceZoneTypeNames[faceTypeMethod];
145 const word& faceZoneName,
146 const word& cellZoneName,
148 const point& zoneInsidePoint,
152 faceZoneName_(faceZoneName),
153 cellZoneName_(cellZoneName),
154 zoneInside_(zoneInside),
155 zoneInsidePoint_(zoneInsidePoint),
162 faceZoneName_(
surfZone.faceZoneName()),
163 cellZoneName_(
surfZone.cellZoneName()),
165 zoneInsidePoint_(
surfZone.zoneInsidePoint()),
175 labelList anonymousSurfaces(surfList.size());
180 if (surfList[surfI].faceZoneName().empty())
182 anonymousSurfaces[i++] = surfI;
185 anonymousSurfaces.setSize(i);
187 return anonymousSurfaces;
196 labelList namedSurfaces(surfList.size());
204 && surfList[surfI].faceZoneName().size()
207 namedSurfaces[namedI++] = surfI;
212 return namedSurfaces;
221 labelList namedSurfaces(surfList.size());
229 && surfList[surfI].faceZoneName().size()
230 && !surfList[surfI].cellZoneName().size()
233 namedSurfaces[namedI++] = surfI;
238 return namedSurfaces;
257 && surfList[surfI].cellZoneName().size()
262 && allGeometry[surfaces[surfI]].hasVolumeType()
265 closed[closedI++] = surfI;
268 closed.setSize(closedI);
289 && !allGeometry[surfaces[surfI]].hasVolumeType()
292 unclosed[unclosedI++] = surfI;
295 unclosed.setSize(unclosedI);
316 && surfList[surfI].cellZoneName().size()
317 && allGeometry[surfaces[surfI]].hasVolumeType()
320 closed[closedI++] = surfI;
323 closed.setSize(closedI);
342 && surfList[surfI].cellZoneName().size()
346 closed[closedI++] = surfI;
349 closed.setSize(closedI);
368 zoneI = cellZones.size();
369 cellZones.setSize(zoneI+1);
393 labelList surfaceToCellZone(surfList.size(), -1);
397 label surfI = namedSurfaces[i];
399 const word& cellZoneName = surfList[surfI].cellZoneName();
403 label zoneI = addCellZone
410 surfaceToCellZone[surfI] = zoneI;
420 for (
label proci = 1; proci < allCellZones.size(); proci++)
422 if (allCellZones[proci] != allCellZones[0])
425 <<
"Zones not synchronised among processors." <<
nl
426 <<
" Processor0 has cellZones:" << allCellZones[0]
427 <<
" , processor" << proci
428 <<
" has cellZones:" << allCellZones[proci]
433 return surfaceToCellZone;
452 zoneI = faceZones.size();
453 faceZones.setSize(zoneI+1);
478 labelList surfaceToFaceZone(surfList.size(), -1);
484 label surfI = namedSurfaces[i];
486 const word& faceZoneName = surfList[surfI].faceZoneName();
488 label zoneI = addFaceZone
496 surfaceToFaceZone[surfI] = zoneI;
505 for (
label proci = 1; proci < allFaceZones.size(); proci++)
507 if (allFaceZones[proci] != allFaceZones[0])
510 <<
"Zones not synchronised among processors." <<
nl
511 <<
" Processor0 has faceZones:" << allFaceZones[0]
512 <<
" , processor" << proci
513 <<
" has faceZones:" << allFaceZones[proci]
518 return surfaceToFaceZone;
List< label > labelList
A List of labels.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
faceZoneType
What to do with faceZone faces.
surfaceZonesInfo(const searchableSurface &surface, const dictionary &surfacesDict)
Construct from surfaces and dictionary.
A class for handling words, derived from Foam::string.
static labelList getInsidePointNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of surfaces with a cellZone that have 'insidePoint'.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
List< bool > boolList
A List of bools.
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static labelList getAllClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed.
static labelList addFaceZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
const faceZoneMesh & faceZones() const
Return face zone mesh.
static labelList getStandaloneNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces without a cellZone.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A subset of mesh faces organised as a primitive patch.
word name(const complex &c)
Return string representation of complex.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
areaSelectionAlgo
Types of selection of area.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool hasVolumeType() const
Whether supports volume type (below).
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
label findZoneID(const word &zoneName) const
Find zone index given a name, return -1 if not found.
static labelList getClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed and.
wordList names() const
A list of the zone names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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 getUnnamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of unnamed surfaces (surfaces without faceZoneName)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static const Enum< faceZoneType > faceZoneTypeNames
#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.
A surface zone on a MeshedSurface.
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
static const word null
An empty word.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
void setSize(const label newSize)
Alias for resize(const label)
static const Enum< areaSelectionAlgo > areaSelectionAlgoNames
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
static label addCellZone(const word &name, const labelList &addressing, polyMesh &mesh)
static labelList addCellZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
static label addFaceZone(const word &name, const labelList &addressing, const boolList &flipMap, polyMesh &mesh)