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;
123 cellVols[own[facei]] += pyr3Vol;
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;
139 cellVols[nei[facei]] += pyr3Vol;
144 if (
mag(cellVols[celli]) > vSmall)
146 cellCtrs[celli] /= cellVols[celli];
150 cellCtrs[celli] = cEst[celli];
154 cellVols *= (1.0/3.0);
162 if (!cellCentresPtr_)
167 return *cellCentresPtr_;
173 if (!cellVolumesPtr_)
178 return *cellVolumesPtr_;
#define forAll(list, i)
Loop across all elements in list.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
void makeCellCentresAndVols(const vectorField &fCtrs, const vectorField &fAreas, vectorField &cellCtrs, scalarField &cellVols) const
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
const vectorField & faceCentres() const
prefixOSstream Pout(cout, "Pout")
const vectorField & faceAreas() const
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
const scalarField & cellVolumes() const