Class Hem5OSI#

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

class Hem5OSI : public OneStepIntegrator#

Hem5OSI 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

Hem5OSI()#

constructor from a minimum set of data

inline ~Hem5OSI()#

destructor

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

get vector of integer parameters for lsodar

Returns:

a vector<integer>

inline integer intData(unsigned int i) const#

get _intData[i]

Parameters:

i – index

Returns:

an integer

inline void setIntData(unsigned int i, int newValue)#

set _intData[i]

Parameters:
  • i – index

  • newValue

inline const SA::doublereal getRtol() const#

get relative tolerance parameter for Hem5

Returns:

a doublereal*

inline const SA::doublereal getAtol() const#

get absolute tolerance parameter for Hem5

Returns:

a doublereal*

inline int getMaxNstep() const#

get the maximum number of steps for one call

Returns:

an interger

inline const SA::doublereal getRwork() const#

get real work vector parameter for lsodar

Returns:

a doublereal*

inline SA::integer getIwork() const#

get iwork

Returns:

a pointer to integer

void setTol(integer itol, SA::doublereal rtol, SA::doublereal atol)#

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

Parameters:
  • itol – integer (itol value)

  • rtol – doublereal * (rtol)

  • atol – doublereal * (atol)

void setTol(integer itol, doublereal rtol, doublereal atol)#

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

Parameters:
  • itol – integer (itol value)

  • rtol – double (rtol)

  • atol – double (atol)

void setMaxNstep(integer nstepmax)#

set the maximul number of steps for one call of Hem5OSI

Parameters:

nstepmax – an integer

void setMaxStepSize(doublereal maxstepsize)#

set the minimum and maximum step sizes

Parameters:

maxstepsize – double (maximul step size)

void updateIntData()#

update _intData

void updateData()#

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

void fillqWork(integer *sizex, doublereal *x)#

fill qWork with a doublereal

Parameters:
  • sizex – integer*, size of x array

  • x – doublereal* x:array of double

void fillvWork(integer *sizex, doublereal *x)#

fill vWork with a doublereal

Parameters:
  • sizex – integer*, size of x array

  • x – doublereal* x:array of double

void computeRhs(double)#

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

void computeJacobianRhs(double)#

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

virtual void initialize() override#

initialization of the integrator

virtual void initializeWorkVectorsForDS(double t, SP::DynamicalSystem ds) override#

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

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

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

inline virtual unsigned int numberOfIndexSets() const override#

get the number of index sets required for the simulation

Returns:

unsigned int

virtual void integrate(double &tinit, double &tend, double &tout, int &idid) override#

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

  • idid – in-out parameter, input: 1 for first call, else 2. Output: 2 if no root was found, else 3.

virtual void updateState(const unsigned int level) override#

update the state of the DynamicalSystems attached to this Integrator

Parameters:

level – level of interest for the dynamics

virtual void computeFreeOutput(InteractionsGraph::VDescriptor &vertex_inter, OneStepNSProblem *osnsp) override#

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

Parameters:
  • vertex_inter – of the interaction graph

  • osnsp – pointer to OneStepNSProblem

inline virtual SiconosVector &osnsp_rhs(InteractionsGraph::VDescriptor &vertex_inter, InteractionsGraph &indexSet) override#

return the workVector corresponding to the right hand side of the OneStepNonsmooth problem

virtual void display() override#

print the data to the screen