95 const auto&
f = fs[facei];
103 fCtrs[facei] = tri.
centre();
124 (nextPoint - thisPoint)^(fCentre - thisPoint);
134 solveScalar sumAn(0);
142 const solveVector c = thisPoint + nextPoint + fCentre;
144 (nextPoint - thisPoint)^(fCentre - thisPoint);
146 const scalar an = a & sumAHat;
155 if (sumAn > ROOTVSMALL)
157 fCtrs[facei] = (1.0/3.0)*sumAnc/sumAn;
161 fCtrs[facei] = fCentre;
163 fAreas[facei] = 0.5*sumA;
171Foam::stabilisedFvGeometryScheme::stabilisedFvGeometryScheme
192 Pout<<
"stabilisedFvGeometryScheme::movePoints() : "
193 <<
"recalculating primitiveMesh centres" <<
endl;
198 !mesh_.hasCellCentres()
199 && !mesh_.hasFaceCentres()
200 && !mesh_.hasCellVolumes()
201 && !mesh_.hasFaceAreas()
207 makeFaceCentresAndAreas
229 std::move(faceCentres),
230 std::move(faceAreas),
231 std::move(cellCentres),
232 std::move(cellVolumes)
241 const refPtr<pointField>& oldPoints,
248 makeFaceCentresAndAreas
constexpr scalar pi(M_PI)
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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.
const fvMesh & mesh_
Hold reference to mesh.
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.
void resetGeometry(pointField &&faceCentres, pointField &&faceAreas, pointField &&cellCentres, scalarField &&cellVolumes)
Reset the local geometry.
A class for managing references or pointers (no reference counting).
Geometry calculation scheme that implements face geometry calculation using normal-component-of-area ...
virtual bool updateGeom(const pointField &points, const refPtr< pointField > &oldPoints, pointField &faceCentres, vectorField &faceAreas, pointField &cellCentres, scalarField &cellVolumes) const
Calculate geometry quantities using mesh topology and provided points. If oldPoints provided only doe...
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.
static vector areaNormal(const Point &p0, const Point &p1, const Point &p2)
The area normal for a triangle defined by three points (right-hand rule). Magnitude equal to area of ...
static Point centre(const Point &p0, const Point &p1, const Point &p2)
The centre (centroid) of three points.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Namespace for handling debugging switches.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
static Foam::doubleVector pointsAverage(const UList< point > &points, const labelUList &pointLabels)
List< face > faceList
List of faces.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Vector< double > doubleVector
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
triangle< point, const point & > triPointRef
A triangle using referred points.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
Vector< solveScalar > solveVector
labelList pointLabels(nPoints, -1)
#define forAll(list, i)
Loop across all elements in list.