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) |
void | size (const label) |
Return the number of coefficients. More... | |
label | size () const |
Return the number of coefficients. More... | |
Private Member Functions | |
void | operator= (const polynomialFunction &) |
Disallow default bitwise assignment. More... | |
![]() | |
List () | |
Null constructor. More... | |
List (const label) | |
Construct with given size. More... | |
List (const label, const T &) | |
Construct with given size and value for all elements. More... | |
List (const List< T > &) | |
Copy constructor. More... | |
List (const Xfer< List< T > > &) | |
Construct by transferring the parameter contents. More... | |
List (List< T > &, bool reUse) | |
Construct as copy or re-use as specified. More... | |
List (const UList< T > &, const labelUList &mapAddressing) | |
Construct as subset. More... | |
template<class InputIterator > | |
List (InputIterator first, InputIterator last) | |
Construct given start and end iterators. More... | |
template<unsigned Size> | |
List (const FixedList< T, Size > &) | |
Construct as copy of FixedList<T, Size> More... | |
List (const PtrList< T > &) | |
Construct as copy of PtrList<T> More... | |
List (const SLList< T > &) | |
Construct as copy of SLList<T> More... | |
List (const UIndirectList< T > &) | |
Construct as copy of UIndirectList<T> More... | |
List (const BiIndirectList< T > &) | |
Construct as copy of BiIndirectList<T> More... | |
List (Istream &) | |
Construct from Istream. More... | |
autoPtr< List< T > > | clone () const |
Clone. More... | |
~List () | |
Destructor. More... | |
label | size () const |
Return the number of elements in the UList. More... | |
void | resize (const label) |
Alias for setSize(const label) More... | |
void | resize (const label, const T &) |
Alias for setSize(const label, const T&) More... | |
void | setSize (const label) |
Reset size of List. More... | |
void | setSize (const label, const T &) |
Reset size of List and value for new elements. More... | |
void | clear () |
Clear the list, i.e. set size to zero. More... | |
void | append (const T &) |
Append an element at the end of the list. More... | |
void | append (const UList< T > &) |
Append a List at the end of this list. More... | |
void | append (const UIndirectList< T > &) |
Append a UIndirectList at the end of this list. More... | |
void | transfer (List< T > &) |
Transfer the contents of the argument List into this list. More... | |
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> | |
void | transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &) |
Transfer the contents of the argument List into this list. More... | |
void | transfer (SortableList< T > &) |
Transfer the contents of the argument List into this list. More... | |
Xfer< List< T > > | xfer () |
Transfer contents to the Xfer container. More... | |
T & | newElmt (const label) |
Return subscript-checked element of UList. More... | |
void | operator= (const UList< T > &) |
Assignment from UList operator. Takes linear time. More... | |
void | operator= (const List< T > &) |
Assignment operator. Takes linear time. More... | |
void | operator= (const SLList< T > &) |
Assignment from SLList operator. Takes linear time. More... | |
void | operator= (const UIndirectList< T > &) |
Assignment from UIndirectList operator. Takes linear time. More... | |
void | operator= (const BiIndirectList< T > &) |
Assignment from BiIndirectList operator. Takes linear time. More... | |
void | operator= (const T &) |
Assignment of all entries to the given value. More... | |
template<class T > | |
List (const label s) | |
template<class T > | |
List (const label s, const T &a) | |
template<class T > | |
List (const List< T > &a) | |
template<class T > | |
List (const Xfer< List< T > > &lst) | |
template<class T > | |
List (List< T > &a, bool reUse) | |
template<class T > | |
List (const UList< T > &a, const labelUList &map) | |
template<class T > | |
List (const PtrList< T > &lst) | |
template<class T > | |
List (const SLList< T > &lst) | |
template<class T > | |
List (const UIndirectList< T > &lst) | |
template<class T > | |
List (const BiIndirectList< T > &lst) | |
template<class T > | |
void | transfer (List< T > &a) |
template<class T > | |
void | transfer (SortableList< T > &a) |
template<class T > | |
List () | |
template<class T > | |
List (Istream &is) | |
void | size (const label) |
Override size to be inconsistent with allocated storage. More... | |
Static Private Member Functions | |
static polynomialFunction | cloneIntegral (const polynomialFunction &, const scalar intConstant=0.0) |
Return integral coefficients. More... | |
static polynomialFunction | cloneIntegralMinus1 (const polynomialFunction &, const scalar intConstant=0.0) |
Return integral coefficients when lowest order is -1. More... | |
![]() | |
static const List< T > & | null () |
Return a null List. More... | |
Private Attributes | |
bool | logActive_ |
Include the log term? - only activated using integralMinus1() More... | |
scalar | logCoeff_ |
Log coefficient - only activated using integralMinus1() More... | |
Friends | |
Ostream & | operator<< (Ostream &, const polynomialFunction &) |
Ostream Operator. More... | |
Additional Inherited Members | |
![]() | |
typedef SubList< T > | subList |
Declare type of subList. More... | |
Polynomial function representation.
poly = logCoeff*log(x) + sum(coeff_[i]*x^i)
where 0 <= i <= N
Definition at line 72 of file polynomialFunction.H.
|
explicit |
Construct a particular size, with all coefficients = 0.0.
Definition at line 84 of file polynomialFunction.C.
References 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 Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
polynomialFunction | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 122 of file polynomialFunction.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
|
virtual |
Destructor.
Definition at line 139 of file polynomialFunction.C.
|
staticprivate |
Return integral coefficients.
Argument becomes zeroth element (constant of integration)
Definition at line 41 of file polynomialFunction.C.
References forAll, and polynomialFunction::size().
|
staticprivate |
Return integral coefficients when lowest order is -1.
Argument becomes zeroth element (constant of integration)
Definition at line 59 of file polynomialFunction.C.
References polynomialFunction::logActive_, polynomialFunction::logCoeff_, and polynomialFunction::size().
|
private |
Disallow default bitwise assignment.
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 Foam::log(), List::size(), and x.
Referenced by main().
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::size().
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::setSize(), List::size(), and polynomialFunction::size().
Foam::polynomialFunction & operator-= | ( | const polynomialFunction & | poly | ) |
Definition at line 253 of file polynomialFunction.C.
References forAll, List::setSize(), List::size(), and polynomialFunction::size().
Foam::polynomialFunction & operator*= | ( | const scalar | s | ) |
Foam::polynomialFunction & operator/= | ( | const scalar | s | ) |
|
inline |
Return the number of coefficients.
Referenced by polynomialFunction::cloneIntegral(), polynomialFunction::cloneIntegralMinus1(), polynomialFunction::operator+=(), polynomialFunction::operator-=(), and Foam::operator<<().
|
inline |
Return the number of coefficients.
|
friend |
Ostream Operator.
|
private |
Include the log term? - only activated using integralMinus1()
Definition at line 79 of file polynomialFunction.H.
Referenced by polynomialFunction::cloneIntegralMinus1().
|
private |
Log coefficient - only activated using integralMinus1()
Definition at line 82 of file polynomialFunction.H.
Referenced by polynomialFunction::cloneIntegralMinus1().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.