34 bool 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));
62 void Foam::blockMesh::check
65 const dictionary&
dict 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;
96 for (
const blockEdge& curvEdge : edges_)
100 for (
const block& blk : blocks)
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 ";
140 for (
const blockFace& cface : faces_)
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;
182 for (
const cell&
c :
cells)
184 nBoundaryFaces +=
c.nFaces();
186 nBoundaryFaces -= 2*bm.nInternalFaces();
188 label nDefinedBoundaryFaces = 0;
189 for (
const polyPatch& pp :
patches)
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;
218 for (
const polyPatch& pp :
patches)
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;
282 Info<<
setw(20) <<
"patch" <<
"block/face" <<
nl 283 <<
setw(20) <<
"-----" <<
"----------" <<
nl;
285 for (
const polyPatch& pp :
patches)
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!"
errorManipArg< error, int > exit(error &err, const int errNo=1)
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
constexpr char nl
The newline '\n' character (0x0a)
List< face > faceList
A List of faces.
PtrList< block > blockList
A PtrList of blocks.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Begin list [isseparator].
constexpr char tab
The tab '\t' character(0x09)
#define forAll(list, i)
Loop across all elements in list.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
PtrList< block > blockList
The list of blocks is stored as a PtrList.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
OSstream & stream(OSstream *alternative=nullptr)
Return OSstream for output operations. Use the alternative stream for serial-only output if it is a v...
Istream and Ostream manipulators taking arguments.
const dimensionedScalar c
Speed of light in a vacuum.
const polyBoundaryMesh & patches
messageStream Info
Information stream (stdout output on master, null elsewhere)
Omanip< int > setw(const int i)
List< label > labelList
A List of labels.
List< cell > cellList
A List of cells.