siconos.kernel.NonSmoothDynamicalSystem (Python class)

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

Bases: object

the NonSmoothDynamicalSystem consists in Dynamical Systems and Interactions structured into a graph defined in a Topology.

In the DynamicalSystem graph, DynamicalSystem objects are nodes and Interaction objects are edges.

To add a DynamicalSystem, use insertDynamicalSystem method. To add a new Interaction, use link method.

A dual graph is also contructed, where Interactions are vertices and DynamicalSystems are edges.

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

Constructors

NonSmoothDynamicalSystem()

default constructor

NonSmoothDynamicalSystem(double t0, double T)

constructor with t0 and T

Parameters:
  • t0 – initial time
  • T – final time
author() → str[source]

get the author of the simulation

Returns:std::string (the author)
changeLog() → ChangeLog[source]

get a reference to the changelog for an NSDS.

Returns:a reference to the changelog.
changeLogBegin() → ChangeLogIter[source]

get an iterator to the beginning of the changelog.

Returns:an iterator pointing at the beginning of the changelog.
changeLogPosition() → ChangeLogIter[source]

get an iterator to the last item in the changelog.

Returns:an iterator pointing at the last item in the changelog.
clear() → None[source]
clearChangeLogTo(ChangeLogIter it) → None[source]

clear the changelog up to a given position.

Parameters:it – This iterator must point to somewhere in the changelog for this NSDS.
computeInteractionJacobians(*args)[source]

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

computeInteractionJacobians(double time) → None[source]

compute Jacobians for all the interactions (in indexSet0)

Parameters:time
computeInteractionJacobians(double time, InteractionsGraph indexSet) → None[source]

compute Jacobians for all the interactions of a given index set.

Parameters:
  • time
  • indexSet – InteractionsGraph of interest
currentTime() → double[source]

get the current time

Returns:a double
date() → str[source]

allows to get the date of the simulation

Returns:std::string (the date)
description() → str[source]

allows to get the description of the simulation

Returns:std::string (the description)
display() → None[source]

display the data of the Non Smooth Dynamical System

dynamicalSystem(int nb) → DynamicalSystem[source]

get Dynamical system number I

Parameters:nb – the identifier of the DynamicalSystem to get
Returns:a pointer on DynamicalSystem
dynamicalSystems() → DynamicalSystemsGraph[source]

get all the dynamical systems declared in the NonSmoothDynamicalSystem.

Returns:a SP::DynamicalSystemsGraph
finalT() → double[source]

get final time

Returns:a double
getNumberOfDS() → int[source]

get the number of Dynamical Systems present in the NSDS

Returns:an unsigned int
getNumberOfInteractions() → int[source]

get the number of Interactions present in the NSDS.

Returns:an unsigned int
insertDynamicalSystem(DynamicalSystem ds) → None[source]

add a dynamical system into the DS graph (as a vertex)

Parameters:ds – a pointer to the system to add
interaction(*args)[source]

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

interaction(int nb) → Interaction[source]

get Interaction number I

Parameters:nb – the identifier of the Interaction to get
Returns:a pointer to an Interaction
interaction(str name) → Interaction[source]

get Interaction named name

Parameters:name – of the Interaction to get
Returns:a pointer to an Interaction
interactions() → InteractionsGraph[source]

return the graph of Interactions present in the NSDS.

Returns:SP::InteractionGraph
isBVP() → bool[source]

get problem type (true if BVP)

Returns:a bool
isIVP() → bool[source]

get problem type (true if IVP)

Returns:a bool
isLinear() → bool[source]

return false is one of the interations is not linear.

else return true.

Returns:a bool

link an interaction to two dynamical systems

Parameters:
  • inter – the interaction
  • ds1 – a DynamicalSystem
  • ds2 – a DynamicalSystem (optional)
name(*args)[source]

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

name(DynamicalSystem ds) → str[source]

get the name for this Dynamical System

Parameters:ds – a pointer to the system
Returns:name the name of the DynamicalSystem, or empty string if not found.
name(Interaction inter) → str[source]

get the name for this Interaction

Parameters:inter – a pointer to the Interaction
Returns:name the name of the Interaction, or empty string if not found.
pushInteractionsInMemory() → None[source]

save interaction states in memories.

Applied to all interactions of the connected topology

removeDynamicalSystem(DynamicalSystem ds) → None[source]

remove a dynamical system

Parameters:ds – a pointer to the dynamical system to remove
removeInteraction(Interaction inter) → None[source]

remove an interaction to the system

Parameters:inter – a pointer to the interaction to remove
reset(*args)[source]

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

reset() → None[source]

Set all DS non-smooth part to zero.

reset(int level) → None[source]

Set all DS non-smooth part to zero for a given level.

Parameters:level – the level to will be zeroed
setAuthor(str s) → None[source]

set the author of the simulation

Parameters:s – std::string : the author
setBVP(bool newBvp) → None[source]

set the NonSmoothDynamicalSystem to BVP, else it is IVP

Parameters:newBvp – true if BVP, false otherwise
setControlProperty(Interaction inter, bool isControlInteraction) → None[source]

specify id the given Interaction is for controlling the DS

Parameters:
  • inter – the Interaction
  • isControlInteraction – true if the Interaction is used for control purposes
setCurrentTime(double newValue) → None[source]

set the current time

Parameters:newValue – the new time
setDate(str s) → None[source]

set the date of the simulation

Parameters:s – std::string : the date
setDescription(str s) → None[source]

set the author of the simulation

Parameters:s – std::string : the author
setName(*args)[source]

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

setName(DynamicalSystem ds, str name) → None[source]

set the name for this Dynamical System

Parameters:
  • ds – a pointer to the system
  • name – the name of the DynamicalSystem
setName(Interaction interaction, str name) → None[source]

set the name for this Interaction

Parameters:
  • interaction – a pointer to the Interaction
  • name – the name of the Interaction
setSymmetric(bool val) → None[source]

set symmetry in the blocks computation

Parameters:val – a bool
setT(double newValue) → None[source]

set final time

Parameters:newValue – the new final time for the Simulatiom
setTitle(str s) → None[source]

set the title of the simulation

Parameters:s – : the title
sett0(double newT0) → None[source]

set initial time of the time discretisation

Parameters:newT0
swapInMemory() → None[source]

save DynamicalSystems and Interactions states in Memories

t0() → double[source]

get initial time

Returns:a double
title() → str[source]

get the title of the simulation

Returns:std::string (the title)
topology() → Topology[source]

get the topology of the system

Returns:a pointer on Topology
updateInput(double time, int level) → None[source]

compute r thanks to lambda[level] for all Interactions

Parameters:
  • time
  • level – lambda level
updateOutput(*args)[source]

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

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

compute output for all the interactions for a given level

Parameters:
  • time
  • level – y order to be computed
updateOutput(double time, int level_min, int level_max) → None[source]

compute output for all the interactions and for a level range

Parameters:
  • time
  • level_min – y min order to be computed
  • level_max – y max order to be computed
visitDynamicalSystems(SiconosVisitor visitor) → None[source]

visit all dynamical systems in this system.

Parameters:visitor – an SP::SiconosVisitor that can visit classes derived from DS