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()#

Default and only constructor.

~Hem5OSI() noexcept = default#

destructor

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

get vector of int parameters for lsodar

Returns:

a vector<int>

inline int intData(unsigned int i) const#

get _intData[i]

Parameters:

i – index

Returns:

an int

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

set _intData[i]

Parameters:
  • i – index

  • newValue

inline const std::vector<double> &getRtol() const#
Returns:

relative tolerance parameter for Hem5

inline const std::vector<double> &getAtol() const#
Returns:

absolute tolerance parameter for Hem5

inline int getMaxNstep() const#

get the maximum number of steps for one call

Returns:

an interger

inline const std::vector<double> &getRwork() const#
Returns:

real work vector parameter for lsodar

inline const std::vector<int> &getIwork() const#
Returns:

iwork

void setTol(int itol, std::vector<double> &&rtol, std::vector<double> &&atol)#

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

Parameters:
  • itol – int (itol value)

  • rtol – double * (rtol)

  • atol – double * (atol)

void setTol(int itol, double rtol, double atol)#

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

Parameters:
  • itol – int (itol value)

  • rtol – double (rtol)

  • atol – double (atol)

void setMaxNstep(int nstepmax)#

set the maximul number of steps for one call of Hem5OSI

Parameters:

nstepmax – an int

void setMaxStepSize(double 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(int *sizex, double *x)#

fill qWork with a double

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

  • x – double* x:array of double

void fillvWork(int *sizex, double *x)#

fill vWork with a double

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

  • x – double* 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