Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ODESolver Class Reference

Abstract base-class for ODE system solvers. More...

Inheritance diagram for ODESolver:
Inheritance graph
[legend]
Collaboration diagram for ODESolver:
Collaboration graph
[legend]

Classes

class  stepState
 

Public Member Functions

 TypeName ("ODESolver")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, ODESolver, dictionary,(const ODESystem &ode, const dictionary &dict),(ode, dict))
 
 ODESolver (const ODESystem &ode, const dictionary &dict)
 Construct for given ODESystem. More...
 
 ODESolver (const ODESystem &ode, const scalarField &absTol, const scalarField &relTol)
 Construct for given ODESystem specifying tolerances. More...
 
virtual ~ODESolver ()
 Destructor. More...
 
scalarFieldabsTol ()
 
scalarFieldrelTol ()
 
virtual void solve (scalar &x, scalarField &y, scalar &dxTry) const
 Solve the ODE system as far as possible upto dxTry. More...
 
virtual void solve (scalar &x, scalarField &y, stepState &step) const
 Solve the ODE system as far as possible upto dxTry. More...
 
virtual void solve (const scalar xStart, const scalar xEnd, scalarField &y, scalar &dxEst) const
 Solve the ODE system from xStart to xEnd, update the state. More...
 

Static Public Member Functions

static autoPtr< ODESolverNew (const ODESystem &ode, const dictionary &dict)
 Select null constructed. More...
 

Protected Member Functions

scalar normalizeError (const scalarField &y0, const scalarField &y, const scalarField &err) const
 Return the nomalized scalar error. More...
 
 ODESolver (const ODESolver &)
 Disallow default bitwise copy construct. More...
 
void operator= (const ODESolver &)
 Disallow default bitwise assignment. More...
 

Protected Attributes

const ODESystemodes_
 Reference to ODESystem. More...
 
label n_
 Size of the ODESystem. More...
 
scalarField absTol_
 Absolute convergence tolerance per step. More...
 
scalarField relTol_
 Relative convergence tolerance per step. More...
 
label maxSteps_
 The maximum number of sub-steps allowed for the integration step. More...
 

Detailed Description

Abstract base-class for ODE system solvers.

Source files

Definition at line 50 of file ODESolver.H.

Constructor & Destructor Documentation

ODESolver ( const ODESolver )
protected

Disallow default bitwise copy construct.

Referenced by ODESolver::ODESolver(), and ODESolver::stepState::stepState().

Here is the caller graph for this function:

ODESolver ( const ODESystem ode,
const dictionary dict 
)

Construct for given ODESystem.

Definition at line 39 of file ODESolver.C.

References ODESolver::ODESolver().

Here is the call graph for this function:

ODESolver ( const ODESystem ode,
const scalarField absTol,
const scalarField relTol 
)

Construct for given ODESystem specifying tolerances.

Definition at line 50 of file ODESolver.C.

References ODESolver::normalizeError().

Here is the call graph for this function:

virtual ~ODESolver ( )
inlinevirtual

Destructor.

Definition at line 157 of file ODESolver.H.

Member Function Documentation

Foam::scalar normalizeError ( const scalarField y0,
const scalarField y,
const scalarField err 
) const
protected

Return the nomalized scalar error.

Definition at line 67 of file ODESolver.C.

References ODESolver::absTol_, forAll, Foam::mag(), Foam::max(), ODESolver::relTol_, and ODESolver::solve().

Referenced by ODESolver::ODESolver(), Trapezoid::solve(), Euler< Type >::solve(), EulerSI::solve(), Rosenbrock12::solve(), Rosenbrock23::solve(), rodas23::solve(), rodas34::solve(), RKCK45::solve(), RKDP45::solve(), RKF45::solve(), and Rosenbrock34::solve().

Here is the call graph for this function:

Here is the caller graph for this function:

void operator= ( const ODESolver )
protected

Disallow default bitwise assignment.

TypeName ( "ODESolver"  )

Runtime type information.

declareRunTimeSelectionTable ( autoPtr  ,
ODESolver  ,
dictionary  ,
(const ODESystem &ode, const dictionary &dict ,
(ode, dict  
)

Referenced by ODESolver::stepState::stepState().

Here is the caller graph for this function:

Foam::autoPtr< Foam::ODESolver > New ( const ODESystem ode,
const dictionary dict 
)
static

Select null constructed.

Definition at line 31 of file ODESolverNew.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::Info, dictionary::lookup(), and Foam::nl.

Referenced by ODESolver::stepState::stepState().

Here is the call graph for this function:

Here is the caller graph for this function:

scalarField& absTol ( )
inline

Definition at line 163 of file ODESolver.H.

References ODESolver::absTol_.

Referenced by ODESolver::stepState::stepState().

Here is the caller graph for this function:

scalarField& relTol ( )
inline

Definition at line 168 of file ODESolver.H.

References ODESolver::relTol_, and ODESolver::solve().

Referenced by ODESolver::stepState::stepState().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void solve ( scalar &  x,
scalarField y,
scalar &  dxTry 
) const
inlinevirtual

Solve the ODE system as far as possible upto dxTry.

adjusting the step as necessary to provide a solution within the specified tolerance. Update the state and return an estimate for the next step in dxTry

Reimplemented in Rosenbrock34, RKDP45, RKF45, SIBS, RKCK45, rodas34, rodas23, Rosenbrock23, Rosenbrock12, EulerSI, Euler< Type >, and Trapezoid.

Definition at line 178 of file ODESolver.H.

References ODESolver::stepState::dxTry.

Referenced by ODESolver::normalizeError(), ODESolver::relTol(), and ODESolver::solve().

Here is the caller graph for this function:

void solve ( scalar &  x,
scalarField y,
stepState step 
) const
virtual

Solve the ODE system as far as possible upto dxTry.

adjusting the step as necessary to provide a solution within the specified tolerance. Update the state and return an estimate for the next step in dxTry

Reimplemented in seulex.

Definition at line 86 of file ODESolver.C.

References ODESolver::stepState::dxDid, ODESolver::stepState::dxTry, ODESolver::solve(), and x.

Here is the call graph for this function:

void solve ( const scalar  xStart,
const scalar  xEnd,
scalarField y,
scalar &  dxEst 
) const
virtual

Solve the ODE system from xStart to xEnd, update the state.

and return an estimate for the next step in dxTry

Definition at line 99 of file ODESolver.C.

References ODESolver::stepState::dxDid, ODESolver::stepState::dxTry, Foam::exit(), Foam::FatalError, FatalErrorIn, ODESolver::stepState::first, ODESolver::stepState::last, ODESolver::maxSteps_, ODESolver::stepState::prevReject, ODESolver::stepState::reject, ODESolver::solve(), and x.

Here is the call graph for this function:

Member Data Documentation

const ODESystem& odes_
protected
label n_
protected
scalarField absTol_
protected

Absolute convergence tolerance per step.

Definition at line 64 of file ODESolver.H.

Referenced by ODESolver::absTol(), ODESolver::normalizeError(), SIBS::solve(), and seulex::solve().

scalarField relTol_
protected

Relative convergence tolerance per step.

Definition at line 67 of file ODESolver.H.

Referenced by ODESolver::normalizeError(), ODESolver::relTol(), SIBS::solve(), and seulex::solve().

label maxSteps_
protected

The maximum number of sub-steps allowed for the integration step.

Definition at line 70 of file ODESolver.H.

Referenced by ODESolver::solve().


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