56void 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)
void setSize(const label n)
Alias for resize()
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
(Rough approximation of) cell aspect ratio
virtual ~cellAspectRatio()
Destructor.
Mesh consisting of general polyhedral cells.
const vectorField & faceCentres() const
const scalarField & cellVolumes() const
const vectorField & cellCentres() const
label nCells() const noexcept
Number of mesh cells.
const vectorField & faceAreas() const
const cellList & cells() const
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define InfoInFunction
Report an information message using Foam::Info.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< cell > cellList
A List of cells.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Type gAverage(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0)
Type gMin(const FieldField< Field, Type > &f)
Type gMax(const FieldField< Field, Type > &f)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.