Polynomial function representation. More...
Public Member Functions | |
TypeName ("polynomialFunction") | |
Runtime type information. More... | |
polynomialFunction (const label) | |
Construct a particular size, with all coefficients = 0.0. More... | |
polynomialFunction (const polynomialFunction &) | |
Copy constructor. More... | |
polynomialFunction (const UList< scalar > &coeffs) | |
Construct from a list of coefficients. More... | |
polynomialFunction (Istream &) | |
Construct from Istream. More... | |
virtual | ~polynomialFunction () |
Destructor. More... | |
bool | logActive () const |
Return true if the log term is active. More... | |
scalar | logCoeff () const |
Return the log coefficient. More... | |
scalar | value (const scalar x) const |
Return polynomial value. More... | |
scalar | integrate (const scalar x1, const scalar x2) const |
Integrate between two values. More... | |
polynomialFunction | integral (const scalar intConstant=0.0) const |
Return integral coefficients. More... | |
polynomialFunction | integralMinus1 (const scalar intConstant=0.0) const |
Return integral coefficients when lowest order is -1. More... | |
polynomialFunction & | operator+= (const polynomialFunction &) |
polynomialFunction & | operator-= (const polynomialFunction &) |
polynomialFunction & | operator*= (const scalar) |
polynomialFunction & | operator/= (const scalar) |
Friends | |
Ostream & | operator<< (Ostream &, const polynomialFunction &) |
Ostream Operator. More... | |
Polynomial function representation.
poly = logCoeff*log(x) + sum(coeffs[i]*x^i)
where 0 <= i <= N
value(x)
to evaluate the poly for a given valueintegrate(x1, x2)
between two scalar valuesintegral()
to return a new, integral coeff polynomialintegralMinus1()
to return a new, integral coeff polynomial where the base poly starts at order -1Definition at line 74 of file polynomialFunction.H.
|
explicit |
Construct a particular size, with all coefficients = 0.0.
Definition at line 84 of file polynomialFunction.C.
References UList< T >::empty(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
polynomialFunction | ( | const polynomialFunction & | poly | ) |
Copy constructor.
Definition at line 99 of file polynomialFunction.C.
|
explicit |
Construct from a list of coefficients.
Definition at line 107 of file polynomialFunction.C.
References UList< T >::empty(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
polynomialFunction | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 122 of file polynomialFunction.C.
References UList< T >::empty(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
|
virtual |
Destructor.
Definition at line 139 of file polynomialFunction.C.
TypeName | ( | "polynomialFunction" | ) |
Runtime type information.
bool logActive | ( | ) | const |
Return true if the log term is active.
Definition at line 145 of file polynomialFunction.C.
Foam::scalar logCoeff | ( | ) | const |
Return the log coefficient.
Definition at line 151 of file polynomialFunction.C.
Foam::scalar value | ( | const scalar | x | ) | const |
Return polynomial value.
Definition at line 157 of file polynomialFunction.C.
References polynomialFunction::integrate(), Foam::log(), List< T >::size(), and x.
Foam::scalar integrate | ( | const scalar | x1, |
const scalar | x2 | ||
) | const |
Integrate between two values.
Definition at line 180 of file polynomialFunction.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and List< T >::size().
Referenced by polynomialFunction::value().
Foam::polynomialFunction integral | ( | const scalar | intConstant = 0.0 | ) | const |
Return integral coefficients.
Argument becomes zeroth element (constant of integration)
Definition at line 211 of file polynomialFunction.C.
Foam::polynomialFunction integralMinus1 | ( | const scalar | intConstant = 0.0 | ) | const |
Return integral coefficients when lowest order is -1.
Argument becomes zeroth element (constant of integration)
Definition at line 218 of file polynomialFunction.C.
Foam::polynomialFunction & operator+= | ( | const polynomialFunction & | poly | ) |
Definition at line 227 of file polynomialFunction.C.
References forAll, List< T >::setSize(), and List< T >::size().
Foam::polynomialFunction & operator-= | ( | const polynomialFunction & | poly | ) |
Definition at line 253 of file polynomialFunction.C.
References forAll, List< T >::setSize(), and List< T >::size().
Foam::polynomialFunction & operator*= | ( | const scalar | s | ) |
Foam::polynomialFunction & operator/= | ( | const scalar | s | ) |
|
friend |
Ostream Operator.