File kernel/src/modelingTools/FirstOrderType2R.hpp

Go to the source code of this file

non linear relations: \(y=h(x,\lambda,z), r=g(\lambda,z)\)

Typedefs

typedef void (*Type2PtrG)(unsigned int, double *, unsigned int, double *)
typedef void (*Type2PtrH)(unsigned int, double *, unsigned int, double *, unsigned int, double *)
class FirstOrderType2R : public FirstOrderR
#include <FirstOrderType2R.hpp>

First order non linear Relation.

Relation for First Order Dynamical Systems, with:

\[\begin{split}y &= h(x,\lambda,z)\\ r &= g(\lambda,z)\end{split}\]

Operators (and their corresponding plug-in):

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

Public Functions

FirstOrderType2R()

Basic contructor.

FirstOrderType2R(const std::string &pluginh, const std::string &pluging)

data constructor

Parameters
  • pluginh: name of the plugin to compute h
  • pluging: name of the plugin to compute g

FirstOrderType2R(const std::string &pluginh, const std::string &pluging, const std::string &pluginJacobianhx, const std::string &pluginJacobianglambda)

data constructor

Parameters
  • pluginh: name of the plugin to compute h
  • pluging: name of the plugin to compute g
  • pluginJacobianhx: name of the plugin to compute the Jacobian of h according to x \(\nabla_x h\)
  • pluginJacobianglambda: name of the plugin to compute the jacobian of g according to lambda

~FirstOrderType2R()

destructor

ACCEPT_STD_VISITORS()
virtual void checkSize(Interaction &inter)

check sizes of the relation specific operators.

Parameters

virtual void computeg(double time, SiconosVector &lambda, SiconosVector &r)

default function to compute g

Parameters
  • time: the current time
  • lambda: XXX
  • r: the nonsmooth “input” vector

virtual void computeh(double time, SiconosVector &x, SiconosVector &lambda, SiconosVector &y)

default function to compute y = h(x, lambda, t)

Parameters
  • time: the current time
  • x: the state vector
  • lambda: XXX
  • y: the “output” vector

virtual void computeInput(double time, Interaction &inter, unsigned int level = 0)

default function to compute r, using the data from the Interaction and DS

Parameters

virtual void computeJacg(double time, Interaction &inter)
virtual void computeJacglambda(double time, SiconosVector &lambda, SimpleMatrix &B)

default function to compute jacobianG according to lambda

Parameters
  • time: current time (not used)
  • lambda: the nonsmooth input used to evaluate the jacobian
  • B: the matrix used to store the jacobian

virtual void computeJach(double time, Interaction &inter)

compute all the H Jacobian

Parameters
  • time: the current time
  • inter: the interaction using this relation

virtual void computeJachlambda(double time, SiconosVector &x, SiconosVector &lambda, SimpleMatrix &D)

default function to compute jacobianh according to lambda

Parameters
  • time: current time (not used)
  • x: the state used to evaluate the jacobian
  • lambda: the nonsmooth input used to evaluate the jacobian
  • D: the matrix used to store the jacobian

virtual void computeJachx(double time, SiconosVector &x, SiconosVector &lambda, SimpleMatrix &C)

default function to compute \(\nabla_x h\)

Parameters
  • time: current time (not used)
  • x: the state used to evaluate the jacobian
  • lambda:
  • C: the matrix used to store the jacobian

virtual void computeOutput(double time, Interaction &inter, unsigned int level = 0)

default function to compute y, using the data from the Interaction and DS

Parameters

virtual void initialize(Interaction &inter)

initialize the relation (check sizes, memory allocation …)

Parameters
  • inter: the interaction that owns this relation

virtual bool requireResidu()

return true if the relation requires the computation of residu

Return
true if residu are required, false otherwise

Protected Functions

ACCEPT_SERIALIZATION(FirstOrderType2R)

serialization hooks