Go to the documentation of this file.
30 template<
int PolySize>
44 template<
int PolySize>
51 logActive_(poly.logActive_),
52 logCoeff_(poly.logCoeff_)
56 template<
int PolySize>
65 this->v_[i] = coeffs[i];
70 template<
int PolySize>
80 <<
"Size mismatch: Needed " <<
PolySize
81 <<
" but given " << coeffs.
size()
87 this->v_[i] = coeffs[i];
92 template<
int PolySize>
101 template<
int PolySize>
113 <<
"Expected polynomial name " <<
name <<
" but read " << isName
117 VectorSpace<Polynomial<PolySize>, scalar,
PolySize>::
118 operator=(VectorSpace<Polynomial<PolySize>, scalar,
PolySize>(is));
120 if (this->size() == 0)
123 <<
"Polynomial coefficients for entry " << isName
131 template<
int PolySize>
138 template<
int PolySize>
145 template<
int PolySize>
148 scalar val = this->v_[0];
155 val += this->v_[i]*powX;
160 val += logCoeff_*
log(
x);
167 template<
int PolySize>
175 deriv += this->v_[1];
181 deriv += i*this->v_[i]*powX;
187 deriv += logCoeff_/
x;
194 template<
int PolySize>
205 scalar integ = this->v_[0]*(powX2 - powX1);
210 integ += this->v_[i]/(i + 1)*(powX2 - powX1);
215 integ += logCoeff_*((x2*
log(x2) - x2) - (x1*
log(x1) - x1));
222 template<
int PolySize>
226 intPolyType newCoeffs;
228 newCoeffs[0] = intConstant;
231 newCoeffs[i+1] = this->v_[i]/(i + 1);
238 template<
int PolySize>
244 if (this->v_[0] > VSMALL)
250 newCoeffs[0] = intConstant;
253 newCoeffs[i] = this->v_[i]/i;
polyType integralMinus1(const scalar intConstant=0.0) const
Return integral coefficients when lowest order is -1.
#define forAll(list, i)
Loop across all elements in list.
scalar derivative(const scalar x) const
Return derivative of the polynomial at the given x.
bool logActive_
Include the log term? - only activated using integralMinus1()
scalar integral(const scalar x1, const scalar x2) const
Return integral between two values.
Polynomial()
Construct null, with all coefficients = 0.0.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool logActive() const
Return true if the log term is active.
scalar value(const scalar x) const
Return polynomial value.
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
scalar logCoeff_
Log coefficient - only activated using integralMinus1()
Polynomial templated on size (order):
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalar logCoeff() const
Return the log coefficient.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
word name(const complex &)
Return a string representation of a complex.