Class Topology

Defined in Program listing for file kernel/src/simulationTools/Topology.hpp

class Topology : public std11::enable_shared_from_this<Topology>

This class describes the topology of the non-smooth dynamical system.

It holds all the “potential” Interactions”.

Topology is built in NSDS constructors but initialized in Simulation->initialize(), ie when all Interactions have been clearly defined.

Note that indexSet0 holds all the possible relations (declared by user) not only those which are “actives”.

Construction consists in:

  • link with the NSDS that owns the topology.

Initialization consists in:

  • scan of all the interactions of the NSDS
  • initialization of each interaction
  • insertion of the relations of all the Interaction into indexSet0

Insertion of an Interaction into the set indexSet0: addInteractionInIndexSet0(SP::Interaction inter) for each relation of the interaction, it creates a new Interaction and inserts it into indexSet0 It also counts the total number of “constraints” in the system.

Public Functions

Topology()

default constructor

~Topology()

destructor

SP::DynamicalSystemsGraph dSG(unsigned int num) const

get a pointer to the graph at level num of Dynamical System

Return
a SP::DynamicalSystemsGraph
Parameters
  • num: the level

std::vector<SP::DynamicalSystem> dynamicalSystemsForInteraction(SP::Interaction) const

get DynamicalSystems for a given Interaction

Return
a vector of pointers to DynamicalSystem

DynamicalSystemsGraph::VDescriptor getDSG0Descriptor(SP::DynamicalSystem ds)

Helper to get the descriptor in DSG0 from a DynamicalSystem.

Return
the descriptor in DSG0 from a DynamicalSystem
Parameters

SP::DynamicalSystem getDynamicalSystem(unsigned int requiredNumber) const

Get a dynamical system using its number.

Warning
O(n) complexity
Return
a DynamicalSystem
Parameters
  • requiredNumber: the required number

SP::DynamicalSystem getDynamicalSystem(std::string name) const

Get a dynamical system using its name.

Warning
O(n) complexity
Return
a DynamicalSystem
Parameters
  • name: the name of the dynamical system

SP::Interaction getInteraction(unsigned int requiredNumber) const

Get a interaction using its number.

Warning
O(n) complexity
Return
an Interaction
Parameters
  • requiredNumber: the required number

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

Get a interaction using its name.

Warning
O(n) complexity
Return
an Interaction pointer
Parameters

bool hasChanged() const

check

Return
a bool

bool hasDynamicalSystem(SP::DynamicalSystem ds) const

check if an dynamical system is already a vertex of the DSs graph.

Return
true if ds is in the graph
Parameters
  • ds: the DS to test

bool hasInteraction(SP::Interaction inter) const

check if an interaction is already a vertex of the Interactions graph.

Return
true if inter is in the graph
Parameters

SP::InteractionsGraph indexSet(unsigned int num) const

get a pointer to the graph at level num of Interactions

Return
a SP::InteractionsGraph
Parameters
  • num: the number of indexSet

SP::InteractionsGraph indexSet0() const

get a pointer to the graph of all Interactions.

Return
a SP::InteractionsGraph

unsigned int indexSetSize(unsigned int level) const

get the size of the InteractionGraphs at a given level

Return
size of the InteractionGraphs at a given level
Parameters
  • level:

void indexSetsResize(unsigned int newSize)

resize Interactions Graphs

Parameters
  • newSize: the new size

unsigned int indexSetsSize() const

get the number of Interactions Graphs

Return
the number of Interactions Graphs

void insertDynamicalSystem(SP::DynamicalSystem ds)

add a dynamical system

Parameters

std::vector<SP::Interaction> interactionsForDS(SP::DynamicalSystem) const

get Interactions for a given DS

Return
a vector of pointers to Interaction

std::vector<SP::Interaction> interactionsForPairOfDS(SP::DynamicalSystem ds1, SP::DynamicalSystem ds2 = SP::DynamicalSystem()) const

get Interactions for a given pair of DSs

Return
a vector of pointers to Interaction

std::pair<DynamicalSystemsGraph::EDescriptor, InteractionsGraph::VDescriptor> link(SP::Interaction inter, SP::DynamicalSystem ds, SP::DynamicalSystem ds2 = SP::DynamicalSystem())

link two dynamical systems to a relation

Return
a vertex descriptor of the new vertex in IndexSet0
Parameters
  • inter: a SP::Interaction
  • ds: a SP::DynamicalSystem
  • ds2: a SP::DynamicalSystem (optional)

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

unsigned int numberOfConstraints() const

get the total number of scalar constraints

Return
an unsigned int

unsigned int numberOfIndexSet() const

get a pointer to the graph at level num of Interactions

Return
a SP::InteractionsGraph

unsigned int numberOfInvolvedDS(unsigned int inumber)

get the number of DynamicalSystem currently involved in an indexSet

Return
the number of DynamicalSystem involved
Parameters
  • inumber: the indexSet number

void removeDynamicalSystem(SP::DynamicalSystem ds)

remove a Dynamical System from the topology.

The dynamical system is removed from Dynamical Systems graph and Interactions Graph. The dynamical system is not removed from actives subgraphs : see updateIndexSet

Parameters
  • ds: the dynamical system to remove

void removeInteraction(SP::Interaction inter)

remove an Interaction from the topology.

The interaction is removed from Dynamical Systems graph and Interactions Graph. The interaction is not removed from actives subgraphs : see updateIndexSet

Parameters
  • inter: the interaction to remove

void resetIndexSetPtr(unsigned int num)

reset graph at level num of Interactions

Parameters
  • num: the indexSet to reset

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

specify if the given Interaction is for controlling the DS

Parameters

void setHasChanged(const bool val)

set _hasChanged to val

Parameters
  • val: a bool

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

set the name for this Dynamical System

Parameters

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

set the name for an Interaction

Parameters

void setOSI(SP::DynamicalSystem ds, SP::OneStepIntegrator OSI)

set the OSI for this DynamicalSystem

Parameters

void setProperties()

initialize graphs properties

void setSymmetric(bool val)

set symmetry in the blocks computation

Parameters
  • val: a bool