File kernel/src/modelingTools/FirstOrderR.hpp

Go to the source code of this file

General interface for relations.

class FirstOrderR : public Relation
#include <FirstOrderR.hpp>

FirstOrder Non Linear Relation.

Relation for First Order Dynamical Systems, with:

\[\begin{split}y &=& h(X,t,\lambda,Z)\\ R &=& g(X,t,\lambda,Z)\end{split}\]
X, Z, R corresponds to DynamicalSystem variables. If DS1 and DS2 are involved in the linked Interaction, then X =[x1 x2], Z=[z1 z2] …

\( y \ and \ \lambda \) are specific variables of the interaction (see this class for more details). h and g are plugged on external functions, via plug-in mechanism (see SiconosSharedLibrary).

h <=> output

g <=> input

Operators (and their corresponding plug-in):

  • h: saved in Interaction as y (plug-in: output[0])
  • \( \nabla_x h \): jacobianH[0] ( output[1] )
  • \( \nabla_\lambda h \): jacobianH[1] ( output[2] )
  • g: saved in DS as r ( input[0])
  • \( \nabla_\lambda g \): jacobianG[0] ( input[1] )

Note: we use a vector for jacobianG while there is only one jacobian. Just for future changes and to allow easy new implementations if some other variables are required in g.

Subclassed by FirstOrderLinearR, FirstOrderLinearTIR, FirstOrderNonLinearR, FirstOrderType1R, FirstOrderType2R

Public Types

enum FirstOrderRDS

Values:

x
z
r
DSlinkSize
enum FirstOrderRMat

Values:

mat_C
mat_D
mat_F
mat_B
mat_K
relationMatricesSize
enum FirstOrderRVec

Values:

e
relationVectorsSize

Public Functions

virtual ~FirstOrderR()

destructor

SP::SimpleMatrix B() const

get B

Return
B matrix

SP::SimpleMatrix C() const

get C

Return
C matrix

virtual void checkSize(Interaction &inter) = 0

check sizes of the relation specific operators.

Parameters

SP::SimpleMatrix D() const

get D

Return
D matrix

SP::SimpleMatrix F() const

get F

Return
F matrix

virtual void initialize(Interaction &inter)

initialize the relation (check sizes, memory allocation …)

Parameters
  • inter: the interaction using this relation

SP::SimpleMatrix K() const

get K

Return
K matrix

void setBPtr(SP::SimpleMatrix newB)

set B to pointer newB

Parameters
  • newB: the B matrix

void setCPtr(SP::SimpleMatrix newC)

set C to pointer newC

Parameters
  • newC: the C matrix

void setDPtr(SP::SimpleMatrix newD)

set D to pointer newPtr

Parameters
  • newD: the D matrix

void setFPtr(SP::SimpleMatrix newF)

set F to pointer newPtr

Parameters
  • newF: the F matrix

Protected Functions

FirstOrderR(RELATION::SUBTYPES newType)

basic constructor

Parameters
  • newType: the type of the relation

ACCEPT_SERIALIZATION(FirstOrderR)

serialization hooks

Protected Attributes

SP::SimpleMatrix _B
SP::SimpleMatrix _C
SP::SimpleMatrix _D
SP::SimpleMatrix _F
SP::SimpleMatrix _K
SP::SiconosVector _vec_r

Continuous memory vector of size of r to call plugin.

SP::SiconosVector _vec_x

Continuous memory vector of size of x to call plugin.

SP::SiconosVector _vec_z

Continuous memory vector of size of z to call plugin.