35 const word& polyFunctionName,
40 A_(polyFunc_->nTerms(), scalar(0),
Zero)
49 for (label i=0;i<A_.size();i++)
64 const label size = A_.n();
68 for (label i=0; i<size; ++i)
70 A_.source()[i] += polyTerms[i]*value;
71 scalar* luMatrixi = A_[i];
72 const scalar tmpValue = polyTerms[i];
74 for (label j=0; j<size; ++j)
76 luMatrixi[j] += tmpValue*polyTerms[j];
90 const label size = A_.n();
94 for (label i=0; i<size; ++i)
96 A_.source()[i] += polyTerms[i]*value*weight;
97 scalar* __restrict luMatrixi = A_[i];
98 const scalar tmpValue = polyTerms[i];
100 for (label j=0; j<size; j++)
102 luMatrixi[j] += tmpValue*polyTerms[j]*weight;
115 const label size =
A.n();
118 for (label i=0; i<size; ++i)
120 for (label j=0; j<size; ++j)
122 A[i][j] += polyTerms[i]*polyTerms[j];
131 const List<scalarField>& listPolyTerms,
132 const List<T>& listValue
137 if (listPolyTerms.size() == listValue.size())
153 <<
"size of listPolyTerms: " << listPolyTerms.size()
154 <<
"size of listValues is: " << listValue.size()
155 <<
" they must match!" <<
nl 165 const List<scalarField>& listPolyTerms,
166 const List<T>& listValue,
167 const List<scalar>& listWeight
172 if (listPolyTerms.size() == listValue.size())
190 <<
"size of listPolyTerms: " << listPolyTerms.size()
191 <<
"size of listValues is:" << listValue.size()
192 <<
"they have to match" 203 const List<scalarField>& listPolyTerms
217 return inv(symMatrix);
228 if (listPolyTerms.
size() != listValue.
size())
231 <<
"size of listPolyTerms: " << listPolyTerms.
size()
232 <<
"size of listValues is:" << listValue.
size()
233 <<
"they have to match" 237 Field<T> source(listPolyTerms.
size(),
Zero);
241 forAll(listPolyTerms[i], j)
243 source[i] += listPolyTerms[i][j]*listValue[i];
259 if (positions.
size() != listValue.
size())
262 <<
"size of positions and listValues don't match" <<
nl 263 <<
"size of positions is: " << positions.
size() <<
nl 264 <<
"size of listValues is: " << listValue.
size() <<
nl 274 polyFunc_->termValues(positions[i]),
293 if (positions.
size() != listValue.
size())
296 <<
"size of positions and listValues don't match" <<
nl 297 <<
"size of positions is: " << positions.
size() <<
nl 298 <<
"size of listValues is: " << listValue.
size() <<
nl 308 polyFunc_->termValues(positions[i]),
331 polyFunc_->termValues(positions[i]),
336 return inv(symMatrix);
347 if (positions.
size() != listValue.
size())
350 <<
"size of positions: " << positions.
size()
351 <<
"size of listValues is:" << listValue.
size()
352 <<
"they have to match" 356 Field<T> source(polyFunc_->nTerms(),
Zero);
360 scalarField polyTerms = polyFunc_->termValues(positions[i]);
363 source[i] += polyTerms[j]*listValue[i];
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
constexpr char nl
The newline '\n' character (0x0a)
scalarSymmetricSquareMatrix computeInverse(const List< scalarField > &listPolyTerms)
Compute inverse.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
void fillMatrix(const scalarField &polyTerms, const T &value)
#define forAll(list, i)
Loop across all elements in list.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Fit a polynominal function with the help of multiDimPolyFunction.
base class for polynomial functions
SymmetricSquareMatrix< scalar > scalarSymmetricSquareMatrix
A templated (N x N) square matrix of objects of <Type>, containing N*N elements, derived from Matrix...
Field< T > computeMatrixSource(const List< scalarField > &listPolyTerms, const List< T > &listValue)
Compute source.
multiDimPolyFitter(const word &polyFunctionName, const labelVector &geomDirs)
Construct from components.
Field< T > fitData(const List< scalarField > &listPolyTerms, const List< T > &listValue)
Fit data.
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
static constexpr const zero Zero
Global zero (0)