Class NonSmoothDynamicalSystem

Defined in Program listing for file kernel/src/modelingTools/NonSmoothDynamicalSystem.hpp

class NonSmoothDynamicalSystem

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.

Public Functions

NonSmoothDynamicalSystem()

default constructor

NonSmoothDynamicalSystem(double t0, double T)

constructor with t0 and T

Parameters
  • t0: initial time
  • T: final time

~NonSmoothDynamicalSystem()

destructor

const std::string author() const

get the author of the simulation

Return
std::string : the author

const ChangeLog &changeLog()

get a reference to the changelog for an NSDS.

Return
a reference to the changelog.

ChangeLogIter changeLogBegin()

get an iterator to the beginning of the changelog.

Return
an iterator pointing at the beginning of the changelog.

ChangeLogIter changeLogPosition()

get an iterator to the last item in the changelog.

Return
an iterator pointing at the last item in the changelog.

void clearChangeLogTo(const ChangeLogIter &it)

clear the changelog up to a given position.

Parameters
  • it: This iterator must point to somewhere in the changelog for this NSDS.

void computeInteractionJacobians(double time)

compute Jacobians for all the interactions (in indexSet0)

Parameters
  • time:

void computeInteractionJacobians(double time, InteractionsGraph &indexSet)

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

Parameters
  • time:
  • indexSet: InteractionsGraph of interest

double currentTime() const

get the current time

Return
a double

const std::string date() const

allows to get the date of the simulation

Return
std::string : the date

const std::string description() const

allows to get the description of the simulation

Return
std::string : the description

void display() const

display the data of the Non Smooth Dynamical System

SP::DynamicalSystem dynamicalSystem(int nb) const

get Dynamical system number I

Return
a pointer on DynamicalSystem
Parameters

const SP::DynamicalSystemsGraph dynamicalSystems() const

get all the dynamical systems declared in the NonSmoothDynamicalSystem.

Return
a SP::DynamicalSystemsGraph

double finalT() const

get final time

Return
a double

unsigned int getNumberOfDS() const

get the number of Dynamical Systems present in the NSDS

Return
an unsigned int

unsigned int getNumberOfInteractions() const

get the number of Interactions present in the NSDS.

Return
an unsigned int

void insertDynamicalSystem(SP::DynamicalSystem ds)

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

Parameters
  • ds: a pointer to the system to add

SP::Interaction interaction(int nb) const

get Interaction number I

Return
a pointer to an Interaction
Parameters

SP::Interaction interaction(std::string name) const

get Interaction named name

Return
a pointer to an Interaction
Parameters

const SP::InteractionsGraph interactions() const

return the graph of Interactions present in the NSDS.

Return
SP::InteractionGraph

bool isBVP() const

get problem type (true if BVP)

Return
a bool

bool isIVP() const

get problem type (true if IVP)

Return
a bool

bool isLinear() const

return false is one of the interations is not linear.

else return true.

Return
a bool

void link(SP::Interaction inter, SP::DynamicalSystem ds1, SP::DynamicalSystem ds2 = SP::DynamicalSystem())

link an interaction to two dynamical systems

Parameters

std::string name(SP::DynamicalSystem ds)

get the name for this Dynamical System

Return
name the name of the DynamicalSystem, or empty string if not found.
Parameters
  • ds: a pointer to the system

std::string name(SP::Interaction inter)

get the name for this Interaction

Return
name the name of the Interaction, or empty string if not found.
Parameters

void pushInteractionsInMemory()

save interaction states in memories.

Applied to all interactions of the connected topology

void removeDynamicalSystem(SP::DynamicalSystem ds)

remove a dynamical system

Parameters
  • ds: a pointer to the dynamical system to remove

void removeInteraction(SP::Interaction inter)

remove an interaction to the system

Parameters
  • inter: a pointer to the interaction to remove

void reset()

Set all DS non-smooth part to zero.

void reset(unsigned int level)

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

Parameters
  • level: the level to will be zeroed

void setAuthor(const std::string &s)

set the author of the simulation

Parameters
  • s: std::string : the author

void setBVP(const bool &newBvp)

set the NonSmoothDynamicalSystem to BVP, else it is IVP

Parameters
  • newBvp: true if BVP, false otherwise

void setControlProperty(SP::Interaction inter, const bool isControlInteraction)

specify id the given Interaction is for controlling the DS

Parameters

void setCurrentTime(double newValue)

set the current time

Parameters
  • newValue: the new time

void setDate(const std::string &s)

set the date of the simulation

Parameters
  • s: std::string : the date

void setDescription(const std::string &s)

set the author of the simulation

Parameters
  • s: std::string : the author

void setName(SP::DynamicalSystem ds, const std::string &name)

set the name for this Dynamical System

Parameters

void setName(SP::Interaction interaction, const std::string &name)

set the name for this Interaction

Parameters

void setSymmetric(bool val)

set symmetry in the blocks computation

Parameters
  • val: a bool

void setT(double newValue)

set final time

Parameters
  • newValue: the new final time for the Simulatiom

void sett0(double newT0)

set initial time of the time discretisation

Parameters
  • newT0:

void setTitle(const std::string &s)

set the title of the simulation

Parameters
  • s: : the title

void swapInMemory()

save DynamicalSystems and Interactions states in Memories

double t0() const

get initial time

Return
a double

const std::string title() const

get the title of the simulation

Return
std::string : the title

SP::Topology topology() const

get the topology of the system

Return
a pointer on Topology

void updateInput(double time, unsigned int level)

compute r thanks to lambda[level] for all Interactions

Parameters
  • time:
  • level: lambda level

void updateOutput(double time, unsigned int level = 0)

compute output for all the interactions for a given level

Parameters
  • time:
  • level: y order to be computed

void updateOutput(double time, unsigned int level_min, unsigned int level_max)

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

void visitDynamicalSystems(SP::SiconosVisitor visitor)

visit all dynamical systems in this system.

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