48 Pout<<
"bool primitiveMesh::checkMeshMotion("
49 <<
"const pointField& newPoints, const bool report) const: "
50 <<
"checking mesh motion" <<
endl;
63 makeFaceCentresAndAreas(newPoints, fCtrs, fAreas);
69 makeCellCentresAndVols(fCtrs, fAreas, cellCtrs, cellVols);
71 scalar minVolume = GREAT;
76 if (cellVols[cellI] < VSMALL)
80 Pout<<
"Zero or negative cell volume detected for cell "
81 << cellI <<
". Volume = " << cellVols[cellI] <<
endl;
87 minVolume =
min(minVolume, cellVols[cellI]);
94 Pout<<
"Zero or negative cell volume in mesh motion in " << nNegVols
95 <<
" cells. Min volume: " << minVolume <<
endl;
101 Pout<<
"Min volume = " << minVolume
102 <<
". Total volume = " <<
sum(cellVols)
103 <<
". Cell volumes OK." <<
endl;
109 scalar minArea = GREAT;
111 label nPyrErrors = 0;
112 label nDotProductErrors = 0;
116 const scalar a =
Foam::mag(fAreas[faceI]);
122 if (isInternalFace(faceI))
124 Pout<<
"Zero or negative face area detected for "
125 <<
"internal face "<< faceI <<
" between cells "
126 << own[faceI] <<
" and " << nei[faceI]
127 <<
". Face area magnitude = " << a <<
endl;
131 Pout<<
"Zero or negative face area detected for "
132 <<
"boundary face " << faceI <<
" next to cell "
133 << own[faceI] <<
". Face area magnitude = "
141 minArea =
min(minArea, a);
151 Pout<<
"Negative pyramid volume: " << -pyrVol
152 <<
" for face " << faceI <<
" " << f[faceI]
153 <<
" and owner cell: " << own[faceI] <<
endl
154 <<
"Owner cell vertex labels: "
155 <<
cells()[own[faceI]].labels(f)
162 if (isInternalFace(faceI))
176 Pout<<
"Negative pyramid volume: " << pyrVol
177 <<
" for face " << faceI <<
" " << f[faceI]
178 <<
" and neighbour cell: " << nei[faceI] <<
nl
179 <<
"Neighbour cell vertex labels: "
180 <<
cells()[nei[faceI]].labels(f)
187 const vector d = cellCtrs[nei[faceI]] - cellCtrs[own[faceI]];
188 const vector& s = fAreas[faceI];
189 scalar dDotS = (d & s)/(
mag(d)*
mag(s) + VSMALL);
192 if (dDotS < SMALL && nDotProductErrors == 0)
197 "primitiveMesh::checkMeshMotion"
198 "(const pointField& newPoints, const bool report) const"
199 ) <<
"Severe non-orthogonality in mesh motion for face "
201 <<
" between cells " << own[faceI] <<
" and " << nei[faceI]
216 "primitiveMesh::checkMeshMotion"
217 "(const pointField& newPoints, const bool report) const"
218 ) <<
"Zero or negative face area in mesh motion in " << nNegAreas
219 <<
" faces. Min area: " << minArea <<
endl;
225 Pout<<
"Min area = " << minArea
226 <<
". Face areas OK." <<
endl;
232 Pout<<
"Detected " << nPyrErrors
233 <<
" negative pyramid volume in mesh motion" <<
endl;
241 Pout<<
"Pyramid volumes OK." <<
endl;
245 if (nDotProductErrors > 0)
247 Pout<<
"Detected " << nDotProductErrors
248 <<
" in non-orthogonality in mesh motion." <<
endl;
256 Pout<<
"Non-orthogonality check OK." <<
endl;
260 if (!error && (debug || report))
262 Pout <<
"Mesh motion check OK." <<
endl;