33template<
class Stencil>
39 MeshObject_type(
mesh),
40 vectors_(
mesh.nCells())
42 calcLeastSquaresVectors();
48template<
class Stencil>
55template<
class Stencil>
56void Foam::fv::LeastSquaresVectors<Stencil>::calcLeastSquaresVectors()
76 for (label j = 1; j < lsvi.
size(); ++j)
78 lsvi[j] = lsvi[j] - lsvi[0];
79 const scalar magSqrLsvi =
magSqr(lsvi[j]);
80 dd +=
sqr(lsvi[j])/magSqrLsvi;
81 lsvi[j] /= magSqrLsvi;
92 for (label j = 1; j < lsvi.
size(); ++j)
94 lsvi[j] = dd & lsvi[j];
100 <<
"Finished calculating least square gradient vectors" <<
endl;
104template<
class Stencil>
107 calcLeastSquaresVectors();
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const fvMesh & mesh() const noexcept
void size(const label n)
Older name for setAddressableSize.
static const Vector< Cmpt > one
void collectData(const GeometricField< Type, fvPatchField, volMesh > &fld, List< List< Type > > &stencilFld) const
Use map to get the data into stencil order.
Mesh data needed to do the Finite Volume discretisation.
virtual bool movePoints()
Update the least square vectors when the mesh moves.
LeastSquaresVectors(const fvMesh &mesh)
Construct given an fvMesh and the minimum determinant criterion.
virtual ~LeastSquaresVectors()
Destructor.
#define DebugInfo
Report an information message using Foam::Info.
#define DebugInFunction
Report an information message using Foam::Info.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.