44 MeshObject<fvMesh,
Foam::MoveableMeshObject, leastSquaresVectors>(
mesh),
50 mesh_.pointsInstance(),
64 mesh_.pointsInstance(),
74 calcLeastSquaresVectors();
86void Foam::leastSquaresVectors::calcLeastSquaresVectors()
90 const fvMesh&
mesh = mesh_;
94 const labelUList& neighbour = mesh_.neighbour();
103 const label own = owner[facei];
104 const label nei = neighbour[facei];
113 pVectors_.boundaryField();
119 const fvPatch&
p = patchLsP.patch();
120 const labelUList& faceCells =
p.patch().faceCells();
127 dd[faceCells[patchFacei]] += pdSqr[patchFacei];
139 const label own = owner[facei];
140 const label nei = neighbour[facei];
142 const vector d(C[nei] - C[own]);
144 pVectors_[facei] = (invDd[own] & d);
145 nVectors_[facei] = -(invDd[nei] & d);
152 const fvPatch&
p = patchLsP.patch();
160 patchLsP[patchFacei] =
161 (invDd[faceCells[patchFacei]] & pd[patchFacei]);
166 <<
"Finished calculating least square gradient vectors" <<
endl;
172 calcLeastSquaresVectors();
GeometricBoundaryField< vector, fvsPatchField, surfaceMesh > Boundary
Type of boundary fields.
const volVectorField & C() const
Return cell centres as volVectorField.
Least-squares gradient scheme vectors.
virtual bool movePoints()
Delete the least square vectors when the mesh moves.
virtual ~leastSquaresVectors()
Destructor.
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 DebugInfo
Report an information message using Foam::Info.
#define DebugInFunction
Report an information message using Foam::Info.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dimensionSet dimless
Dimensionless.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
static constexpr const zero Zero
Global zero (0)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
UList< label > labelUList
A UList of labels.
fvsPatchField< vector > fvsPatchVectorField
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.