56void Foam::cellAspectRatio::calcAspectRatio()
77 const point& cc = cellCentres[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;
127 <<
" max:" <<
limits.max() <<
" average:" << avg
void setSize(label n)
Alias for resize().
const polyMesh & mesh() const noexcept
(Rough approximation of) cell aspect ratio
cellAspectRatio(const polyMesh &)
Construct given an polyMesh.
virtual ~cellAspectRatio()
Destructor.
A cell is defined as a list of faces with extra functionality.
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.
Namespace for handling debugging switches.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
List< cell > cellList
List of cell.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
vectorField pointField
pointField is a vectorField.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.