OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

Polynomial< PolySize > Class Template Reference

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

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.

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 73 of file Polynomial.H.


Member Typedef Documentation

typedef Polynomial<PolySize> polyType

Definition at line 88 of file Polynomial.H.

typedef Polynomial<PolySize+1> intPolyType

Definition at line 90 of file Polynomial.H.


Constructor & Destructor Documentation

Polynomial (  )  [inline]

Construct null.

Definition at line 23 of file Polynomial.C.

Polynomial ( const word &  name,
Istream &  is 
) [inline]

Construct from name and Istream.

Definition at line 32 of file Polynomial.C.

Polynomial ( const Polynomial< PolySize > &  poly  ) 

Copy constructor.


Member Function Documentation

bool & logActive (  )  [inline]

Return access to the log term active flag.

Definition at line 78 of file Polynomial.C.

Foam::scalar & logCoeff (  )  [inline]

Return access to the log coefficient.

Definition at line 85 of file Polynomial.C.

Foam::scalar evaluate ( const scalar  x  )  const [inline]

Return polynomial value.

Definition at line 92 of file Polynomial.C.

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

Return integrated polynomial coefficients.

argument becomes zeroth element (constant of integration)

Definition at line 138 of file Polynomial.C.

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

Return integrated polynomial coefficients when lowest order.

is -1. Argument added to zeroth element

Definition at line 154 of file Polynomial.C.

Foam::scalar integrateLimits ( const scalar  x1,
const scalar  x2 
) const [inline]

Integrate between two values.

Definition at line 112 of file Polynomial.C.


Friends And Related Function Documentation

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

Ostream Operator.


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd