44 vector Cpf = fCtrs[facei] - ownCc;
50 - ((fAreas[facei] & Cpf)/((fAreas[facei] & d) + rootVSmall))*d;
56 scalar fd = 0.2*
mag(d) + rootVSmall;
60 fd =
max(fd,
mag(svHat & (p[f[
pi]] - fCtrs[facei])));
79 vector Cpf = fCtrs[facei] - ownCc;
81 vector normal = fAreas[facei];
82 normal /=
mag(normal) + rootVSmall;
83 vector d = normal*(normal & Cpf);
89 - ((fAreas[facei] & Cpf)/((fAreas[facei] & d) + rootVSmall))*d;
95 scalar fd = 0.4*
mag(d) + rootVSmall;
99 fd =
max(fd,
mag(svHat & (p[f[
pi]] - fCtrs[facei])));
116 return (d & s)/(
mag(d)*
mag(s) + rootVSmall);
138 ortho[facei] = faceOrthogonality
167 skew[facei] = faceSkewness
175 cellCtrs[own[facei]],
186 skew[facei] = boundaryFaceSkewness
263 sumClosed[own[facei]] += areas[facei];
264 sumMagClosed[own[facei]] +=
cmptMag(areas[facei]);
270 sumClosed[nei[facei]] -= areas[facei];
271 sumMagClosed[nei[facei]] +=
cmptMag(areas[facei]);
276 for (
direction dir = 0; dir < vector::nComponents; dir++)
291 scalar maxOpenness = 0;
293 for (
direction cmpt=0; cmpt<vector::nComponents; cmpt++)
298 mag(sumClosed[celli][cmpt])
299 /(sumMagClosed[celli][cmpt] + rootVSmall)
302 openness[celli] = maxOpenness;
306 scalar minCmpt = vGreat;
307 scalar maxCmpt = -vGreat;
308 for (
direction dir = 0; dir < vector::nComponents; dir++)
312 minCmpt =
min(minCmpt, sumMagClosed[celli][dir]);
313 maxCmpt =
max(maxCmpt, sumMagClosed[celli][dir]);
317 scalar aspectRatio = maxCmpt/(minCmpt + rootVSmall);
320 scalar v =
max(rootVSmall, vols[celli]);
325 1.0/6.0*
cmptSum(sumMagClosed[celli])/
pow(v, 2.0/3.0)
329 aratio[celli] = aspectRatio;
345 faceNormals /=
mag(faceNormals) + rootVSmall;
353 const face&
f = fcs[facei];
357 scalar magEPrev =
mag(ePrev);
358 ePrev /= magEPrev + rootVSmall;
360 scalar maxEdgeSin = 0.0;
368 vector e10(p[f[fp1]] - p[f[fp0]]);
369 scalar magE10 =
mag(e10);
370 e10 /= magE10 + rootVSmall;
372 if (magEPrev > small && magE10 > small)
374 vector edgeNormal = ePrev ^ e10;
375 scalar magEdgeNormal =
mag(edgeNormal);
377 if (magEdgeNormal < maxSin)
384 edgeNormal /= magEdgeNormal;
386 if ((edgeNormal & faceNormals[facei]) < small)
388 maxEdgeSin =
max(maxEdgeSin, magEdgeNormal);
397 faceAngles[facei] = maxEdgeSin;
424 const face&
f = fcs[facei];
426 if (f.
size() > 3 && magAreas[facei] > rootVSmall)
428 const point& fc = fCtrs[facei];
437 const point& thisPoint = p[f[fp]];
438 const point& nextPoint = p[f.nextLabel(fp)];
441 vector n = 0.5*((nextPoint - thisPoint)^(fc - thisPoint));
445 faceFlatness[facei] = magAreas[facei]/(sumA + rootVSmall);
449 return tfaceFlatness;
464 for (
direction dir = 0; dir < vector::nComponents; dir++)
483 cellDeterminant = 1.0;
494 label nInternalFaces = 0;
498 if (internalOrCoupledFace[curFaces[i]])
500 avgArea +=
mag(faceAreas[curFaces[i]]);
506 if (nInternalFaces == 0)
508 cellDeterminant[celli] = 0;
512 avgArea /= nInternalFaces;
518 if (internalOrCoupledFace[curFaces[i]])
520 areaTensor +=
sqr(faceAreas[curFaces[i]]/avgArea);
542 cellDeterminant[celli] =
mag(
det(areaTensor));
547 return tcellDeterminant;
#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.
A face is a list of labels corresponding to mesh vertices.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
label nInternalFaces() const
dimensionedTensor skew(const dimensionedTensor &dt)
Cell-face mesh analysis engine.
T & ref() const
Return non-const reference or generate a fatal error.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
Cmpt cmptSum(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
const cellList & cells() const
dimensionedScalar det(const dimensionedSphericalTensor &dt)
T & first()
Return the first element of the list.
const dimensionedScalar c
Speed of light in a vacuum.
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
pyramid< point, const point &, const face & > pyramidPointFaceRef
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
volScalarField scalarField(fieldObject, mesh)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
void setSize(const label)
Reset size of List.
virtual const faceList & faces() const =0
Return faces.
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
T & last()
Return the last element of the list.