91 bool hasSide = surfacesDict.
readIfPresent(
"cellZoneInside", method);
94 zoneInside_ = areaSelectionAlgoNames[method];
95 if (zoneInside_ == INSIDEPOINT)
97 surfacesDict.
lookup(
"insidePoint") >> zoneInsidePoint_;
108 zoneInside_ = (inside ? INSIDE : OUTSIDE);
119 zoneInside_ == INSIDE
120 || zoneInside_ == OUTSIDE
127 "surfaceZonesInfo::surfaceZonesInfo(..)",
129 ) <<
"Illegal entry zoneInside " 130 << areaSelectionAlgoNames[zoneInside_]
133 <<
" since surface is not closed." <<
endl;
140 "surfaceZonesInfo::surfaceZonesInfo(..)",
142 ) <<
"Unused entry zoneInside for faceZone " 144 <<
" since no cellZone specified." 152 faceType_ = faceZoneTypeNames[faceTypeMethod];
160 const word& faceZoneName,
161 const word& cellZoneName,
163 const point& zoneInsidePoint,
167 faceZoneName_(faceZoneName),
168 cellZoneName_(cellZoneName),
169 zoneInside_(zoneInside),
170 zoneInsidePoint_(zoneInsidePoint),
177 faceZoneName_(surfZone.faceZoneName()),
178 cellZoneName_(surfZone.cellZoneName()),
179 zoneInside_(surfZone.zoneInside()),
180 zoneInsidePoint_(surfZone.zoneInsidePoint()),
181 faceType_(surfZone.faceType())
197 anonymousSurfaces[i++] = surfI;
200 anonymousSurfaces.setSize(i);
202 return anonymousSurfaces;
219 && surfList[surfI].faceZoneName().
size()
222 namedSurfaces[namedI++] = surfI;
227 return namedSurfaces;
246 && surfList[surfI].cellZoneName().
size()
251 && allGeometry[surfaces[surfI]].hasVolumeType()
254 closed[closedI++] = surfI;
257 closed.setSize(closedI);
278 && !allGeometry[surfaces[surfI]].hasVolumeType()
281 unclosed[unclosedI++] = surfI;
284 unclosed.setSize(unclosedI);
305 && surfList[surfI].cellZoneName().
size()
306 && allGeometry[surfaces[surfI]].hasVolumeType()
309 closed[closedI++] = surfI;
312 closed.setSize(closedI);
331 && surfList[surfI].cellZoneName().
size()
335 closed[closedI++] = surfI;
338 closed.setSize(closedI);
357 label surfI = namedSurfaces[i];
359 const word& cellZoneName = surfList[surfI].cellZoneName();
363 label zoneI = cellZones.findZoneID(cellZoneName);
367 zoneI = cellZones.
size();
368 cellZones.setSize(zoneI+1);
382 surfaceToCellZone[surfI] = zoneI;
392 for (
label procI = 1; procI < allCellZones.
size(); procI++)
394 if (allCellZones[procI] != allCellZones[0])
398 "meshRefinement::zonify" 399 "(const label, const point&)" 400 ) <<
"Zones not synchronised among processors." <<
nl 401 <<
" Processor0 has cellZones:" << allCellZones[0]
402 <<
" , processor" << procI
403 <<
" has cellZones:" << allCellZones[procI]
408 return surfaceToCellZone;
425 label surfI = namedSurfaces[i];
427 const word& faceZoneName = surfList[surfI].faceZoneName();
429 label zoneI = faceZones.findZoneID(faceZoneName);
433 zoneI = faceZones.
size();
434 faceZones.setSize(zoneI+1);
449 surfaceToFaceZone[surfI] = zoneI;
458 for (
label procI = 1; procI < allFaceZones.
size(); procI++)
460 if (allFaceZones[procI] != allFaceZones[0])
464 "meshRefinement::zonify" 465 "(const label, const point&)" 466 ) <<
"Zones not synchronised among processors." <<
nl 467 <<
" Processor0 has faceZones:" << allFaceZones[0]
468 <<
" , processor" << procI
469 <<
" has faceZones:" << allFaceZones[procI]
474 return surfaceToFaceZone;
const cellZoneMesh & cellZones() const
Return cell zone mesh.
static labelList getInsidePointNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of surfaces with a cellZone that have 'insidePoint'.
const faceZoneMesh & faceZones() const
Return face zone mesh.
label size() const
Return the number of elements in the PtrList.
bool set(const label) const
Is element set.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
virtual bool hasVolumeType() const =0
Whether supports volume type below.
faceZoneType
What to do with faceZone faces.
surfaceZonesInfo(const searchableSurface &surface, const dictionary &surfacesDict)
Construct from surfaces and dictionary.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
areaSelectionAlgo
Types of selection of area.
static const NamedEnum< areaSelectionAlgo, 4 > areaSelectionAlgoNames
A subset of mesh faces organised as a primitive patch.
static labelList getUnnamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of unnamed surfaces (surfaces without faceZoneName)
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static const NamedEnum< faceZoneType, 3 > faceZoneTypeNames
A list of keyword definitions, which are a keyword followed by any number of values (e...
static labelList getClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed and.
#define IOWarningIn(functionName, ios)
Report an IO warning using Foam::Warning.
const word & faceZoneName() const
Per 'interface' surface : empty or name of faceZone to put.
static labelList addFaceZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
static label nProcs(const label communicator=0)
Number of processes in parallel run.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static labelList addCellZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
A surface zone on a MeshedSurface.
Initialise the NamedEnum HashTable from the static list of names.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
static labelList getUnclosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are unclosed.
Mesh consisting of general polyhedral cells.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
List< label > labelList
A List of labels.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
Container for searchableSurfaces.
static const word null
An empty word.
static labelList getAllClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed.
List< bool > boolList
Bool container classes.