File kernel/src/modelingTools/NewtonEuler1DR.hpp#

Go to the source code of this file

class NewtonEuler1DR : public NewtonEulerR
#include <NewtonEuler1DR.hpp>

This class is an interface for a relation with impact.

It implements the computation of the jacoboian of h from the points of contacts and the normal. Use this class consists in overloading the method computeh, by setting the member pc1, pc2, nc and y. The matrix jachq is used both for the building of the OSNSP (with T) and for the predictor of activation of deactivation of the Interaction.

Subclassed by NewtonEuler3DR, NewtonEuler5DR

Public Functions

inline NewtonEuler1DR()

constructor

inline virtual ~NewtonEuler1DR()

destructor

virtual void computeJachq(double time, Interaction &inter, SP::BlockVector q0) override

compute the jacobian of h w.r.t.

q

Parameters:
  • time – current time

  • inter – the interaction using this relation

  • q0 – the container of the block vector to the dynamical system

virtual void initialize(Interaction &inter) override

initialize the relation (check sizes, memory allocation …)

Parameters:

inter – the interaction using this relation

virtual void computeJachqT(Interaction &inter, SP::BlockVector q0) override

Default implementation consists in multiplying jachq and T (see NewtonEulerR::computeJachqT) but here we compute the operator from the the contact point locations and the local frame at contact.

Parameters:
  • inter – interaction that owns the relation

  • q0 – the block vector to the dynamical system position

virtual void computeh(double time, const BlockVector &q0, SiconosVector &y) override

to compute the output y = h(t,q,z) of the Relation

Parameters:
  • time – current time value

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

  • y – the resulting vector

void computehFromRelativeContactPoints(double time, const BlockVector &q0, SiconosVector &y)

to compute the output y = h(t,q,z) of the Relation with the relative contact points

Parameters:
  • time – current time value

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

  • y – the resulting vector

double distance() const

Return the distance between pc1 and pc, with sign according to normal.

inline SP::SiconosVector pc1() const#
inline SP::SiconosVector pc2() const#
inline SP::SiconosVector nc() const#
inline SP::SiconosVector relPc1() const#
inline SP::SiconosVector relPc2() const#
inline SP::SiconosVector relNc() const#
inline void setRelPc1(SP::SiconosVector npc)

Set the coordinates of first contact point in ds1 frame.

It will be used to compute _Pc1 during computeh().

Parameters:

npc – new coordinates

inline void setRelPc2(SP::SiconosVector npc)

Set the coordinates of second contact point in ds2 frame It will be used to compute _Pc2 during computeh().

Parameters:

npc – new coordinates

inline void setRelNc(SP::SiconosVector nnc)

Set the coordinates of inside normal vector at the contact point in ds2 frame.

It will be used to compute _Nc during computeh().

Parameters:

nnc – new coordinates

inline virtual void display() const override

main relation members display

ACCEPT_STD_VISITORS()#

Public Members

bool _isOnContact = false

V.A.

boolean _isOnCOntact ?? Why is it public members ? seems parametrize the projection algorithm the projection is done on the surface \( y=0 \) or on \( y \geq 0 \)

Protected Functions

ACCEPT_SERIALIZATION(NewtonEuler1DR)#
inline void setpc1(SP::SiconosVector npc)#

Set the coordinates of first contact point.

Must only be done in a computeh() override.

Parameters:

npc – new coordinates

inline void setpc2(SP::SiconosVector npc)#

Set the coordinates of second contact point.

Must only be done in a computeh() override.

Parameters:

npc – new coordinates

inline void setnc(SP::SiconosVector nnc)#

Set the coordinates of inside normal vector at the contact point.

Must only be done in a computeh() override.

Parameters:

nnc – new coordinates

Protected Attributes

SP::SiconosVector _Pc1#

Current Contact Points, may be updated within Newton loop based on _relPc1, _relPc2.

SP::SiconosVector _Pc2#
SP::SiconosVector _relPc1#

Contact Points in coordinates relative to attached DS->q.

Set these if _Pc1/_Pc2 are not calculated within the Newton loop.

SP::SiconosVector _relPc2#
SP::SiconosVector _Nc#

Inward Normal at the contact.

Todo:

The meaning of “Inward” has to be explained carefully.

SP::SiconosVector _relNc#

_Nc must be calculated relative to q2

SP::SimpleMatrix _rotationAbsoluteToContactFrame#

Rotation matrix converting the absolute coordinate to the contact frame coordinate.

This matrix contains the unit vector(s)of the contact frame in row.

SP::SimpleMatrix _rotationBodyToAbsoluteFrame#

Matrix converting.

SP::SimpleMatrix _NPG1#

Cross product matrices that correspond the lever arm from contact point to center of mass.

SP::SimpleMatrix _NPG2#
SP::SimpleMatrix _AUX1#
SP::SimpleMatrix _AUX2#

Private Functions

void NIcomputeJachqTFromContacts(SP::SiconosVector q1)#
void NIcomputeJachqTFromContacts(SP::SiconosVector q1, SP::SiconosVector q2)#