48 pVectorsPtr_(nullptr),
64 void Foam::leastSquaresFaVectors::makeLeastSquaresVectors()
const 67 <<
"Constructing finite area least square gradient vectors" <<
nl;
74 mesh().pointsInstance(),
90 mesh().pointsInstance(),
114 label own = owner[facei];
115 label nei = neighbour[facei];
122 d = vector::uniform(SMALL);
132 forAll(lsP.boundaryField(), patchi)
136 const faPatch&
p = pw.patch();
149 const vector& d = pd[patchFacei];
151 dd[edgeFaces[patchFacei]] +=
159 const vector& d = pd[patchFacei];
161 dd[edgeFaces[patchFacei]] +=
175 label own = owner[facei];
176 label nei = neighbour[facei];
183 d = vector::uniform(SMALL);
186 scalar magSfByMagSqrd = 1.0/
magSqr(d);
188 lsP[facei] = magSfByMagSqrd*(invDd[own] & d);
189 lsN[facei] = -magSfByMagSqrd*(invDd[nei] & d);
192 forAll(lsP.boundaryField(), patchi)
198 const faPatch&
p = pw.patch();
208 const vector& d = pd[patchFacei];
210 patchLsP[patchFacei] =
212 *(invDd[edgeFaces[patchFacei]] & d);
219 const vector& d = pd[patchFacei];
221 patchLsP[patchFacei] =
223 *(invDd[edgeFaces[patchFacei]] & d);
229 <<
"Done constructing finite area least square gradient vectors" <<
nl;
237 makeLeastSquaresVectors();
240 return *pVectorsPtr_;
248 makeLeastSquaresVectors();
251 return *nVectorsPtr_;
258 <<
"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.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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...
virtual const surfaceScalarField & weights() const
Return reference to linear difference weighting factors.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
#define DebugInFunction
Report an information message using Foam::Info.
GeometricField< vector, faePatchField, edgeMesh > edgeVectorField
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
defineTypeNameAndDebug(combustionModel, 0)
faePatchField< scalar > faePatchScalarField
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.
faePatchField< vector > faePatchVectorField
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
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)