fortranODEfunction Class Reference

A wrapper class for a VectorFunction instance that allows its evaluate(...) method to be accessed using a function prototype of the form int (*f)(double*t, double*y, double*yp). More...

List of all members.

Static Public Member Functions

static int f (double *, double *y, double *yp)
static void setDimension (long idim)
 Sets the dimension of the VectorFunction argument.
static void setFunction (VectorFunction *Fptr)
 Sets the VectorFunction instance whose evaluate(...) member function will be called.

Static Public Attributes

static VectorFunction * fODE
static DoubleVector Vin
static DoubleVector Vout


Detailed Description

A wrapper class for a VectorFunction instance that allows its evaluate(...) method to be accessed using a function prototype of the form int (*f)(double*t, double*y, double*yp).

This function prototype is that required by the f2c translation of rkf45, a Runge-Kutta-Fehlberg 45 implementation.

Since the VectorFunction class has no explicit t dependence, the t argument is ignored in the evaluation process.

yp is determined from y using the evaluate member function of the associated VectorFunction.

Typical use:

  1. Set the dimension
  2. Set the associated VectorFunction (or class derived from VectorFunction)
  3. Pass the function fortranODEfunction::f to the external routine.

Samples of setting the dimension and setting the function are

     fortranODEfunction::setDimension(2);
     fortranODEfunction::setFunction(&F);
   

The function fortranODEfunction::f has type int (*f)(double*, double*, double*) and so

 fortranODEfunction::f 

may be passed to function whose argument is a function pointer of that type.

Fortran routines require that the member function of a class passed into it be a static member function, hence there can only one instance of this class in use in a specific program.

Definition at line 61 of file fortranODEfunction.h.


The documentation for this class was generated from the following files:
Generated on Fri Jan 23 08:16:07 2009 for RKF45 by  doxygen 1.5.1-p1