# siconos.kernel.OneStepIntegrator (Python class)¶

class siconos.kernel.OneStepIntegrator(*args)[source]

Bases: object

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

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

At the time, available integrators are:

• EulerMoreauOSI
• MoreauJeanOSI
• MoreauJeanCombinedProjectionOSI
• MoreauJeanDirectProjectionOSI
• MoreauJeanBilbaoOSI
• D1MinusLinearOSI
• SchatzmanPaoliOSI
• LsodarOSI
• Hem5OSI
• NewMarkAlphaOSI
• ZeroOrderHoldOSI

Generated class (swig), based on C++ header Program listing for file kernel/src/simulationTools/OneStepIntegrator.hpp.

addInteractionInIndexSet(Interaction inter, int i) → bool[source]

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

Parameters: inter – i – bool
checkOSI(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

checkOSI(DynamicalSystemsGraph::VIterator dsi) → bool[source]

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.
checkOSI(DynamicalSystemsGraph::VDescriptor dsgv) → bool[source]

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.
computeFreeOutput(InteractionsGraph::VDescriptor vertex_inter, OneStepNSProblem *osnsp) → None[source]

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
computeFreeState() → None[source]

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

computeInitialNewtonState() → None[source]

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

computeResidu() → double[source]

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

Returns: a double
computeResiduInput(double time, InteractionsGraph indexSet) → double[source]

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
computeResiduOutput(double time, InteractionsGraph indexSet) → double[source]

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
display() → void[source]

display()=0 -> None

print the data to the screen

dynamicalSystemsGraph() → DynamicalSystemsGraph[source]

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

Returns: a SP::DynamicalSystemsGraph
explicitJacobiansOfRelation() → bool[source]
extraAdditionalTerms() → ExtraAdditionalTerms[source]

getSizeMem() → int[source]

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

Returns: an unsigned int
getType() → OSI::TYPES[source]

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

Returns: int
initialize() → None[source]

initialise the integrator

initializeWorkVectorsForDS(t: double, ds: SP::DynamicalSystem) → void[source]

initializeWorkVectorsForDS(double t, DynamicalSystem ds)=0 -> None

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
initializeWorkVectorsForInteraction(inter: Interaction, interProp: InteractionProperties &, DSG: DynamicalSystemsGraph) → void[source]

initializeWorkVectorsForInteraction(Interaction inter, InteractionProperties interProp, DynamicalSystemsGraph DSG)=0 -> None

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
initialize_nonsmooth_problems() → None[source]

Initialization process of the nonsmooth problems linked to this OSI.

integrate(tinit: double &, tend: double &, tout: double &, idid: int &) → void[source]

integrate(double tinit, double tend, double tout, int idid)=0 -> None

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
isInitialized() → bool[source]
levelMaxForInput() → int[source]

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

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

levelMaxForOutput() → int[source]

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

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

levelMinForInput() → int[source]

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

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

levelMinForOutput() → int[source]

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

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

numberOfIndexSets() → unsigned int[source]

numberOfIndexSets() =0 -> int

get the number of index sets required for the simulation

Returns: unsigned int
prepareNewtonIteration(time: double) → void[source]

prepareNewtonIteration(double time)=0 -> None

removeInteractionFromIndexSet(Interaction inter, int i) → bool[source]

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

Parameters: inter – i – bool
resetAllNonSmoothParts() → None[source]

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

resetNonSmoothPart(int level) → None[source]

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

Parameters: level –
setDynamicalSystemsGraph(DynamicalSystemsGraph dsg) → None[source]

set the graph of dynamical systems associated with the Integrator

setExplicitJacobiansOfRelation(bool newval) → None[source]
setExtraAdditionalTerms(ExtraAdditionalTerms eat) → None[source]

set the ExtraAdditionalTerms to add smooth terms for the integration process.

Useful when a control loop is added to a DynamicalSystem.

Parameters: eat – the ExtraAdditionalTerms to use
setIsInitialized(bool value) → None[source]
setSimulationPtr(Simulation newS) → None[source]

set the Simulation of the OneStepIntegrator

Parameters: newS – a pointer to Simulation
simulation() → Simulation[source]

get the Simulation that owns the OneStepIntegrator (pointer link)

Returns: a pointer to Simulation
updateInput(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

updateInput(double time) → None[source]

update the input of the Interaction attached to this Integrator

updateInput(double time, int level) → None[source]

update the input of the Interaction attached to this Integrator

Parameters: time – current time level – level of interest for the dynamics
updateOutput(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

updateOutput(double time) → None[source]

update the output of the Interaction attached to this Integrator

updateOutput(double time, int level) → None[source]

update the output of the Interaction attached to this Integrator

Parameters: time – current time level – level of interest for the dynamics
updateState(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

updateState( int level)=0 -> None

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
updateState() → None[source]

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

update_interaction_output(Interaction inter, double time, InteractionProperties interaction_properties) → None[source]

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