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]]));
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]), rootVSmall);
164 if (!faceCentresPtr_)
166 calcFaceCentresAndAreas();
169 return *faceCentresPtr_;
177 calcFaceCentresAndAreas();
180 return *faceAreasPtr_;
186 if (!magFaceAreasPtr_)
188 calcFaceCentresAndAreas();
191 return *magFaceAreasPtr_;
#define forAll(list, i)
Loop across all elements in list.
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.
const vectorField & faceCentres() const
const scalarField & magFaceAreas() const
virtual const pointField & points() const =0
Return mesh points.
const vectorField & faceAreas() const
void calcFaceCentresAndAreas() const
Calculate face centres and areas.
void makeFaceCentresAndAreas(const pointField &p, vectorField &fCtrs, vectorField &fAreas, scalarField &magfAreas) const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar c
Speed of light in a vacuum.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Form normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Field< vector > vectorField
Specialisation of Field<T> for vector.
prefixOSstream Pout(cout, "Pout")