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

#include <RigidDeriv.h>

Static Public Attributes

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

Protected Attributes

Vec3 vCenter
 
Vec3 vOrientation
 

Public Member Functions

constexpr RigidDeriv ()
 
constexpr RigidDeriv (type::NoInit)
 
constexpr RigidDeriv (const Vec3 &velCenter, const Vec3 &velOrient)
 
template<typename real2 >
constexpr RigidDeriv (const RigidDeriv< 3, real2 > &c)
 
template<typename real2 >
constexpr RigidDeriv (const type::Vec< 6, real2 > &v)
 
template<typename real2 >
constexpr RigidDeriv (const real2 *ptr)
 
constexpr void clear ()
 
template<typename real2 >
constexpr void operator= (const RigidDeriv< 3, real2 > &c)
 
template<typename real2 >
constexpr void operator= (const type::Vec< 3, real2 > &v)
 
template<typename real2 >
constexpr void operator= (const type::Vec< 6, real2 > &v)
 
constexpr void operator+= (const RigidDeriv &a)
 
constexpr void operator-= (const RigidDeriv &a)
 
constexpr RigidDeriv< 3, real > operator+ (const RigidDeriv< 3, real > &a) const
 
template<typename real2 >
constexpr void operator*= (real2 a)
 
template<typename real2 >
constexpr void operator/= (real2 a)
 
constexpr RigidDeriv< 3, real > operator- () const
 
constexpr RigidDeriv< 3, real > operator- (const RigidDeriv< 3, real > &a) const
 
constexpr Real operator* (const RigidDeriv< 3, real > &a) const
 dot product, mostly used to compute residuals as sqrt(x*x) More...
 
real norm () const
 Euclidean norm. More...
 
constexpr Vec3getVCenter ()
 
constexpr Vec3getVOrientation ()
 
constexpr const Vec3getVCenter () const
 
constexpr const Vec3getVOrientation () const
 
constexpr Vec3getLinear ()
 
constexpr const Vec3getLinear () const
 
constexpr Vec3getAngular ()
 
constexpr const Vec3getAngular () const
 
constexpr VecAll getVAll () const
 
constexpr Vec3 velocityAtRotatedPoint (const Vec3 &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< 3, real > &b) const
 
constexpr bool operator!= (const RigidDeriv< 3, real > &b) const
 

Static Public Member Functions

static constexpr Size size ()
 

Friends

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

Attribute details

◆ spatial_dimensions

template<typename real >
constexpr sofa::Size sofa::defaulttype::RigidDeriv< 3, real >::spatial_dimensions = 3
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< 3, real >::total_size = 6
staticconstexpr

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

◆ vCenter

template<typename real >
Vec3 sofa::defaulttype::RigidDeriv< 3, real >::vCenter
protected

◆ vOrientation

template<typename real >
Vec3 sofa::defaulttype::RigidDeriv< 3, real >::vOrientation
protected

Constructor details

◆ RigidDeriv() [1/6]

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

◆ RigidDeriv() [2/6]

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

◆ RigidDeriv() [3/6]

template<typename real >
constexpr sofa::defaulttype::RigidDeriv< 3, real >::RigidDeriv ( const Vec3 velCenter,
const Vec3 velOrient 
)
inlineconstexpr

◆ RigidDeriv() [4/6]

template<typename real >
template<typename real2 >
constexpr sofa::defaulttype::RigidDeriv< 3, real >::RigidDeriv ( const RigidDeriv< 3, real2 > &  c)
inlineconstexpr

◆ RigidDeriv() [5/6]

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

◆ RigidDeriv() [6/6]

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

Function details

◆ clear()

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

◆ getAngular() [1/2]

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

◆ getAngular() [2/2]

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

◆ getLinear() [1/2]

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

◆ getLinear() [2/2]

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

◆ getVAll()

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

◆ getVCenter() [1/2]

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

◆ getVCenter() [2/2]

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

◆ getVOrientation() [1/2]

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

◆ getVOrientation() [2/2]

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

◆ norm()

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

Euclidean norm.

◆ operator!=()

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

◆ operator*()

template<typename real >
constexpr Real sofa::defaulttype::RigidDeriv< 3, real >::operator* ( const RigidDeriv< 3, 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< 3, real >::operator*= ( real2  a)
inlineconstexpr

◆ operator+()

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

◆ operator+=()

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

◆ operator-() [1/2]

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

◆ operator-() [2/2]

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

◆ operator-=()

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

◆ operator/=()

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

◆ operator=() [1/3]

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

◆ operator=() [2/3]

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

◆ operator=() [3/3]

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

◆ operator==()

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

◆ operator[]() [1/2]

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

Access to i-th element.

◆ operator[]() [2/2]

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

Const access to i-th element.

◆ ptr() [1/2]

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

◆ ptr() [2/2]

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

◆ size()

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

◆ velocityAtRotatedPoint()

template<typename real >
constexpr Vec3 sofa::defaulttype::RigidDeriv< 3, real >::velocityAtRotatedPoint ( const Vec3 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< 3, real > &  v 
)
friend

write to an output stream

◆ operator>>

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

read from an input stream

◆ RigidCoord< 3, real >

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