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"
104 cEst[own[facei]] += solveVector(fCtrs[facei]);
105 ++nCellFaces[own[facei]];
110 cEst[nei[facei]] += solveVector(fCtrs[facei]);
111 ++nCellFaces[nei[facei]];
116 cEst[celli] /= nCellFaces[celli];
121 const solveVector fc(fCtrs[facei]);
122 const solveVector fA(fAreas[facei]);
125 solveScalar pyr3Vol =
126 fA & (fc - cEst[own[facei]]);
129 solveVector pc = (3.0/4.0)*fc + (1.0/4.0)*cEst[own[facei]];
132 cellCtrs[own[facei]] += pyr3Vol*pc;
140 const solveVector fc(fCtrs[facei]);
141 const solveVector fA(fAreas[facei]);
144 solveScalar pyr3Vol =
145 fA & (cEst[nei[facei]] - fc);
148 solveVector pc = (3.0/4.0)*fc + (1.0/4.0)*cEst[nei[facei]];
151 cellCtrs[nei[facei]] += pyr3Vol*pc;
165 cellCtrs[celli] = cEst[celli];
177 if (!cellCentresPtr_)
179 calcCellCentresAndVols();
182 return *cellCentresPtr_;
188 if (!cellVolumesPtr_)
190 calcCellCentresAndVols();
193 return *cellVolumesPtr_;