42 Pout<<
"primitiveMesh::calcFaceCentresAndAreas() : " 43 <<
"Calculating face centres and face areas" 49 if (faceCentresPtr_ || faceAreasPtr_ || magFaceAreasPtr_)
52 <<
"Face centres or face areas already calculated" 69 Pout<<
"primitiveMesh::calcFaceCentresAndAreas() : " 70 <<
"Finished calculating face centres and face areas" 95 fCtrs[facei] = (1.0/3.0)*(p[f[0]] + p[f[1]] + p[f[2]]);
96 fAreas[facei] = 0.5*((p[f[1]] - p[f[0]])^(p[f[2]] - p[f[0]]));
103 point pAvg = p[f[0]];
117 (p[f[f.fcIndex(i)]] - p[f[i]])^(pAvg - p[f[i]]);
132 (p[f[f.fcIndex(i)]] - p[f[i]])^(pAvg - p[f[i]]);
133 const vector c = p[f[i]] + p[f[f.fcIndex(i)]] + pAvg;
135 const scalar an = a & sumAHat;
146 fCtrs[facei] = (1.0/3.0)*sumAnc/sumAn;
152 fAreas[facei] = 0.5*sumA;
155 magfAreas[facei] =
max(
mag(fAreas[facei]), vSmall);
164 if (!faceCentresPtr_)
169 return *faceCentresPtr_;
180 return *faceAreasPtr_;
186 if (!magFaceAreasPtr_)
191 return *magFaceAreasPtr_;
#define forAll(list, i)
Loop across all elements in list.
void makeFaceCentresAndAreas(const pointField &p, vectorField &fCtrs, vectorField &fAreas, scalarField &magfAreas) const
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
#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.
const dimensionedScalar c
Speed of light in a vacuum.
const scalarField & magFaceAreas() const
Form normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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.
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.