Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ODE_SOLVER Class Reference

Abstract solver class. More...

#include <odesolv.h>

Inheritance diagram for ODE_SOLVER:

VODE_SOLVER SOLVER_1 SOLVER_2 List of all members.

Public Methods

virtual void IntegrateTo ( double tEnd, bool Continue = false ) = 0
 Integrates an IVP problem. More...

void Integrate ( bool Continue = false )
 Integrates an ODE_NUMERIC problem. More...

void SetDataRepr ( const PtrDataRepr Data )
 Sets a data representation object. More...

void SetStepControl ( const PtrStepCtrl Step )
 Sets a stepsize control object. More...

const PtrStepCtrl GetStepCtrl () const
 Returns a pointer to the stepsize control object.

void VerboseOutput ( bool b )
 Indicates if verbose output is desired. More...

bool VerboseOutput () const
 Is verbose output desired. More...

void PrintData ( ostream & os = cout )
 Prints data. More...

void GraphOutput ( bool b )
 Indicates if plots will be generated. More...

bool GraphOutput () const
 Is graph output desired. More...

void ContinueOutput ( bool b )
 Indicates if the plots are to be extended. More...

bool ContinueOutput () const
 Is graph output continued. More...

void DisplayStepSize ( const char * file_name = 0 ) const
 Plots the stepsize versus time. More...

void DisplayOrder ( const char *file_name = 0 ) const
 Plots the order versus time. More...

bool FirstStep () const
 Is the first step. More...

bool AcceptedStep () const
 Is a step accepted. More...

virtual ~ODE_SOLVER ()
 Destructor.


Protected Methods

 ODE_SOLVER ( const PtrODENumeric ODE, const PtrDataRepr Data, const PtrStepCtrl Step, const PtrSolverFlags Flags = new SOLVER_FLAGS, const PtrSolverStats Stats = new SOLVER_STATS )
 Constructor. More...

virtual void InitSolver () = 0
 Initializes a solver.

void SetErrors ( double t, const INTERVAL_VECTOR & Y )
 Sets errors. More...


Protected Attributes

PtrODENumeric ODE
 Pointer to an object representing the numerical problem.

PtrDataRepr DataRepr
 Pointer to an object that contains a data representation object.

PtrStepCtrl StepControl
 Pointer to an object that implements stepsize control.

PtrSolverFlags SolverFlags
 Pointer to an object that updates control flags.

PtrSolverStats SolverStats
 Pointer to an object that updates statistics.


Friends

template<classT> T* GetDataRepr ( const PtrODESolver Solver )
 Return a pointer to a DATA_REPR object. More...


Detailed Description

Abstract solver class.

Author(s):
Ned Nedialkov
Date:
1 May 2001


Constructor & Destructor Documentation

ODE_SOLVER::~ODE_SOLVER ( ) [inline, virtual]
 

Destructor.

ODE_SOLVER::ODE_SOLVER ( const PtrODENumeric ODE,
const PtrDataRepr Data,
const PtrStepCtrl Step,
const PtrSolverFlags Flags = new SOLVER_FLAGS,
const PtrSolverStats Stats = new SOLVER_STATS ) [inline, protected]
 

Constructor.

Parameters:
ODE   pointer to an object that represents the numerical problem
Data   pointer to a data representation object
Step   pointer to an object that implements stepsize control
Flags   pointer to an object that updates control flags
Stats   pointer to an object that updates statistics

Precondition:
NotNull(ODE) && NotNull(Data) && NotNull(Step) && NotNull(Flags) && NotNull(Stats)


Member Function Documentation

void ODE_SOLVER::IntegrateTo ( double tEnd,
bool Continue = false ) [pure virtual]
 

Integrates an IVP problem.

This function performs the integration of the problem that is set in the constructor.

Parameters:
tEnd   endpoint where an enclosure of the solution is desired
Continue   if true, the integration is from the current integration point; otherwise, it is from the initial point. By default, Continue is set to false.

Precondition:
tEnd != ODE->GetT0()

Reimplemented in VODE_SOLVER.

void ODE_SOLVER::Integrate ( bool Continue = false ) [inline]
 

Integrates an ODE_NUMERIC problem.

This function executes

 IntegrateTo( ODE->GetTEnd(),
    Continue ) 
Parameters:
Continue   if true, the integration is from the current point; otherwise, it is from the initial point. By default, this parameter is set to false.

void ODE_SOLVER::SetDataRepr ( const PtrDataRepr Data ) [inline]
 

Sets a data representation object.

Parameters:
Data   pointer to a data representation object
Precondition:
NotNull(Data);

