39 void Foam::starMesh::readBoundary()
41 label nPatches=0, nFaces=0;
44 label lineIndex, starLabel;
45 label starRegion, configNumber;
54 patchNames_.setSize(1000);
56 fileName boundaryFileName(casePrefix_ +
".bnd");
59 IFstream boundaryFile(boundaryFileName);
67 if (boundaryFile.good())
69 forAll(nPatchFaces, faceLabel)
71 nPatchFaces[faceLabel] = 0;
74 while ((boundaryFile >> lineIndex).good())
79 for (
int i=0; i<4; i++)
81 boundaryFile >> starLabel;
84 boundaryFile >> starRegion;
85 boundaryFile >> configNumber;
86 boundaryFile >> patchType;
89 label patchLabel = patchLabels[starRegion];
93 patchLabels[starRegion] = patchLabel;
94 patchTypes_[patchLabel] = patchType;
95 patchNames_[patchLabel] = patchType +
name(starRegion);
99 Info<<
"Star region " << starRegion
100 <<
" with type " << patchType
101 <<
" is now Foam patch " << patchLabel <<
endl;
105 nPatchFaces[patchLabel]++;
110 <<
"Setting size of boundary to " << nPatches
113 nPatchFaces.setSize(nPatches);
118 <<
"Cannot read file " 126 boundary_.
setSize(nPatchFaces.size());
127 patchTypes_.
setSize(nPatchFaces.size());
128 patchNames_.setSize(nPatchFaces.size());
131 forAll(boundary_, patchLabel)
133 boundary_[patchLabel].
setSize(nPatchFaces[patchLabel]);
135 nPatchFaces[patchLabel] = 0;
138 IFstream boundaryFile(boundaryFileName);
140 for (
label facei=0; facei<nFaces; facei++)
142 boundaryFile >> lineIndex;
144 for (
int i = 0; i < 4; i++)
146 boundaryFile >> starLabel;
154 Info<<
"Boundary file not consistent with vertex file\n" 155 <<
"Star vertex number " << starLabel
156 <<
" does not exist\n";
161 boundaryFile >> starRegion;
162 label patchLabel = patchLabels[starRegion];
164 boundaryFile >> configNumber;
165 boundaryFile >> patchType;
180 boundary_[patchLabel][nPatchFaces[patchLabel]]
181 = face(pointLabelsTri);
185 boundary_[patchLabel][nPatchFaces[patchLabel]]
190 nPatchFaces[patchLabel]++;
193 forAll(boundary_, patchLabel)
195 word patchType = patchTypes_[patchLabel];
197 if (patchType ==
"SYMP")
199 patchTypes_[patchLabel] = symmetryPolyPatch::typeName;
201 else if (patchType ==
"WALL")
203 patchTypes_[patchLabel] = wallPolyPatch::typeName;
205 else if (patchType ==
"CYCL")
209 patchTypes_[patchLabel] = oldCyclicPolyPatch::typeName;
213 patchTypes_[patchLabel] = polyPatch::typeName;
216 Info<<
"Foam patch " << patchLabel
217 <<
" is of type " << patchTypes_[patchLabel]
218 <<
" with name " << patchNames_[patchLabel] <<
endl;
224 <<
"no boundary faces in file " 246 if (patchDicts.set(
patchi))
249 dict.readIfPresent(
"type", patchTypes_[
patchi]);
250 dict.readIfPresent(
"physicalType", patchPhysicalTypes_[patchi]);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
labelList pointLabels(nPoints,-1)
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const word & constant() const
Return constant name.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
word name(const complex &)
Return a string representation of a complex.
void preservePatchTypes(const objectRegistry &obr, const word &meshInstance, const fileName &meshDir, const wordList &patchNames, PtrList< dictionary > &patchDicts, const word &defaultFacesName, word &defaultFacesType)
Preserve patch types.
void setSize(const label)
Reset size of List.
#define WarningInFunction
Report a warning using Foam::Warning.
PtrList< dictionary > patchDicts