70 fCtrs[facei] = (1.0/3.0)*(
p[
f[0]] +
p[
f[1]] +
p[
f[2]]);
71 fAreas[facei] = 0.5*((
p[
f[1]] -
p[
f[0]])^(
p[
f[2]] -
p[
f[0]]));
79 for (label pi = 1; pi <
nPoints; pi++)
89 for (label pi = 0; pi <
nPoints; pi++)
91 const label nextPi(pi ==
nPoints-1 ? 0 : pi+1);
96 (nextPoint - thisPoint)^(fCentre - thisPoint);
106 solveScalar sumAn = 0.0;
108 for (label pi = 0; pi <
nPoints; pi++)
110 const label nextPi(pi ==
nPoints-1 ? 0 : pi+1);
114 const solveVector c = thisPoint + nextPoint + fCentre;
116 (nextPoint - thisPoint)^(fCentre - thisPoint);
118 const scalar an = a & sumAHat;
127 if (sumAn > ROOTVSMALL)
129 fCtrs[facei] = (1.0/3.0)*sumAnc/sumAn;
133 fCtrs[facei] = fCentre;
135 fAreas[facei] = 0.5*sumA;
164 Pout<<
"stabilisedFvGeometryScheme::movePoints() : "
165 <<
"recalculating primitiveMesh centres" <<
endl;
170 !mesh_.hasCellCentres()
171 && !mesh_.hasFaceCentres()
172 && !mesh_.hasCellVolumes()
173 && !mesh_.hasFaceAreas()
179 makeFaceCentresAndAreas
201 std::move(faceCentres),
202 std::move(faceAreas),
203 std::move(cellCentres),
204 std::move(cellVolumes)
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void size(const label n)
Older name for setAddressableSize.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Default geometry calculation scheme. Slight stabilisation for bad meshes.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base class for geometry calculation schemes.
virtual void movePoints()
Update basic geometric properties from provided points.
const fvMesh & mesh() const
Return mesh reference.
Mesh data needed to do the Finite Volume discretisation.
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
void resetGeometry(pointField &&faceCentres, pointField &&faceAreas, pointField &&cellCentres, scalarField &&cellVolumes)
Reset the local geometry.
Geometry calculation scheme that implements face geometry calculation using normal-component-of-area ...
static void makeFaceCentresAndAreas(const polyMesh &mesh, const pointField &p, vectorField &fCtrs, vectorField &fAreas)
Calculate face area and centre weighted using pyramid height.
virtual void movePoints()
Do what is necessary if the mesh has moved.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Vector< solveScalar > solveVector
#define forAll(list, i)
Loop across all elements in list.