void ODE_SOLVER::SetStepControl ( const PtrStepCtrl Step ) [inline]
 

Sets a stepsize control object.

Parameters:
Step   a pointer to an object that implements a stepsize control.
Precondition:
NotNull(Step)

const PtrStepCtrl ODE_SOLVER::GetStepCtrl ( ) const [inline]
 

Returns a pointer to the stepsize control object.

void ODE_SOLVER::VerboseOutput ( bool b ) [inline]
 

Indicates if verbose output is desired.

Parameters:
b   true if verbose output is desired and false otherwise.
See also:
PrintData()

bool ODE_SOLVER::VerboseOutput ( ) const [inline]
 

Is verbose output desired.

This function returns the value that is set by the most recent call to VerboseOutput, or true, if VerboseOutput has not been called.

void ODE_SOLVER::PrintData ( ostream & os = cout )
 

Prints data.

This function outputs data in the following format (the numbers are from integrating a test problem)

    *** Integrated from [0,0] to [10,10]
    *** Global Error    1.20e-07
    *** User Time       2.20e-01(sec) 
    *** Accepted Steps  54
    *** Rejected Steps  0
    

If VerboseOutput(false) is called before an integration, such an output is not produced.

Parameters:
os   output stream

void ODE_SOLVER::GraphOutput ( bool b ) [inline]
 

Indicates if plots will be generated.

Parameters:
b   true if files with data are to be generated and false otherwise.

bool ODE_SOLVER::GraphOutput ( ) const [inline]
 

Is graph output desired.

This function returns the value that is set by the most recent call to GraphOutput, or false, if GraphOutput has not been called.

void ODE_SOLVER::ContinueOutput ( bool b ) [inline]
 

Indicates if the plots are to be extended.

Parameters:
b   true if the plots are to be extended and false otherwise.

bool ODE_SOLVER::ContinueOutput ( ) const [inline]
 

Is graph output continued.

This function returns the value that is set by the most recent call to ContinueOutput, or false, if ContinueOutput has not been called.

void ODE_SOLVER::DisplayStepSize ( const char * file_name = 0 ) const
 

Plots the stepsize versus time.

This function should be called after an integration has been completed, and GraphOutput(true) had been called before the integration starts.

If a file_name is specified, the plot will be stored into an encapsulated postscript file under the file name that is given as a parameter. Otherwise, the plot will be displayed on the screen.

Parameters:
file_name   pointer to a string

void ODE_SOLVER::DisplayOrder ( const char * file_name = 0 ) const
 

Plots the order versus time.

This function should be called after an integration has been completed, and GraphOutput(true) had been called before the integration starts.

If a file_name is specified, the plot will be stored into an encapsulated postscript file under the file name that is given as a parameter. Otherwise, the plot will be displayed on the screen.

Parameters:
file_name   pointer to a string

bool ODE_SOLVER::FirstStep ( ) const [inline]
 

Is the first step.

Returns:
true if a solver is in its first integration step and false otherwise.

bool ODE_SOLVER::AcceptedStep ( ) const [inline]
 

Is a step accepted.

Returns:
true if the solver has accepted the most recent step and false otherwise

void ODE_SOLVER::InitSolver ( ) [protected, pure virtual]
 

Initializes a solver.

Reimplemented in VODE_SOLVER.

void ODE_SOLVER::SetErrors ( double t,
const INTERVAL_VECTOR & Y ) [protected]
 

Sets errors.

This function sets relative and absolute error during an integration.

Parameters:
t   integration point
Y   tight enclosure of the solution at t.


Friends And Related Function Documentation

template<classT>
T * GetDataRepr ( const PtrODESolver Solver ) [friend]
 

Return a pointer to a DATA_REPR object.

Given a pointer to an ODE_SOLVER object, this function casts the pointer to its data representation object to a pointer of type T.

Parameters:
Solver   a pointer to an ODE_SOLVER object
Precondition:
NotNull(Solver)


Member Data Documentation

PtrODENumeric ODE_SOLVER::ODE [protected]
 

Pointer to an object representing the numerical problem.

PtrDataRepr ODE_SOLVER::DataRepr [protected]
 

Pointer to an object that contains a data representation object.

PtrStepCtrl ODE_SOLVER::StepControl [protected]
 

Pointer to an object that implements stepsize control.

PtrSolverFlags ODE_SOLVER::SolverFlags [protected]
 

Pointer to an object that updates control flags.

PtrSolverStats ODE_SOLVER::SolverStats [protected]
 

Pointer to an object that updates statistics.


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 12:45:41 2001 for VNODE by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000