SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::defaulttype::RigidDeriv< 2, real > Class Template Reference

#include <RigidDeriv.h>

Static Public Attributes

static constexpr sofa::Size total_size = 3
 Compile-time constant specifying the number of scalars within this vector (equivalent to the size() method) More...
 
static constexpr sofa::Size spatial_dimensions = 2
 Compile-time constant specifying the number of dimensions of space (NOT equivalent to total_size for rigids) More...
 

Public Member Functions

constexpr RigidDeriv (type::NoInit)
 
constexpr RigidDeriv ()
 
template<typename real2 >
constexpr RigidDeriv (const type::Vec< 2, real2 > &velCenter, const real2 &velOrient)
 
template<typename real2 >
constexpr RigidDeriv (const type::Vec< 3, real2 > &v)
 
constexpr void clear ()
 
template<typename real2 >
constexpr void operator= (const RigidDeriv< 2, real2 > &c)
 
template<typename real2 >
constexpr void operator= (const type::Vec< 2, real2 > &v)
 
template<typename real2 >
constexpr void operator= (const type::Vec< 3, real2 > &v)
 
constexpr void operator+= (const RigidDeriv< 2, real > &a)
 
constexpr void operator-= (const RigidDeriv< 2, real > &a)
 
constexpr RigidDeriv< 2, real > operator+ (const RigidDeriv< 2, real > &a) const
 
constexpr RigidDeriv< 2, real > operator- (const RigidDeriv< 2, real > &a) const
 
template<typename real2 >
constexpr void operator*= (real2 a)
 
template<typename real2 >
constexpr void operator/= (real2 a)
 
constexpr RigidDeriv< 2, real > operator- () const
 
constexpr Real operator* (const RigidDeriv< 2, real > &a) const
 dot product, mostly used to compute residuals as sqrt(x*x) More...
 
Real norm () const
 Euclidean norm. More...
 
constexpr Vec2getVCenter ()
 
constexpr RealgetVOrientation ()
 
constexpr const Vec2getVCenter () const
 
constexpr const RealgetVOrientation () const
 
constexpr Vec2getLinear ()
 
constexpr RealgetAngular ()
 
constexpr const Vec2getLinear () const
 
constexpr const RealgetAngular () const
 
constexpr VecAll getVAll () const
 
constexpr Vec2 velocityAtRotatedPoint (const Vec2 &p) const
 Velocity at point p, where p is the offset from the origin of the frame, given in the same coordinate system as the velocity of the origin. More...
 
constexpr real * ptr ()
 
constexpr const real * ptr () const
 
constexpr real & operator[] (Size i)
 Access to i-th element. More...
 
constexpr const real & operator[] (Size i) const
 Const access to i-th element. More...
 
Tests operators
constexpr bool operator== (const RigidDeriv< 2, real > &b) const
 
constexpr bool operator!= (const RigidDeriv< 2, real > &b) const
 

Static Public Member Functions

static constexpr Size size ()
 

Friends

class RigidCoord< 2, real >
 
std::ostream & operator<< (std::ostream &out, const RigidDeriv< 2, real > &v)
 write to an output stream More...
 
std::istream & operator>> (std::istream &in, RigidDeriv< 2, real > &v)
 read from an input stream More...
 

Attribute details

◆ spatial_dimensions

template<typename real >
constexpr sofa::Size sofa::defaulttype::RigidDeriv< 2, real >::spatial_dimensions = 2
staticconstexpr

Compile-time constant specifying the number of dimensions of space (NOT equivalent to total_size for rigids)

◆ total_size

template<typename real >
constexpr sofa::Size sofa::defaulttype::RigidDeriv< 2, real >::total_size = 3
staticconstexpr

Compile-time constant specifying the number of scalars within this vector (equivalent to the size() method)

Constructor details

◆ RigidDeriv() [1/4]

template<typename real >
constexpr sofa::defaulttype::RigidDeriv< 2, real >::RigidDeriv ( type::NoInit  )
inlineexplicitconstexpr

◆ RigidDeriv() [2/4]

template<typename real >
constexpr sofa::defaulttype::RigidDeriv< 2, real >::RigidDeriv ( )
inlineconstexpr

◆ RigidDeriv() [3/4]

template<typename real >
template<typename real2 >
constexpr sofa::defaulttype::RigidDeriv< 2, real >::RigidDeriv ( const type::Vec< 2, real2 > &  velCenter,
const real2 &  velOrient 
)
inlineconstexpr

◆ RigidDeriv() [4/4]

template<typename real >
template<typename real2 >
constexpr sofa::defaulttype::RigidDeriv< 2, real >::RigidDeriv ( const type::Vec< 3, real2 > &  v)
inlineconstexpr

Function details

◆ clear()

template<typename real >
constexpr void sofa::defaulttype::RigidDeriv< 2, real >::clear ( )
inlineconstexpr

◆ getAngular() [1/2]

template<typename real >
constexpr Real& sofa::defaulttype::RigidDeriv< 2, real >::getAngular ( )
inlineconstexpr

◆ getAngular() [2/2]

template<typename real >
constexpr const Real& sofa::defaulttype::RigidDeriv< 2, real >::getAngular ( ) const
inlineconstexpr

◆ getLinear() [1/2]

template<typename real >
constexpr Vec2& sofa::defaulttype::RigidDeriv< 2, real >::getLinear ( )
inlineconstexpr

◆ getLinear() [2/2]

template<typename real >
constexpr const Vec2& sofa::defaulttype::RigidDeriv< 2, real >::getLinear ( ) const
inlineconstexpr

