30 void Foam::blockMesh::checkBlockMesh(
const polyMesh& bm)
const 34 Info<< nl <<
"Check topology" <<
endl;
44 label nBoundaryFaces = 0;
47 nBoundaryFaces += cells[celli].nFaces();
50 nBoundaryFaces -= 2*bm.nInternalFaces();
52 label nDefinedBoundaryFaces = 0;
55 nDefinedBoundaryFaces += patches[
patchi].size();
61 Info<< nl <<
tab <<
"Basic statistics" << nl
62 <<
tab <<
tab <<
"Number of internal faces : " 63 << bm.nInternalFaces() << nl
64 <<
tab <<
tab <<
"Number of boundary faces : " 65 << nBoundaryFaces << nl
66 <<
tab <<
tab <<
"Number of defined boundary faces : " 67 << nDefinedBoundaryFaces << nl
68 <<
tab <<
tab <<
"Number of undefined boundary faces : " 69 << nBoundaryFaces - nDefinedBoundaryFaces <<
nl;
71 if ((nBoundaryFaces - nDefinedBoundaryFaces) > 0)
74 <<
"(Warning : only leave undefined the front and back planes " 75 <<
"of 2D planar geometries!)" <<
endl;
78 Info<<
tab <<
"Checking patch -> block consistency" <<
endl;
88 const face& patchFace = Patch[patchFacei];
89 bool patchFaceOK =
false;
93 const labelList& cellFaces = cells[celli];
95 forAll(cellFaces, cellFacei)
97 if (patchFace == faces[cellFaces[cellFacei]])
104 patchFace.normal(points)
105 & faces[cellFaces[cellFacei]].normal(points)
110 <<
"Face " << patchFacei
112 <<
" (" << patches[
patchi].name() <<
")" 125 <<
"Face " << patchFacei
127 <<
" (" << patches[
patchi].name() <<
")" 128 <<
" does not match any block faces" <<
endl;
143 <<
"Block mesh topology incorrect, stopping mesh generation!" 149 bool Foam::blockMesh::blockLabelsOK
151 const label blockLabel,
153 const cellShape& blockShape
158 forAll(blockShape, blockI)
160 if (blockShape[blockI] < 0)
165 <<
"out-of-range point label " << blockShape[blockI]
167 <<
") in block " << blockLabel <<
endl;
169 else if (blockShape[blockI] >= points.size())
174 <<
"out-of-range point label " << blockShape[blockI]
175 <<
" (max = " << points.size() - 1
176 <<
") in block " << blockLabel <<
endl;
184 bool Foam::blockMesh::patchLabelsOK
186 const label patchLabel,
204 <<
"out-of-range point label " << f[fp]
206 <<
") on patch " << patchLabel
207 <<
", face " << facei <<
endl;
209 else if (f[fp] >= points.size())
214 <<
"out-of-range point label " << f[fp]
215 <<
" (max = " << points.size() - 1
216 <<
") on patch " << patchLabel
217 <<
", face " << facei <<
endl;
PtrList< polyPatch > polyPatchList
container classes for polyPatch
#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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
List< label > labelList
A List of labels.
#define WarningInFunction
Report a warning using Foam::Warning.
List< cell > cellList
list of cells