Class FirstOrderType1R#

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

class FirstOrderType1R : public FirstOrderR#

FirstOrder Non Linear Relation.

Derived from FirstOrderR - See this class for more comments.

Relation for First Order Dynamical Systems, with:

\[\begin{split} y &= h(x,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

inline FirstOrderType1R()#

default constructor

FirstOrderType1R(const std::string &pluginh, const std::string &pluging)#

build from plugin for \( h(x,z) \) and \( g(\lambda, z) \)

Parameters:
  • pluginh – the plugin to compute h

  • pluging – the plugin to compute g

FirstOrderType1R(const std::string &pluginh, const std::string &pluging, const std::string &pluginJachx, const std::string &pluginJacglambda)#

build from plugin for \( h(x,z) \) , \( g(\lambda, z) \) and their gradients

Parameters:
  • pluginh – the plugin to compute h

  • pluging – the plugin to compute g

  • pluginJachx – the plugin to compute \( \nabla_x h \)

  • pluginJacglambda – the plugin to compute \( \nabla_{\lambda} g \)

virtual ~FirstOrderType1R() noexcept = default#

destructor

virtual void initialize(Interaction &inter) override#

initialize the relation (check sizes, memory allocation …)

Parameters:

inter – the interaction that owns this relation

inline virtual void checkSize(Interaction &inter) override#

check sizes of the relation specific operators.

Parameters:

inter – an Interaction using this relation

void computeh(double time, const BlockVector &x, BlockVector &z, SiconosVector &y)#

to compute the output y = h(t,x,…) of the Relation

Parameters:
  • time – current time value

  • x – coordinates of the dynamical systems involved in the relation

  • z – user defined parameters (optional)

  • y – the resulting vector

void computeg(double time, const SiconosVector &lambda, BlockVector &z, BlockVector &r)#

to compute the nonsmooth input r = g(t,x,…) of the Relation

Parameters:
  • time – current time value

  • lambda – interaction \( \lambda \) vector

  • z – user defined parameters (optional)

  • r – the resulting vector

void computeJachx(double time, const BlockVector &x, BlockVector &z, SimpleMatrix &C)#

to compute \( C = \nabla_x h \)

Parameters:
  • time – current time value

  • x – coordinates of the dynamical systems involved in the relation

  • z – user defined parameters (optional)

  • C[out] the resulting matrix

void computeJachz(double time, const BlockVector &x, BlockVector &z, SimpleMatrix &F)#

default function to compute \( \nabla_z h \)

Parameters:
  • time – current time value

  • x – coordinates of the dynamical systems involved in the relation

  • z – user defined parameters (optional)

  • F[out] the resulting matrix

void computeJacglambda(double time, const SiconosVector &lambda, BlockVector &z, SimpleMatrix &B)#

to compute \( B = \nabla_{\lambda}g \)

Parameters:
  • time – current time value

  • x – coordinates of the dynamical systems involved in the relation

  • lambda – interaction \( \lambda \) vector

  • z – user defined parameters (optional)

  • B[out] the resulting matrix

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

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

Parameters:
  • time – current time (not used)

  • interInteraction using this Relation

  • level – not used

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

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

Parameters:
  • time – current time (not used)

  • interInteraction using this Relation

  • level – not used

virtual void computeJach(double time, Interaction &inter) override#

compute all the H Jacobian

Parameters:
  • time – the current time

  • inter – the interaction using this relation

virtual void computeJacg(double time, Interaction &inter) override#

compute all the G Jacobian

Parameters:
  • time – the current time

  • inter – the interaction using this relation

  • interProp

inline virtual bool requireResidu() override#

return true if the relation requires the computation of residu

Returns:

true if residu are required, false otherwise