39 "Default_Boundary_Region";
42 "Default_Boundary_Solid";
49 { 0, 1, 4, -1, 2, 3 },
50 { 3, -1, 2, -1, 1, 0 },
64 while ((is) && ch !=
'\n');
86 if (header != fileSignature)
88 Info<<
"header mismatch " << fileSignature <<
" " << is.
name()
119 const scalar scaleFactor
122 const word fileSignature =
"PROSTAR_VERTEX";
134 while ((is >> lineLabel).good())
137 maxId =
max(maxId, lineLabel);
142 Info<<
"Number of points = " << nPoints <<
endl;
167 while ((is >> lineLabel).good())
179 if (nPoints > pointi)
187 if (scaleFactor > 1.0 + small || scaleFactor < 1.0 - small)
195 <<
"no points in file " << inputName
244 const word fileSignature =
"PROSTAR_CELL";
245 label nFluids = 0, nSolids = 0, nBaffles = 0, nShells = 0;
248 bool unknownVertices =
false;
258 label lineLabel, shapeId, nLabels, cellTableId, typeId;
260 while ((is >> lineLabel).good())
262 label starCellId = lineLabel;
281 maxId =
max(maxId, starCellId);
294 maxId =
max(maxId, starCellId);
308 maxId =
max(maxId, starCellId);
323 Info<<
"Number of fluids = " << nFluids <<
nl 324 <<
"Number of baffles = " << nBaffles <<
nl;
327 Info<<
"Number of solids = " << nSolids <<
nl;
331 Info<<
"Ignored solids = " << nSolids <<
nl;
333 Info<<
"Ignored shells = " << nShells <<
endl;
339 nCells = nFluids + nSolids;
367 <<
"no cells in file " << inputName
376 label lineLabel, shapeId, nLabels, cellTableId, typeId;
381 while ((is >> lineLabel).good())
383 label starCellId = lineLabel;
389 if (nLabels > starLabels.
size())
396 for (
label i = 0; i < nLabels; ++i)
437 for (
label i=0; i < nLabels; ++i)
442 Info<<
"Cells inconsistent with vertex file. " 443 <<
"Star vertex " << starLabels[i]
444 <<
" does not exist" <<
endl;
446 unknownVertices =
true;
448 starLabels[i] = pointId;
473 label nFaces = starLabels[0] - 1;
478 for (
label i=starLabels[0]; i < nLabels; ++i)
483 Info<<
"Cells inconsistent with vertex file. " 484 <<
"Star vertex " << starLabels[i]
485 <<
" does not exist" <<
endl;
487 unknownVertices =
true;
489 starLabels[i] = pointId;
500 for (
label i=0; i < nFaces; ++i)
502 label beg = starLabels[i];
503 label n = starLabels[i+1] - beg;
521 Info<<
"star cell " << starCellId <<
" has " 523 <<
" empty faces - could cause boundary " 524 <<
"addressing problems" 534 <<
"star cell " << starCellId <<
" has " << nFaces
553 for (
label i=0; i < nLabels; ++i)
558 Info<<
"Baffles inconsistent with vertex file. " 559 <<
"Star vertex " << starLabels[i]
560 <<
" does not exist" <<
endl;
562 unknownVertices =
true;
564 starLabels[i] = pointId;
598 <<
"cells with unknown vertices" 635 const word fileSignature =
"PROSTAR_BOUNDARY";
636 label nPatches = 0, nFaces = 0, nBafflePatches = 0, maxId = 0;
637 label lineLabel, starCellId, cellFaceId, starRegion, configNumber;
673 while ((is >> lineLabel).good())
683 label patchLabel = mapToFoamPatchId[starRegion];
684 if (patchLabel == -1)
687 mapToFoamPatchId[starRegion] = patchLabel;
688 origRegion[patchLabel] = starRegion;
691 maxId =
max(maxId, starRegion);
694 if (patchType ==
"BAFF")
701 nPatchFaces[patchLabel]++;
706 Info<<
"No boundary faces in file " << inputName <<
endl;
711 Info<<
"Could not read boundary file " << inputName <<
endl;
717 Info<<
"Number of patches = " << nPatches
718 <<
" (including extra for missing)" <<
endl;
727 origRegion[nPatches-1] = 0;
728 nPatchFaces[nPatches-1] = 0;
735 bool foundName =
false, foundType =
false;
745 foundType = iter().readIfPresent
751 foundName = iter().readIfPresent
805 oldToNew[sortedIndices[i]] = i;
820 label baffleIndex = (nPatches-1 - nBafflePatches);
822 for (
label i=0; i < oldToNew.
size()-1; ++i)
826 oldToNew[i] = baffleIndex++;
830 oldToNew[i] = newIndex++;
840 mapToFoamPatchId.
setSize(maxId+1, -1);
861 while ((is >> lineLabel).good())
886 <<
"Boundaries inconsistent with cell file. " 887 <<
"Star cell " << starCellId <<
" does not exist" 896 if (faceLookupIndex.
found(index))
898 index = faceLookupIndex[index];
912 #ifdef DEBUG_BOUNDARY 913 Info<<
"bnd " << cellId <<
" " << cellFaceId <<
endl;
936 if (origType ==
"symplane")
941 else if (origType ==
"wall")
946 else if (origType ==
"cyclic")
951 else if (origType ==
"baffle")
962 <<
" (region " << origRegion[
patchi]
990 oldToNew[labels[j]]++;
999 if (oldToNew[i] >= 0)
1001 oldToNew[i] = pointi++;
1006 if (nPoints > pointi)
1008 Info<<
"Unused points = " << (nPoints - pointi) <<
endl;
1053 const scalar scaleFactor
static const char *const defaultSolidBoundaryName
static const cellModel * tetModel
static const char *const defaultBoundaryName
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
List< List< cellFaceIdentifier > > boundaryIds_
Identify boundary faces by cells and their faces.
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
wordList patchPhysicalTypes_
Boundary patch physical types.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
A class for handling file names.
void readAux(const objectRegistry &)
Read auxiliary data from constant/{boundaryRegion,cellTable}.
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
A face is a list of labels corresponding to mesh vertices.
virtual ~STARCD()
Destructor.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
labelList mapToFoamCellId_
Cell labels (imported Cell numbering not necessarily contiguous)
An analytical geometric cellShape.
void setName(const label, const word &)
Assign name.
void size(const label)
Override size to be inconsistent with allocated storage.
wordList patchTypes_
Boundary patch types.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Identify cell faces in terms of cell Id and face Id.
static const int starToFoamFaceAddr[4][6]
Face addressing from pro-STAR faces -> OpenFOAM faces.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
virtual bool readGeometry(const scalar scaleFactor=1.0)
Read the mesh from the file(s)
static const cellModel * prismModel
static void readToNewline(IFstream &)
Read and discard to newline.
void setMaterial(const label, const word &)
Assign material Type.
pointField points_
Points supporting the mesh.
bool good() const
Return true if next operation might succeed.
static const cellModel * unknownModel
Pointers to cell shape models.
virtual void readCells(const fileName &)
Read cell connectivities from file.
Various functions to operate on Lists.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
label collapse()
Collapse face by removing duplicate point labels.
A List obtained as a section of another List.
labelList origCellId_
Lookup original Cell number for a given cell.
wordList patchNames_
Boundary patch names.
void readDict(const objectRegistry &, const word &name="cellTable", const fileName &instance="constant")
Read constant/cellTable.
bool found(const Key &) const
Return true if hashedEntry is found in table.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
const fileName & name() const
Return the name of the stream.
meshReader(const fileName &, const scalar scaleFactor=1.0)
Construct from fileName.
boundaryRegion boundaryRegion_
Boundary region data.
List< label > labelList
A List of labels.
static bool readHeader(IFstream &, word fileSignature)
Read header.
static const cellModel * pyrModel
errorManip< error > abort(error &err)
word name(const complex &)
Return a string representation of a complex.
cellTable cellTable_
Cell table persistent data saved as a dictionary.
fileName geometryFile_
Referenced filename.
label index() const
Return index of model in the model list.
void readDict(const objectRegistry &, const word &name="boundaryRegion", const fileName &instance="constant")
Read constant/boundaryRegion.
void setSize(const label)
Reset size of List.
static const cellModel * hexModel
faceList baffleFaces_
List of each baffle face.
labelList cellTableId_
Cell table id for each cell.
void readPoints(const fileName &, const scalar scaleFactor)
Read points from file.
Maps a geometry to a set of cell primitives, which enables geometric cell data to be calculated witho...
labelList mapToFoamPointId_
Point labels (imported Point numbering not necessarily contiguous)
cellShapeList cellShapes_
Cell shapes.
Registry of regIOobjects.
void readBoundary(const fileName &)
Read boundary (cell/face) definitions.
STARCD(const fileName &prefix, const objectRegistry &, const scalar scaleFactor=1.0)
Construct from case name.
faceListList cellFaces_
List of faces for every cell.
static bool keepSolids
Keep solids (default false)
void cullPoints()
Remove unused points.