FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Polynomial< PolySize > Class Template Reference

Polynomial templated on size (order): More...

#include <OpenFOAM/Polynomial.H>


Detailed Description

template<int PolySize>
class Foam::Polynomial< PolySize >

Polynomial templated on size (order):

poly = logCoeff*log(x) + sum(coeff_[i]*x^i)

where 0 <= i <= n

  • integer powers, starting at zero
  • evaluate(x) to evaluate the poly for a given value
  • integrate(x1, x2) between two scalar values
  • integrate() to return a new, intergated coeff polynomial
    • increases the size (order)
  • integrateMinus1() to return a new, integrated coeff polynomial where the base poly starts at order -1
Source files

Definition at line 78 of file Polynomial.H.

Inheritance diagram for Polynomial< PolySize >:
Collaboration diagram for Polynomial< PolySize >:

List of all members.

Public Types

typedef Polynomial< PolySize >  polyType
typedef Polynomial< PolySize+1 >  intPolyType

Public Member Functions

 Polynomial ()
 Construct null.
 Polynomial (const word &name, Istream &is)
 Construct from name and Istream.
 Polynomial (const Polynomial &poly)
 Copy constructor.
bool &  logActive ()
 Return access to the log term active flag.
scalar &  logCoeff ()
 Return access to the log coefficient.
scalar  evaluate (const scalar x) const
 Return polynomial value.
intPolyType  integrate (const scalar intConstant=0.0)
 Return integrated polynomial coefficients.
polyType  integrateMinus1 (const scalar intConstant=0.0)
 Return integrated polynomial coefficients when lowest order.
scalar  integrateLimits (const scalar x1, const scalar x2) const
 Integrate between two values.

Friends

Ostream &  operator (Ostream &, const Polynomial &)
 Ostream Operator.

Member Typedef Documentation

typedef Polynomial<PolySize> polyType

Definition at line 93 of file Polynomial.H.

typedef Polynomial<PolySize+1> intPolyType

Definition at line 95 of file Polynomial.H.


Constructor & Destructor Documentation

Polynomial (  )

Construct null.

Definition at line 31 of file Polynomial.C.

Polynomial ( const Polynomial< PolySize > &   poly  )

Copy constructor.


Member Function Documentation

bool & logActive (  )

Return access to the log term active flag.

Definition at line 86 of file Polynomial.C.

Referenced by Polynomial< PolySize >::integrateMinus1().

Foam::scalar & logCoeff (  )

Return access to the log coefficient.

Definition at line 93 of file Polynomial.C.

Referenced by Polynomial< PolySize >::integrateMinus1().

Foam::scalar evaluate ( const scalar   x  ) const

Return polynomial value.

Definition at line 100 of file Polynomial.C.

References Foam::log(), Foam::pow(), and y.

Referenced by Polynomial< PolySize >::integrateLimits().

Foam::Polynomial< PolySize >::intPolyType integrate ( const scalar   intConstant = 0.0  )

Return integrated polynomial coefficients.

argument becomes zeroth element (constant of integration)

Definition at line 146 of file Polynomial.C.

References forAll.

Foam::Polynomial< PolySize >::polyType integrateMinus1 ( const scalar   intConstant = 0.0  )

Return integrated polynomial coefficients when lowest order.

is -1. Argument added to zeroth element

Definition at line 162 of file Polynomial.C.

References Polynomial< PolySize >::logActive(), and Polynomial< PolySize >::logCoeff().

Foam::scalar integrateLimits ( const scalar   x1,
const scalar   x2  
) const

Integrate between two values.

Definition at line 120 of file Polynomial.C.

References Foam::abort(), Polynomial< PolySize >::evaluate(), Foam::FatalError, FatalErrorIn, and Foam::nl.


Friends And Related Function Documentation

Ostream& operator ( Ostream &   ,
const Polynomial< PolySize > &    
) [friend]

The documentation for this class was generated from the following files: