# Class OneStepIntegrator¶

class OneStepIntegrator : public std::enable_shared_from_this<OneStepIntegrator>

Generic class to manage DynamicalSystem(s) time-integration.

!!! This is a virtual class, interface for some specific integrators !!!

At the time, available integrators are:

Attributes access

OSI::TYPES getType() const

id of the integrator (see list in OSI::TYPES enum)

Return

int

SP::DynamicalSystemsGraph dynamicalSystemsGraph() const

get the graph of dynamical systems associated with the Integrator warning: returns the whole ds graph, not only ds integrated by the present osi.

Return

a SP::DynamicalSystemsGraph

void setDynamicalSystemsGraph(SP::DynamicalSystemsGraph dsg)

set the graph of dynamical systems associated with the Integrator

unsigned int getSizeMem() const

get number of internal memory vectors needed in dynamical systems integrated with this osi.

Return

an unsigned int

SP::Simulation simulation() const

get the Simulation that owns the OneStepIntegrator (pointer link)

Return

a pointer to Simulation

void setSimulationPtr(SP::Simulation newS)

set the Simulation of the OneStepIntegrator

Parameters

virtual unsigned int levelMinForOutput()

minimal level required for output var used with this integration scheme.

var[level] is the derivative of order ‘level’ of var.

virtual unsigned int levelMaxForOutput()

maximal level required for output var used with this integration scheme.

var[level] is the derivative of order ‘level’ of var.

virtual unsigned int levelMinForInput()

minimal level required for input var used with this integration scheme.

var[level] is the derivative of order ‘level’ of var.

virtual unsigned int levelMaxForInput()

maximal level required for input var used with this integration scheme.

var[level] is the derivative of order ‘level’ of var.

virtual unsigned int numberOfIndexSets() const = 0

get the number of index sets required for the simulation

Return

unsigned int

internal memory (graph properties) management

virtual void initialize()

initialise the integrator

virtual void initialize_nonsmooth_problems()

Initialization process of the nonsmooth problems linked to this OSI.

virtual void initializeWorkVectorsForDS(double t, SP::DynamicalSystem ds) = 0

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) = 0

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

Computation functions

void update_interaction_output(Interaction &inter, double time, InteractionProperties &interaction_properties)

compute interaction output (y) for all levels and swaps in memory

Parameters
• inter: the interaction to update

• time: value for output computation

• interaction_properties: properties of the interaction, in the Interaction Graph I0

virtual void computeInitialNewtonState()

compute the initial state (for dynamical system variables) of the Newton loop.

virtual double computeResidu()

return the maximum of all norms for the discretized residus of DS

Return

a double

virtual void computeFreeState()

integrates the Dynamical System linked to this integrator, without taking constraints into account.

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

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

virtual double computeResiduOutput(double time, SP::InteractionsGraph indexSet)

compute the residu of the output of the relation (y) This computation depends on the type of OSI

Parameters
• time: time of computation

• indexSet: the index set of the interaction that are concerned

virtual double computeResiduInput(double time, SP::InteractionsGraph indexSet)

compute the residu of the input of the relation (R or p) This computation depends on the type of OSI

Parameters
• time: time of computation

• indexSet: the index set of the interaction that are concerned

virtual void integrate(double &tinit, double &tend, double &tout, int &idid) = 0

integrate the system, between tinit and tend, with possible stop at tout

Parameters
• tinit: start time

• tend: expected end time

• tout: real end time

• idid: extra flag, meaningful only for OSI used in EventDriven schemes

void resetAllNonSmoothParts()

set to zero all the r vectors of the DynamicalSystems integrated by this OSI

void resetNonSmoothPart(unsigned int level)

set to zero all the r vectors of the DynamicalSystems of the present OSI for a given level

Parameters
• level:

virtual void updateState(const unsigned int level) = 0

update the state of the DynamicalSystem attached to this Integrator

Parameters
• level: level of interest for the dynamics level is set to 0 by default since in all time-stepping schemes we update all the state whatever the value of level

void updateState()

update the state of the DynamicalSystem attached to this Integrator level is set to 0 by default since in all time-stepping schemes we update all the state whatever the value of level

virtual void updateOutput(double time)

update the output of the Interaction attached to this Integrator

virtual void updateInput(double time)

update the input of the Interaction attached to this Integrator

virtual void updateOutput(double time, unsigned int level)

update the output of the Interaction attached to this Integrator

Parameters
• time: current time

• level: level of interest for the dynamics

virtual void updateInput(double time, unsigned int level)

update the input of the Interaction attached to this Integrator

Parameters
• time: current time

• level: level of interest for the dynamics

Misc

virtual void display() = 0

print the data to the screen

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

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

Return

bool

Parameters
• inter:

• i:

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

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

Return

bool

Parameters
• inter:

• i:

SP::ExtraAdditionalTerms extraAdditionalTerms()

Return

void setExtraAdditionalTerms(SP::ExtraAdditionalTerms eat)

Useful when a control loop is added to a DynamicalSystem.

Parameters
• eat: the ExtraAdditionalTerms to use

bool checkOSI(DynamicalSystemsGraph::VIterator dsi)

True if the dynamical system (a vertex in the ds graph) is integrated by this osi.

Parameters
• dsi: the iterator on the node of the graph corresponding to the dynamical system of interest.

bool checkOSI(DynamicalSystemsGraph::VDescriptor dsgv)

True if the dynamical system (a vertex in the ds graph) is integrated by this osi.

Parameters
• dsgv: the descriptor of the node in the graph corresponding to the dynamical system of interest.

Public Functions

virtual ~OneStepIntegrator()

destructor