48 pVectorsPtr_(nullptr),
64 void Foam::leastSquaresFaVectors::makeLeastSquaresVectors()
const 67 <<
"Constructing finite area (invDist) least square gradient vectors" 75 mesh().pointsInstance(),
84 auto& lsP = *pVectorsPtr_;
91 mesh().pointsInstance(),
100 auto& lsN = *nVectorsPtr_;
112 const scalar minLenSqr(SMALL*SMALL);
116 const label own = owner[facei];
117 const label nei = neighbour[facei];
122 const scalar magSqrDist = d.magSqr();
123 if (magSqrDist >= minLenSqr)
132 for (
const auto& patchLsP : lsP.boundaryField())
134 const faPatch&
p = patchLsP.patch();
142 const vector& d = pd[patchFacei];
145 const scalar magSqrDist = d.
magSqr();
146 if (magSqrDist >= minLenSqr)
148 dd[edgeFaces[patchFacei]] +=
sqr(d)/magSqrDist;
161 const label own = owner[facei];
162 const label nei = neighbour[facei];
167 const scalar magSqrDist = d.magSqr();
168 if (magSqrDist >= minLenSqr)
170 lsP[facei] = (invDd[own] & d)/magSqrDist;
171 lsN[facei] = -(invDd[nei] & d)/magSqrDist;
181 for (
auto& patchLsP : lsP.boundaryFieldRef())
183 const faPatch&
p = patchLsP.patch();
191 const vector& d = pd[patchFacei];
194 const scalar magSqrDist = d.
magSqr();
195 if (magSqrDist >= minLenSqr)
197 patchLsP[patchFacei] =
198 (invDd[edgeFaces[patchFacei]] & d)/magSqrDist;
209 <<
"Done constructing finite area least square gradient vectors" <<
nl;
217 makeLeastSquaresVectors();
220 return *pVectorsPtr_;
228 makeLeastSquaresVectors();
231 return *nVectorsPtr_;
238 <<
"Clearing least square data" <<
nl;
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
virtual bool movePoints()
Delete the least square vectors when the mesh moves.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
const edgeVectorField & nVectors() const
Return reference to neighbour least square vectors.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
constexpr char nl
The newline '\n' character (0x0a)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
leastSquaresFaVectors(const faMesh &)
Construct given an faMesh.
Generic GeometricField class.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
UList< label > labelUList
A UList of labels.
const labelUList & neighbour() const
Internal face neighbour.
#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...
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
#define DebugInFunction
Report an information message using Foam::Info.
GeometricField< vector, faePatchField, edgeMesh > edgeVectorField
scalar magSqr() const
The length (L2-norm) squared of the vector.
#define DebugInfo
Report an information message using Foam::Info.
defineTypeNameAndDebug(combustionModel, 0)
const labelUList & owner() const
Internal face owner. Note bypassing virtual mechanism so.
virtual ~leastSquaresFaVectors()
Destructor.
Template functions to aid in the implementation of demand driven data.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const edgeVectorField & pVectors() const
Return reference to owner least square vectors.
Field< vector > vectorField
Specialisation of Field<T> for vector.
void deleteDemandDrivenData(DataPtr &dataPtr)
Least-squares gradient scheme vectors for the Finite Area method.
GeometricField< vector, faPatchField, areaMesh > areaVectorField
Do not request registration (bool: false)
static constexpr const zero Zero
Global zero (0)