41 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
42 <<
"Calculating cell centres and cell volumes"
48 if (cellCentresPtr_ || cellVolumesPtr_)
51 <<
"Cell centres or cell volumes already calculated"
68 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
69 <<
"Finished calculating cell centres and cell volumes"
105 cEst[own[facei]] += solveVector(fCtrs[facei]);
106 ++nCellFaces[own[facei]];
111 cEst[nei[facei]] += solveVector(fCtrs[facei]);
112 ++nCellFaces[nei[facei]];
117 cEst[celli] /= nCellFaces[celli];
122 const solveVector fc(fCtrs[facei]);
123 const solveVector fA(fAreas[facei]);
126 solveScalar pyr3Vol =
127 fA & (fc - cEst[own[facei]]);
130 solveVector pc = (3.0/4.0)*fc + (1.0/4.0)*cEst[own[facei]];
133 cellCtrs[own[facei]] += pyr3Vol*pc;
141 const solveVector fc(fCtrs[facei]);
142 const solveVector fA(fAreas[facei]);
145 solveScalar pyr3Vol =
146 fA & (cEst[nei[facei]] - fc);
149 solveVector pc = (3.0/4.0)*fc + (1.0/4.0)*cEst[nei[facei]];
152 cellCtrs[nei[facei]] += pyr3Vol*pc;
166 cellCtrs[celli] = cEst[celli];
178 if (!cellCentresPtr_)
180 calcCellCentresAndVols();
183 return *cellCentresPtr_;
189 if (!cellVolumesPtr_)
191 calcCellCentresAndVols();
194 return *cellVolumesPtr_;