Go to the documentation of this file.
30 #include "primitiveMesh.H"
45 Pout<<
"bool primitiveMesh::checkMeshMotion("
46 <<
"const pointField& newPoints, const bool report) const: "
47 <<
"checking mesh motion" <<
endl;
60 makeFaceCentresAndAreas(newPoints, fCtrs, fAreas);
66 makeCellCentresAndVols(fCtrs, fAreas, cellCtrs,
cellVols);
68 scalar minVolume = GREAT;
77 Pout<<
"Zero or negative cell volume detected for cell "
91 Pout<<
"Zero or negative cell volume in mesh motion in " << nNegVols
92 <<
" cells. Min volume: " << minVolume <<
endl;
98 Pout<<
"Min volume = " << minVolume
100 <<
". Cell volumes OK." <<
endl;
106 scalar minArea = GREAT;
108 label nPyrErrors = 0;
109 label nDotProductErrors = 0;
113 const scalar a =
Foam::mag(fAreas[faceI]);
119 if (isInternalFace(faceI))
121 Pout<<
"Zero or negative face area detected for "
122 <<
"internal face "<< faceI <<
" between cells "
123 << own[faceI] <<
" and " << nei[faceI]
124 <<
". Face area magnitude = " << a <<
endl;
128 Pout<<
"Zero or negative face area detected for "
129 <<
"boundary face " << faceI <<
" next to cell "
130 << own[faceI] <<
". Face area magnitude = "
138 minArea =
min(minArea, a);
148 Pout<<
"Negative pyramid volume: " << -pyrVol
149 <<
" for face " << faceI <<
" " <<
f[faceI]
150 <<
" and owner cell: " << own[faceI] <<
endl
151 <<
"Owner cell vertex labels: "
152 <<
cells()[own[faceI]].labels(
f)
159 if (isInternalFace(faceI))
173 Pout<<
"Negative pyramid volume: " << pyrVol
174 <<
" for face " << faceI <<
" " <<
f[faceI]
175 <<
" and neighbour cell: " << nei[faceI] <<
nl
176 <<
"Neighbour cell vertex labels: "
177 <<
cells()[nei[faceI]].labels(
f)
184 const vector d = cellCtrs[nei[faceI]] - cellCtrs[own[faceI]];
185 const vector&
s = fAreas[faceI];
186 scalar dDotS = (d &
s)/(
mag(d)*
mag(
s) + VSMALL);
189 if (dDotS < SMALL && nDotProductErrors == 0)
194 "primitiveMesh::checkMeshMotion"
195 "(const pointField& newPoints, const bool report) const"
196 ) <<
"Severe non-orthogonality in mesh motion for face "
198 <<
" between cells " << own[faceI] <<
" and " << nei[faceI]
214 "primitiveMesh::checkMeshMotion"
215 "(const pointField& newPoints, const bool report) const"
216 ) <<
"Zero or negative face area in mesh motion in " << nNegAreas
217 <<
" faces. Min area: " << minArea <<
endl;
223 Pout<<
"Min area = " << minArea
224 <<
". Face areas OK." <<
endl;
230 Pout<<
"Detected " << nPyrErrors
231 <<
" negative pyramid volume in mesh motion" <<
endl;
239 Pout<<
"Pyramid volumes OK." <<
endl;
243 if (nDotProductErrors > 0)
245 Pout<<
"Detected " << nDotProductErrors
246 <<
" in non-orthogonality in mesh motion." <<
endl;
254 Pout<<
"Non-orthogonality check OK." <<
endl;
258 if (!
error && (debug || report))
260 Pout <<
"Mesh motion check OK." <<
endl;
#define forAll(list, i)
Loop across all elements in list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
const scalarField & cellVols
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar acos(const dimensionedScalar &ds)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
#define WarningIn(functionName)
Report a warning using Foam::Warning.
bool checkMeshMotion(const pointField &newPoints, const bool report=false) const
Check mesh motion for correctness given motion points.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
pyramid< point, const point &, const face & > pyramidPointFaceRef
Class to handle errors and exceptions in a simple, consistent stream-based manner.