56 void Foam::cellAspectRatio::calcAspectRatio()
63 const polyMesh&
mesh = mesh_;
77 const point& cc = cellCentres[celli];
78 const cell& cFaces =
cells[celli];
83 for (
const label facei : cFaces)
85 const vector&
n = faceAreas[facei];
99 const point& fc = faceCentres[facei];
102 sumA /= cFaces.size();
105 if (sumA > ROOTVSMALL)
108 const scalar length = cellVolumes[celli]/sumA;
110 if (length > ROOTVSMALL)
116 aRatio[celli] = 2.0*maxMag/length;
124 <<
" max:" <<
gMax(aRatio) <<
" average:" <<
gAverage(aRatio)
List< cell > cellList
List of cell.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Type gMin(const FieldField< Field, Type > &f)
(Rough approximation of) cell aspect ratio
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const cellList & cells() const
#define forAll(list, i)
Loop across all elements in list.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
vectorField pointField
pointField is a vectorField.
void setSize(const label n)
Alias for resize()
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const vectorField & cellCentres() const
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
defineTypeNameAndDebug(combustionModel, 0)
const vectorField & faceCentres() const
vector point
Point is a vector.
label nCells() const noexcept
Number of mesh cells.
Type gAverage(const FieldField< Field, Type > &f)
const vectorField & faceAreas() const
Field< vector > vectorField
Specialisation of Field<T> for vector.
Mesh consisting of general polyhedral cells.
virtual ~cellAspectRatio()
Destructor.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
cellAspectRatio(const polyMesh &)
Construct given an polyMesh.
const scalarField & cellVolumes() const
#define InfoInFunction
Report an information message using Foam::Info.
static constexpr const zero Zero
Global zero (0)