42 Pout<<
"primitiveMesh::calcFaceCentresAndAreas() : " 43 <<
"Calculating face centres and face areas" 49 if (faceCentresPtr_ || faceAreasPtr_)
52 <<
"Face centres or face areas already calculated" 66 Pout<<
"primitiveMesh::calcFaceCentresAndAreas() : " 67 <<
"Finished calculating face centres and face areas" 91 fCtrs[facei] = (1.0/3.0)*(p[f[0]] + p[f[1]] + p[f[2]]);
92 fAreas[facei] = 0.5*((p[f[1]] - p[f[0]])^(p[f[2]] - p[f[0]]));
100 point fCentre = p[f[0]];
110 const point& nextPoint = p[f[(
pi + 1) % nPoints]];
112 vector c = p[f[
pi]] + nextPoint + fCentre;
113 vector n = (nextPoint - p[f[
pi]])^(fCentre - p[f[
pi]]);
123 if (sumA < ROOTVSMALL)
125 fCtrs[facei] = fCentre;
126 fAreas[facei] =
Zero;
130 fCtrs[facei] = (1.0/3.0)*sumAc/sumA;
131 fAreas[facei] = 0.5*sumN;
142 if (!faceCentresPtr_)
147 return *faceCentresPtr_;
158 return *faceAreasPtr_;
#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.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual const pointField & points() const =0
Return mesh points.
void makeFaceCentresAndAreas(const pointField &p, vectorField &fCtrs, vectorField &fAreas) const
errorManip< error > abort(error &err)
const vectorField & faceCentres() const
prefixOSstream Pout(cout, "Pout")
void calcFaceCentresAndAreas() const
Calculate face centres and areas.
const vectorField & faceAreas() const
virtual const faceList & faces() const =0
Return faces.
const dimensionedScalar c
Speed of light in a vacuum.
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.