◆ getVAll()

template<typename real >
constexpr VecAll sofa::defaulttype::RigidDeriv< 2, real >::getVAll ( ) const
inlineconstexpr

◆ getVCenter() [1/2]

template<typename real >
constexpr Vec2& sofa::defaulttype::RigidDeriv< 2, real >::getVCenter ( )
inlineconstexpr

◆ getVCenter() [2/2]

template<typename real >
constexpr const Vec2& sofa::defaulttype::RigidDeriv< 2, real >::getVCenter ( ) const
inlineconstexpr

◆ getVOrientation() [1/2]

template<typename real >
constexpr Real& sofa::defaulttype::RigidDeriv< 2, real >::getVOrientation ( )
inlineconstexpr

◆ getVOrientation() [2/2]

template<typename real >
constexpr const Real& sofa::defaulttype::RigidDeriv< 2, real >::getVOrientation ( ) const
inlineconstexpr

◆ norm()

template<typename real >
Real sofa::defaulttype::RigidDeriv< 2, real >::norm ( ) const
inline

Euclidean norm.

◆ operator!=()

template<typename real >
constexpr bool sofa::defaulttype::RigidDeriv< 2, real >::operator!= ( const RigidDeriv< 2, real > &  b) const
inlineconstexpr

◆ operator*()

template<typename real >
constexpr Real sofa::defaulttype::RigidDeriv< 2, real >::operator* ( const RigidDeriv< 2, real > &  a) const
inlineconstexpr

dot product, mostly used to compute residuals as sqrt(x*x)

◆ operator*=()

template<typename real >
template<typename real2 >
constexpr void sofa::defaulttype::RigidDeriv< 2, real >::operator*= ( real2  a)
inlineconstexpr

◆ operator+()

template<typename real >
constexpr RigidDeriv<2, real> sofa::defaulttype::RigidDeriv< 2, real >::operator+ ( const RigidDeriv< 2, real > &  a) const
inlineconstexpr

◆ operator+=()

template<typename real >
constexpr void sofa::defaulttype::RigidDeriv< 2, real >::operator+= ( const RigidDeriv< 2, real > &  a)
inlineconstexpr

◆ operator-() [1/2]

template<typename real >
constexpr RigidDeriv<2, real> sofa::defaulttype::RigidDeriv< 2, real >::operator- ( ) const
inlineconstexpr

◆ operator-() [2/2]

template<typename real >
constexpr RigidDeriv<2, real> sofa::defaulttype::RigidDeriv< 2, real >::operator- ( const RigidDeriv< 2, real > &  a) const
inlineconstexpr

◆ operator-=()

template<typename real >
constexpr void sofa::defaulttype::RigidDeriv< 2, real >::operator-= ( const RigidDeriv< 2, real > &  a)
inlineconstexpr

◆ operator/=()

template<typename real >
template<typename real2 >
constexpr void sofa::defaulttype::RigidDeriv< 2, real >::operator/= ( real2  a)
inlineconstexpr

◆ operator=() [1/3]

template<typename real >
template<typename real2 >
constexpr void sofa::defaulttype::RigidDeriv< 2, real >::operator= ( const RigidDeriv< 2, real2 > &  c)
inlineconstexpr

◆ operator=() [2/3]

template<typename real >
template<typename real2 >
constexpr void sofa::defaulttype::RigidDeriv< 2, real >::operator= ( const type::Vec< 2, real2 > &  v)
inlineconstexpr

◆ operator=() [3/3]

template<typename real >
template<typename real2 >
constexpr void sofa::defaulttype::RigidDeriv< 2, real >::operator= ( const type::Vec< 3, real2 > &  v)
inlineconstexpr

◆ operator==()

template<typename real >
constexpr bool sofa::defaulttype::RigidDeriv< 2, real >::operator== ( const RigidDeriv< 2, real > &  b) const
inlineconstexpr

◆ operator[]() [1/2]

template<typename real >
constexpr real& sofa::defaulttype::RigidDeriv< 2, real >::operator[] ( Size  i)
inlineconstexpr

Access to i-th element.

◆ operator[]() [2/2]

template<typename real >
constexpr const real& sofa::defaulttype::RigidDeriv< 2, real >::operator[] ( Size  i) const
inlineconstexpr

Const access to i-th element.

◆ ptr() [1/2]

template<typename real >
constexpr real* sofa::defaulttype::RigidDeriv< 2, real >::ptr ( )
inlineconstexpr

◆ ptr() [2/2]

template<typename real >
constexpr const real* sofa::defaulttype::RigidDeriv< 2, real >::ptr ( ) const
inlineconstexpr

◆ size()

template<typename real >
static constexpr Size sofa::defaulttype::RigidDeriv< 2, real >::size ( )
inlinestaticconstexpr

◆ velocityAtRotatedPoint()

template<typename real >
constexpr Vec2 sofa::defaulttype::RigidDeriv< 2, real >::velocityAtRotatedPoint ( const Vec2 p) const
inlineconstexpr

Velocity at point p, where p is the offset from the origin of the frame, given in the same coordinate system as the velocity of the origin.

Related details

◆ operator<<

template<typename real >
std::ostream& operator<< ( std::ostream &  out,
const RigidDeriv< 2, real > &  v 
)
friend

write to an output stream

◆ operator>>

template<typename real >
std::istream& operator>> ( std::istream &  in,
RigidDeriv< 2, real > &  v 
)
friend

read from an input stream

◆ RigidCoord< 2, real >

template<typename real >
friend class RigidCoord< 2, real >
friend