42 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
43 <<
"Calculating cell centres and volumes"
48 if (cellCentresPtr_ || cellVolumesPtr_)
51 <<
"Cell centres or volumes already calculated"
56 cellCentresPtr_ = std::make_unique<vectorField>(
nCells(),
Zero);
57 auto& cellCtrs = *cellCentresPtr_;
60 cellVolumesPtr_ = std::make_unique<scalarField>(
nCells(),
Zero);
75 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
76 <<
"Finished calculating cell centres and volumes"
89 const_cast<primitiveMesh&
>(*this).updateGeom();
92 return *cellCentresPtr_;
101 const_cast<primitiveMesh&
>(*this).updateGeom();
104 return *cellVolumesPtr_;
const vectorField & faceCentres() const
const scalarField & cellVolumes() const
const vectorField & cellCentres() const
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
label nCells() const noexcept
Number of mesh cells.
const vectorField & faceAreas() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Namespace for handling debugging switches.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
const scalarField & cellVols