34 void Foam::primitiveMesh::calcCellCentresAndVols()
const
38 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
39 <<
"Calculating cell centres and cell volumes"
45 if (cellCentresPtr_ || cellVolumesPtr_)
47 FatalErrorIn(
"primitiveMesh::calcCellCentresAndVols() const")
48 <<
"Cell centres or cell volumes already calculated"
65 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
66 <<
"Finished calculating cell centres and cell volumes"
72 void Foam::primitiveMesh::makeCellCentresAndVols
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 max(fAreas[facei] & (fCtrs[facei] - cEst[own[facei]]), VSMALL);
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 max(fAreas[facei] & (cEst[nei[facei]] - fCtrs[facei]), VSMALL);
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;
143 cellVols *= (1.0/3.0);
151 if (!cellCentresPtr_)
153 calcCellCentresAndVols();
156 return *cellCentresPtr_;
162 if (!cellVolumesPtr_)
164 calcCellCentresAndVols();
167 return *cellVolumesPtr_;