38 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
39 <<
"Calculating cell centres and cell volumes"
45 if (cellCentresPtr_ || cellVolumesPtr_)
48 <<
"Cell centres or cell volumes already calculated"
65 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
66 <<
"Finished calculating cell centres and cell volumes"
95 cEst[own[facei]] += fCtrs[facei];
96 nCellFaces[own[facei]] += 1;
101 cEst[nei[facei]] += fCtrs[facei];
102 nCellFaces[nei[facei]] += 1;
107 cEst[celli] /= nCellFaces[celli];
114 fAreas[facei] & (fCtrs[facei] - cEst[own[facei]]);
117 vector pc = (3.0/4.0)*fCtrs[facei] + (1.0/4.0)*cEst[own[facei]];
120 cellCtrs[own[facei]] += pyr3Vol*pc;
130 fAreas[facei] & (cEst[nei[facei]] - fCtrs[facei]);
133 vector pc = (3.0/4.0)*fCtrs[facei] + (1.0/4.0)*cEst[nei[facei]];
136 cellCtrs[nei[facei]] += pyr3Vol*pc;
150 cellCtrs[celli] = cEst[celli];
162 if (!cellCentresPtr_)
164 calcCellCentresAndVols();
167 return *cellCentresPtr_;
173 if (!cellVolumesPtr_)
175 calcCellCentresAndVols();
178 return *cellVolumesPtr_;
#define forAll(list, i)
Loop across all elements in list.
const vectorField & faceCentres() const
const scalarField & cellVolumes() const
void makeCellCentresAndVols(const vectorField &fCtrs, const vectorField &fAreas, vectorField &cellCtrs, scalarField &cellVols) const
const vectorField & cellCentres() const
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
const vectorField & faceAreas() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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 > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
prefixOSstream Pout(cout, "Pout")
const scalarField & cellVols