File kernel/src/simulationTools/SchatzmanPaoliOSI.hpp

Contents

File kernel/src/simulationTools/SchatzmanPaoliOSI.hpp#

Go to the source code of this file

SchatzmanPaoliOSI Time-Integrator for Dynamical Systems

Variables

const unsigned int SCHATZMANPAOLISTEPSINMEMORY = 2#
class SchatzmanPaoliOSI : public OneStepIntegrator
#include <SchatzmanPaoliOSI.hpp>

SchatzmanPaoliOSI Time-Integrator for Dynamical Systems.

SchatzmanPaoliOSI class is used to define some time-integrators methods for a list of dynamical systems.

A SchatzmanPaoliOSI instance is defined by the value of theta and the list of concerned dynamical systems. Each DynamicalSystem is associated to a SiconosMatrix, named “W”

W matrices are initialized and computed in initializeIterationMatrixW and computeW. Depending on the DS type, they may depend on time and DS state (x).

For Lagrangian systems, the implementation uses _p[0] for storing the discrete multiplier.

Main functions:

  • computeFreeState(): computes xfree (or vfree), dynamical systems state without taking non-smooth part into account

  • updateState(): computes x (q,v), the complete dynamical systems states.

Public Types

enum SchatzmanPaoliOSI_ds_workVector_id#

Values:

enumerator RESIDU_FREE#
enumerator FREE#
enumerator LOCAL_BUFFER#
enumerator WORK_LENGTH#
enum SchatzmanPaoliOSI_interaction_workVector_id#

Values:

enumerator OSNSP_RHS#
enumerator WORK_INTERACTION_LENGTH#
enum SchatzmanPaoliOSI_workBlockVector_id#

Values:

enumerator xfree#
enumerator BLOCK_WORK_LENGTH#

Public Functions

SchatzmanPaoliOSI(double theta)

constructor from theta value only

Parameters:

theta – value for all these DS.

SchatzmanPaoliOSI(double theta, double gamma)

constructor from theta value only

Parameters:
  • theta – value for all these DS.

  • gamma – value for all these DS.

inline virtual ~SchatzmanPaoliOSI()

destructor

const SimpleMatrix getW(SP::DynamicalSystem ds = SP::DynamicalSystem())

get the value of W corresponding to DynamicalSystem ds

Parameters:

ds – a pointer to DynamicalSystem, optional, default = nullptr. get W[0] in that case

Returns:

SimpleMatrix

SP::SimpleMatrix W(SP::DynamicalSystem ds)

get W corresponding to DynamicalSystem ds

Parameters:

ds – a pointer to DynamicalSystem, optional, default = nullptr. get W[0] in that case

Returns:

pointer to a SiconosMatrix

void setW(const SiconosMatrix &newValue, SP::DynamicalSystem ds)

set the value of W[ds] to newValue

Parameters:
void setWPtr(SP::SimpleMatrix newPtr, SP::DynamicalSystem ds)

set W[ds] to pointer newPtr

Parameters:
const SimpleMatrix getWBoundaryConditions(SP::DynamicalSystem ds = SP::DynamicalSystem())

get the value of WBoundaryConditions corresponding to DynamicalSystem ds

Parameters:

ds – a pointer to DynamicalSystem, optional, default = nullptr. get WBoundaryConditions[0] in that case

Returns:

SimpleMatrix

SP::SiconosMatrix WBoundaryConditions(SP::DynamicalSystem ds)

get WBoundaryConditions corresponding to DynamicalSystem ds

Parameters:

ds – a pointer to DynamicalSystem, optional, default = nullptr. get WBoundaryConditions[0] in that case

Returns:

pointer to a SiconosMatrix

inline double theta()

get theta

Returns:

a double

inline void setTheta(double newTheta)

set the value of theta

Parameters:

newTheta – a double

inline double gamma()

get gamma

Returns:

a double

inline void setGamma(double newGamma)

set the value of gamma

Parameters:

newGamma – a double

inline bool useGamma()

get bool useGamma

Returns:

a bool

inline void setUseGamma(bool newUseGamma)

set the boolean to indicate that we use gamma

Parameters:

newUseGamma – a bool

inline bool useGammaForRelation()

get bool gammaForRelation for the relation

Returns:

a

inline void setUseGammaForRelation(bool newUseGammaForRelation)

set the boolean to indicate that we use gamma for the relation

Parameters:

newUseGammaForRelation – a bool

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

void initializeIterationMatrixW(double time, SP::DynamicalSystem ds)

initialize iteration matrix W SchatzmanPaoliOSI matrix at time t

Parameters:
void computeW(double time, SP::DynamicalSystem ds, SiconosMatrix &W)

compute W SchatzmanPaoliOSI matrix at time t

Parameters:
  • time – the time (double)

  • ds – a pointer to DynamicalSystem

  • W – the matrix to compute

void computeWBoundaryConditions(SP::DynamicalSystem ds, SiconosMatrix &WBoundaryConditions)

compute WBoundaryConditionsMap[ds] SchatzmanPaoliOSI matrix at time t

Parameters:
  • ds – a pointer to DynamicalSystem

  • WBoundaryConditions – write the result in WBoundaryConditions

void initializeIterationMatrixWBoundaryConditions(SP::DynamicalSystem ds, const DynamicalSystemsGraph::VDescriptor &dsv)

initialize iteration matrix WBoundaryConditionsMap[ds] SchatzmanPaoliOSI

Parameters:
  • ds – a pointer to DynamicalSystem

  • dsv – a descriptor of the ds on the graph (redundant to avoid invocation)

virtual double computeResidu() override

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

Returns:

a double

virtual void computeFreeState() override

integrates the Dynamical System linked to this integrator without boring the constraints

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 prepareNewtonIteration(double time) override#
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 – useless flag (for SchatzmanPaoliOSI, 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 the time

virtual void display() override

Displays the data of the SchatzmanPaoliOSI’s integrator.

ACCEPT_STD_VISITORS()#

Protected Functions

ACCEPT_SERIALIZATION(SchatzmanPaoliOSI)#
inline SchatzmanPaoliOSI()#

Default constructor.

Protected Attributes

double _theta#

Stl map that associates a theta parameter for the integration scheme to each DynamicalSystem of the OSI.

double _gamma#

A gamma parameter for the integration scheme to each DynamicalSystem of the OSI This parameter is used to apply a theta-method to the input $r$.

bool _useGamma#

a boolean to known is the parameter must be used or not

bool _useGammaForRelation#

a boolean to known is the parameter must be used or not

Friends

friend struct _NSLEffectOnFreeOutput