Class LsodarOSI

Defined in Program listing for file kernel/src/simulationTools/LsodarOSI.hpp

class LsodarOSI : public OneStepIntegrator

LsodarOSI solver (odepack)

Many parameters are required as input/output for LSODAR. See the documentation of this function in externals/odepack/opkdmain.f to have a full description of these parameters.

Most of them are read-only parameters (ie can not be set by user).

Except:

  • jt: Jacobian type indicator (1 means a user-supplied full Jacobian, 2 means an internally generated full Jacobian).

    Default = 2.

  • itol, rtol and atol

    ITOL = an indicator for the type of error control.

    RTOL = a relative error tolerance parameter, either a scalar or array of length NEQ.

    ATOL = an absolute error tolerance parameter, either a scalar or an array of length NEQ. Input only.

Public Functions

LsodarOSI()

Default constructor.

~LsodarOSI()

destructor

ACCEPT_STD_VISITORS()

visitors hook

virtual void computeFreeOutput(InteractionsGraph::VDescriptor &vertex_descr, OneStepNSProblem *osnsp)

integrates the Interaction linked to this integrator, without taking non-smooth effects into account

Parameters
  • vertex_descr: descriptor vertex of the interaction graph
  • osnsp: pointer to OneStepNSProblem

void computeJacobianRhs(double t, DynamicalSystemsGraph &DSG0)

compute jacobian of the rhs at time t for all dynamical systems in the set

Parameters

void computeRhs(double t)

compute rhs(t) for all dynamical systems in the set

Parameters
  • t: current time of simulation

void display()

print the data to the screen

void fillXWork(integer *size, doublereal *array)

fill xWork with a doublereal

Parameters
  • size: size of x array
  • array: x array of double

const SA::doublereal getAtol() const

get absolute tolerance parameter for lsodar

Return
a doublereal*

SA::integer getIwork() const

get iwork

Return
a pointer to integer

SA::integer getJroot() const

get output of root information

Return
a pointer to integer

int getMaxNstep() const

get the maximum number of steps for one call

Return
an interger

const SA::doublereal getRtol() const

get relative tolerance parameter for lsodar

Return
a doublereal*

const SA::doublereal getRwork() const

get real work vector parameter for lsodar

Return
a doublereal*

void initialize()

initialization of the integrator

void initializeWorkVectorsForDS(double t, SP::DynamicalSystem ds)

initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi

Parameters
  • t: time of initialization
  • ds: the dynamical system

void initializeWorkVectorsForInteraction(Interaction &inter, InteractionProperties &interProp, DynamicalSystemsGraph &DSG)

initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi

Parameters
  • inter: the interaction
  • interProp: the properties on the graph
  • DSG: the dynamical systems graph

const std::vector<integer> intData() const

get vector of integer parameters for lsodar

Return
a vector<integer>

integer intData(unsigned int i) const

get _intData[i]

Return
an integer
Parameters
  • i: index number (starting from 0)

void integrate(double &tinit, double &tend, double &tout, int &ioparam)

integrate the system, between tinit and tend (->iout=true), with possible stop at tout (->iout=false)

Parameters
  • tinit: initial time
  • tend: end time
  • tout: real end time
  • ioparam: in-out parameter, input: 1 for first call, else 2. Output: 2 if no root was found, else 3.

unsigned int numberOfIndexSets() const

get the number of index sets required for the simulation

Return
unsigned int

void setIntData(unsigned int i, int newValue)

set _intData[i]

Parameters
  • i: index number (starting from 0)
  • newValue: the new value

void setJT(integer newJT)

set Jt value, Jacobian type indicator.

Excerpts from the lsodar documentation. 1 means a user-supplied full (neq by neq) jacobian. 2 means an internally generated (difference quotient) full jacobian (using neq extra calls to f per df/dy value). 4 means a user-supplied banded jacobian. 5 means an internally generated banded jacobian (using ml+mu+1 extra calls to f per df/dy evaluation). if jt = 1 or 4, the user must supply a subroutine jac (the name is arbitrary) as described above under jac. if jt = 2 or 5, a dummy argument can be used.

Parameters
  • newJT: new value for the jt parameter.

void setMaxNstep(integer maxNumberSteps)

set the maximum number of steps for one call of Lsodar

Parameters
  • maxNumberSteps: the maximum number of steps

void setMaxOrder(integer maxorderNonStiff, integer maxorderStiff)

set maximum method order

Parameters
  • maxorderNonStiff: maximum order for nonstiff methods
  • maxorderStiff: maximum order for stiff methods

void setMinMaxStepSizes(doublereal minStep, doublereal maxStep)

set the minimum and maximum step sizes

Parameters
  • minStep: minimum step size
  • maxStep: maximum step size

void setTol(integer newItol, SA::doublereal newRtol, SA::doublereal newAtol)

set itol, rtol and atol (tolerance parameters for lsodar)

Parameters
  • newItol: itol value
  • newRtol: rtol value
  • newAtol: atol value

void setTol(integer newItol, doublereal newRtol, doublereal newAtol)

set itol, rtol and atol (scalar tolerance parameters for lsodar)

Parameters
  • newItol: itol value
  • newRtol: rtol value
  • newAtol: atol value

void updateData()

update doubleData and iwork memory size, when changes occur in _intData.

void updateState(const unsigned int level)

update the state of the DynamicalSystems attached to this Integrator

Parameters
  • level: level of interest for the dynamics

Public Static Functions

static int count_rhs_call()

Return current number of rhs call (for all lsodar-like OSIs!)

Return
int

static int count_steps()

Return the number of lsodar steps already done (for all lsodar-like OSIs!)

Return
int

Public Static Attributes

int count_NFE

Number of RHS evaluations for the problem so far.

int count_NST

Lsodar counter : Number of steps taken for the problem so far.