Go to the documentation of this file.
32 #include "tetPointRef.H"
40 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
41 <<
"Calculating cell centres and cell volumes"
49 FatalErrorIn(
"primitiveMesh::calcCellCentresAndVols() const")
50 <<
"Cell centres or cell volumes already calculated"
67 Pout<<
"primitiveMesh::calcCellCentresAndVols() : "
68 <<
"Finished calculating cell centres and cell volumes"
97 cEst[own[facei]] += fCtrs[facei];
98 nCellFaces[own[facei]] += 1;
103 cEst[nei[facei]] += fCtrs[facei];
104 nCellFaces[nei[facei]] += 1;
109 cEst[celli] /= nCellFaces[celli];
117 const face&
f = allFaces[faceI];
129 scalar tetVol = tpr.
mag();
132 cellCtrs[own[faceI]] += tetVol*tpr.
centre();
149 scalar tetVol = tpr.
mag();
152 cellCtrs[own[faceI]] += tetVol*tpr.
centre();
162 const face&
f = allFaces[faceI];
174 scalar tetVol = tpr.
mag();
177 cellCtrs[nei[faceI]] += tetVol*tpr.
centre();
194 scalar tetVol = tpr.
mag();
197 cellCtrs[nei[faceI]] += tetVol*tpr.
centre();
213 if (!cellCentresPtr_)
215 calcCellCentresAndVols();
218 return *cellCentresPtr_;
224 if (!cellVolumesPtr_)
226 calcCellCentresAndVols();
229 return *cellVolumesPtr_;
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define forAll(list, i)
Loop across all elements in list.
scalarField * cellVolumesPtr_
Cell volumes.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Pre-declare SubField and related Field type.
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
const scalarField & cellVols
errorManip< error > abort(error &err)
const scalarField & cellVolumes() const
const vectorField & cellCentres() const
void makeCellCentresAndVols(const vectorField &fCtrs, const vectorField &fAreas, vectorField &cellCtrs, scalarField &cellVols) const
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const vectorField & faceCentres() const
Point centre() const
Return centre (centroid)
vectorField * cellCentresPtr_
Cell centres.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
scalar mag() const
Return volume.
const vectorField & faceAreas() const