39 void Foam::sammMesh::readBoundary()
41 label nPatches=0, nFaces=0;
44 label lineIndex, sammLabel;
45 label sammRegion, 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 >> sammLabel;
84 boundaryFile >> sammRegion;
85 boundaryFile >> configNumber;
86 boundaryFile >> patchType;
89 label patchLabel = patchLabels[sammRegion];
93 patchLabels[sammRegion] = patchLabel;
94 patchTypes_[patchLabel] = patchType;
95 patchNames_[patchLabel] = patchType +
name(sammRegion);
99 Info<<
"Samm region " << sammRegion
100 <<
" with type " << patchType
101 <<
" is now Foam patch " << patchLabel <<
endl;
105 nPatchFaces[patchLabel]++;
110 <<
"Setting size of shapePatchList to " << nPatches
113 nPatchFaces.setSize(nPatches);
115 patchNames_.setSize(nPatches);
120 <<
"Cannot read file " 128 boundary_.
setSize(nPatchFaces.size());
129 patchTypes_.
setSize(nPatchFaces.size());
130 patchNames_.setSize(nPatchFaces.size());
133 forAll(boundary_, patchLabel)
135 boundary_[patchLabel].
setSize(nPatchFaces[patchLabel]);
137 nPatchFaces[patchLabel] = 0;
140 IFstream boundaryFile(boundaryFileName);
142 for (
label facei=0; facei<nFaces; facei++)
144 boundaryFile >> lineIndex;
146 for (
int i = 0; i < 4; i++)
148 boundaryFile >> sammLabel;
156 Info<<
"Boundary file not consistent with vertex file\n" 157 <<
"Samm vertex number " << sammLabel
158 <<
" does not exist\n";
163 boundaryFile >> sammRegion;
164 label patchLabel = patchLabels[sammRegion];
166 boundaryFile >> configNumber;
167 boundaryFile >> patchType;
182 boundary_[patchLabel][nPatchFaces[patchLabel]]
183 = face(pointLabelsTri);
187 boundary_[patchLabel][nPatchFaces[patchLabel]]
192 nPatchFaces[patchLabel]++;
195 forAll(boundary_, patchLabel)
197 word patchType = patchTypes_[patchLabel];
199 if (patchType ==
"SYMP")
201 patchTypes_[patchLabel] = symmetryPolyPatch::typeName;
203 else if (patchType ==
"WALL")
205 patchTypes_[patchLabel] = wallPolyPatch::typeName;
207 else if (patchType ==
"CYCL")
211 patchTypes_[patchLabel] = oldCyclicPolyPatch::typeName;
215 patchTypes_[patchLabel] = polyPatch::typeName;
218 Info<<
"Foam patch " << patchLabel
219 <<
" is of type " << patchTypes_[patchLabel]
220 <<
" with name " << patchNames_[patchLabel] <<
endl;
226 <<
"No boundary faces in file " 248 if (patchDicts.set(
patchi))
251 dict.readIfPresent(
"type", patchTypes_[
patchi]);
252 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.
PtrList< dictionary > patchDicts