File kernel/src/simulationTools/ZeroOrderHoldOSI.hpp

Contents

File kernel/src/simulationTools/ZeroOrderHoldOSI.hpp#

Go to the source code of this file

Time-Integrator for linear dynamical systems using the Zero-Order Hold (ZOH) method

Variables

const unsigned int ZOHSTEPSINMEMORY = 1#
class ZeroOrderHoldOSI : public OneStepIntegrator
#include <ZeroOrderHoldOSI.hpp>

ZeroOrderHoldOSI Time-Integrator for Dynamical Systems.

See User’s guide for details.

ZeroOrderHoldOSI class is used to define some time-integrators methods for a list of dynamical systems. A ZeroOrderHoldOSI instance is defined by the value of theta and the list of concerned dynamical systems. Each DynamicalSystem is associated to

  • computeFreeState(): computes xfree of dynamical systems state without taking the non-smooth part into account

  • updateState(): update the state x of the dynamical systems

Public Types

enum ZeroOrderHoldOSI_ds_workVector_id#

Values:

enumerator RESIDU_FREE#
enumerator FREE#
enumerator DELTA_X_FOR_RELATION#
enumerator WORK_LENGTH#
enum ZeroOrderHoldOSI_interaction_workVector_id#

Values:

enumerator OSNSP_RHS#
enumerator H_ALPHA#
enumerator WORK_INTERACTION_LENGTH#
enum ZeroOrderHoldOSI_interaction_workBlockVector_id#

Values:

enumerator xfree#
enumerator DELTA_X#
enumerator BLOCK_WORK_LENGTH#

Public Functions

ZeroOrderHoldOSI()

basic constructor

inline virtual ~ZeroOrderHoldOSI()

destructor

const SiconosMatrix &Ad(SP::DynamicalSystem ds)

get \( \Phi \) corresponding to DynamicalSystem ds

Parameters:

ds – the DynamicalSystem

Returns:

pointer to a SiconosMatrix

const SiconosMatrix &Bd(SP::DynamicalSystem ds)

get \( B_d \) corresponding to DynamicalSystem ds

Parameters:

ds – the DynamicalSystem

Returns:

pointer to a SiconosMatrix

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 double computeResidu() override

return the maximum of all norms for the “ZeroOrderHoldOSI-discretized” residus of DS

Returns:

a double

virtual void computeFreeState() override

Perform the integration of the dynamical systems linked to this integrator without taking into account the nonsmooth input (_r or _p)

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

Compute the Output (y) which corresponds to the free state (state without taking into account the nonsmooth input) plus the possible contribution of the nslaw.

Parameters:
  • vertex_inter – of the interaction graph

  • osnsp – a pointer to the 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 bool addInteractionInIndexSet(SP::Interaction inter, unsigned int i) override

Apply the rule to one Interaction to known if is it should be included in the IndexSet of level i.

Parameters:
  • inter – a pointer to the Interaction to be added

  • i – the level of the IndexSet

Returns:

true if y<=0

virtual bool removeInteractionFromIndexSet(SP::Interaction inter, unsigned int i) override

Apply the rule to one Interaction to known if is it should be removed in the IndexSet of level i.

Parameters:
  • inter – a pointer to the Interaction to be removed

  • i – the level of the IndexSet

Returns:

true if y>0

virtual void prepareNewtonIteration(double time) override

Unused.

Parameters:

time – current time

virtual void integrate(double &tinit, double &tend, double &tout, int &notUsed) 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

  • notUsed – useless flag (for ZeroOrderHoldOSI, used in LsodarOSI)

virtual void updateState(const unsigned int level) override

updates the state of the Dynamical Systems

Parameters:

level – level of interest for the dynamics: not used at this moment

virtual void display() override

Displays the data of the ZeroOrderHoldOSI’s integrator.

void updateMatrices(SP::DynamicalSystem ds)#
ACCEPT_STD_VISITORS()#

Protected Functions

ACCEPT_SERIALIZATION(ZeroOrderHoldOSI)#

Protected Attributes

bool _useGammaForRelation#

Unused for now.

Friends

friend struct _NSLEffectOnFreeOutput