36 namespace cellCellStencils
54 label nD = donorCcs.
size();
76 d[j] = donorCcs[j] - sample;
80 if (
mag(d[j]) < ROOTVSMALL)
86 LSQw[j] = 1.0/
magSqr(d[j]);
105 SVD svd(
A.
T()*
A, SMALL);
108 RectangularMatrix<scalar> ATAinvAT(svd.VSinvUt()*
A.
T());
113 for (label i = 0; i < 3; i++)
116 scalarList Row(UList<scalar>(ATAinvAT[i], nD));
120 W -= Row[j]*LSQw[j]*dw[i];
124 if (
mag(W) < SMALL*
mag(saveDiag))
136 - ATAinvAT[0][j]*LSQw[j]*dw[0]
137 - ATAinvAT[1][j]*LSQw[j]*dw[1]
138 - ATAinvAT[2][j]*LSQw[j]*dw[2]
157 Foam::cellCellStencils::leastSquares::leastSquares
virtual ~leastSquares()
Destructor.
void size(const label n)
Older name for setAddressableSize.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void stencilWeights(const point &sample, const pointList &donorCcs, scalarList &weights) const
Calculate lsq weights for single acceptor.
defineTypeNameAndDebug(cellVolumeWeight, 0)
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
void setSize(const label n)
Alias for resize()
Calculation of interpolation stencils.
List< scalar > scalarList
A List of scalars.
virtual bool update()
Update stencils. Return false if nothing changed.
addToRunTimeSelectionTable(cellCellStencil, cellVolumeWeight, mesh)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
dimensioned< Type > T() const
Return transpose.
Mesh data needed to do the Finite Volume discretisation.
Least-squares-weighted interpolation stencil.
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)