34bool Foam::blockMesh::checkDegenerate()
const
38 for (
const block& blk : blocks)
40 const cellShape& shape = blk.blockShape();
46 for (label edgei = 0; edgei < shape.nEdges(); ++edgei)
48 edge
e(shape.edge(edgei));
62void Foam::blockMesh::check
75 for (label cej=cei+1; cej<edges_.size(); cej++)
77 if (edges_[cei].compare(edges_[cej]) != 0)
79 Info<<
" Curved edge ";
81 Info<<
" is a duplicate of curved edge "
82 << edges_[cei] <<
endl;
102 for (
const edge& blkEdge : blk.blockShape().edges())
104 found = curvEdge.compare(blkEdge) != 0;
112 Info<<
" Curved edge ";
114 Info<<
" does not correspond to a block edge." <<
endl;
124 for (label cfj=cfi+1; cfj<faces_.size(); cfj++)
126 if (faces_[cfi].compare(faces_[cfj]) != 0)
128 Info<<
" Curved face ";
130 Info<<
" is a duplicate of curved face ";
142 const face& cf = cface.vertices();
148 const label bi = cf[0];
149 const label fi = cf[1];
153 bi >= 0 && bi <
blocks.size()
154 && fi >= 0 && fi <
blocks[bi].blockShape().nFaces()
160 for (
const face& bf : faces)
162 found = cface.compare(bf) != 0;
169 Info<<
" Curved face ";
171 Info<<
" does not correspond to a block face." <<
endl;
181 label nBoundaryFaces = 0;
184 nBoundaryFaces +=
c.nFaces();
186 nBoundaryFaces -= 2*bm.nInternalFaces();
188 label nDefinedBoundaryFaces = 0;
191 nDefinedBoundaryFaces +=
pp.
size();
198 <<
tab <<
tab <<
"Number of internal faces : "
199 << bm.nInternalFaces() <<
nl
200 <<
tab <<
tab <<
"Number of boundary faces : "
201 << nBoundaryFaces <<
nl
202 <<
tab <<
tab <<
"Number of defined boundary faces : "
203 << nDefinedBoundaryFaces <<
nl
204 <<
tab <<
tab <<
"Number of undefined boundary faces : "
205 << nBoundaryFaces - nDefinedBoundaryFaces <<
nl;
207 if ((nBoundaryFaces - nDefinedBoundaryFaces) > 0)
210 <<
"(Warning : only leave undefined the front and back planes "
211 <<
"of 2D planar geometries!)" <<
endl;
214 Info<<
tab <<
"Checking patch -> block consistency" <<
endl;
222 const face& patchFace =
pp[patchFacei];
224 bool patchFaceOK =
false;
228 for (
const label cellFacei : cellFaces)
230 const face& cellFace = faces[cellFacei];
232 if (patchFace == cellFace)
239 patchFace.areaNormal(
points)
240 & cellFace.areaNormal(
points)
245 <<
"Face " << patchFacei
246 <<
" of patch " <<
pp.index()
247 <<
" (" <<
pp.name() <<
')'
260 <<
"Face " << patchFacei
261 <<
" of patch " <<
pp.index()
262 <<
" (" <<
pp.name() <<
')'
263 <<
" does not match any block faces" <<
endl;
280 Info.stream().setf(ios_base::left);
282 Info<<
setw(20) <<
"patch" <<
"block/face" <<
nl
283 <<
setw(20) <<
"-----" <<
"----------" <<
nl;
289 label meshFacei =
pp.start();
293 const label celli = own[meshFacei];
294 const label cellFacei =
cells[celli].
find(meshFacei);
299 << celli <<
' ' << cellFacei
307 Info<<
setw(20) <<
"-----" <<
"----------" <<
nl
314 <<
"Block mesh topology incorrect, stopping mesh generation!"
Istream and Ostream manipulators taking arguments.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
label size() const noexcept
The number of elements in the list.
label find(const T &val) const
Find index of the first occurrence of the value.
Define a curved edge that is parameterized for 0<lambda<1 between the start/end points.
PtrList< block > blockList
The list of blocks is stored as a PtrList.
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
A cell is defined as a list of faces with extra functionality.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
A face is a list of labels corresponding to mesh vertices.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar c
Speed of light in a vacuum.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< face > faceList
List of faces.
Omanip< int > setw(const int i)
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< cell > cellList
List of cell.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
PtrList< block > blockList
A PtrList of blocks.
constexpr char nl
The newline '\n' character (0x0a).
constexpr char tab
The tab '\t' character(0x09).
#define forAll(list, i)
Loop across all elements in list.