Loading...
Searching...
No Matches
SpatialVector< Cmpt > Class Template Reference

Templated 3D spatial vector derived from VectorSpace used to represent the anglular and linear components of position, velocity and acceleration of rigid bodies. More...

#include <SpatialVector.H>

Inheritance diagram for SpatialVector< Cmpt >:
Collaboration diagram for SpatialVector< Cmpt >:

Classes

class  dual
 Class to represent the dual spatial vector. More...

Public Types

enum  components {
  WX , WY , WZ , LX ,
  LY , LZ
}
 Component labeling enumeration. More...
Public Types inherited from VectorSpace< SpatialVector< Cmpt >, Cmpt, 6 >
typedef VectorSpace< SpatialVector< Cmpt >, Cmpt, Ncmpts > vsType
 VectorSpace type.
typedef Cmpt cmptType
 Component type.
typedef Cmpt magType
 Magnitude type.
typedef direction size_type
 The type to represent the size of a VectorSpace.
typedef Cmpt * iterator
 Random access iterator for traversing VectorSpace.
typedef const Cmpt * const_iterator
 Random access iterator for traversing VectorSpace.

Public Member Functions

 SpatialVector ()=default
 Default construct.
 SpatialVector (const Foam::zero)
 Construct initialized to zero.
 SpatialVector (const typename SpatialVector::vsType &)
 Construct given VectorSpace of the same rank.
 SpatialVector (const Vector< Cmpt > &w, const Vector< Cmpt > &l)
 Construct from the angular and linear vector components.
 SpatialVector (const Cmpt &wx, const Cmpt &wy, const Cmpt &wz, const Cmpt &lx, const Cmpt &ly, const Cmpt &lz)
 Construct given 6 components.
 SpatialVector (Istream &)
 Construct from Istream.
const Cmpt & wx () const noexcept
const Cmpt & wy () const noexcept
const Cmpt & wz () const noexcept
const Cmpt & lx () const noexcept
const Cmpt & ly () const noexcept
const Cmpt & lz () const noexcept
Cmpt & wx () noexcept
Cmpt & wy () noexcept
Cmpt & wz () noexcept
Cmpt & lx () noexcept
Cmpt & ly () noexcept
Cmpt & lz () noexcept
Vector< Cmpt > w () const
 Return the angular part of the spatial vector as a vector.
Vector< Cmpt > l () const
 Return the linear part of the spatial vector as a vector.
dual operator* () const
 Return the dual spatial vector.
Public Member Functions inherited from VectorSpace< SpatialVector< Cmpt >, Cmpt, 6 >
const Foam::VectorSpace< SpatialVector< Cmpt >, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 VectorSpace ()=default
 Default construct.
const Cmpt & component (const direction) const
void replace (const direction, const Cmpt &)
const Cmpt * cdata () const noexcept
 Return const pointer to the first data element.
Cmpt * data () noexcept
 Return pointer to the first data element.
void fill (const Cmpt &s)
 Assign all components to given value.
const Cmpt & operator[] (const direction) const
void operator= (const VectorSpace< SpatialVector< Cmpt >, Cmpt, Ncmpts > &)
void operator+= (const VectorSpace< SpatialVector< Cmpt >, Cmpt, Ncmpts > &)
void operator-= (const VectorSpace< SpatialVector< Cmpt >, Cmpt, Ncmpts > &)
void operator*= (const scalar)
void operator/= (const scalar)
iterator begin () noexcept
 Return an iterator (pointer) to begin of VectorSpace.
const_iterator cbegin () const noexcept
 Return const_iterator (const pointer) to begin of VectorSpace.
iterator end () noexcept
 Return an iterator (pointer) to end of VectorSpace.
const_iterator cend () const noexcept
 Return const_iterator (const pointer) to end of VectorSpace.

Additional Inherited Members

Static Public Member Functions inherited from VectorSpace< SpatialVector< Cmpt >, Cmpt, 6 >
static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts.
static SpatialVector< Cmpt > uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s.
Public Attributes inherited from VectorSpace< SpatialVector< Cmpt >, Cmpt, 6 >
Cmpt v_ [Ncmpts]
 The components of this vector space.
Static Public Attributes inherited from VectorSpace< SpatialVector< Cmpt >, Cmpt, 6 >
static constexpr direction dim
 Dimensionality of space.
static constexpr direction nComponents
 Number of components in this vector space.
static constexpr direction mRows
static constexpr direction nCols
static const char *const typeName
static const char *const componentNames []
static const SpatialVector< Cmpt > zero
static const SpatialVector< Cmpt > one
static const SpatialVector< Cmpt > max
static const SpatialVector< Cmpt > min
static const SpatialVector< Cmpt > rootMax
static const SpatialVector< Cmpt > rootMin

Detailed Description

template<class Cmpt>
class Foam::SpatialVector< Cmpt >

Templated 3D spatial vector derived from VectorSpace used to represent the anglular and linear components of position, velocity and acceleration of rigid bodies.

Reference:

    Featherstone, R. (2008).
    Rigid body dynamics algorithms.
    Springer.
Source files
See also
Foam::VectorSpace Foam::Vector

Definition at line 61 of file SpatialVector.H.

Member Enumeration Documentation

◆ components

template<class Cmpt>
enum components

Component labeling enumeration.

Enumerator
WX 
WY 
WZ 
LX 
LY 
LZ 

Definition at line 71 of file SpatialVector.H.

Constructor & Destructor Documentation

◆ SpatialVector() [1/6]

template<class Cmpt>
SpatialVector ( )
default

Default construct.

Referenced by SpatialVector< Cmpt >::dual::dual(), SpatialVector(), SpatialVector(), and SpatialVector().

Here is the caller graph for this function:

◆ SpatialVector() [2/6]

template<class Cmpt>
SpatialVector ( const Foam::zero )
inline

Construct initialized to zero.

Definition at line 24 of file SpatialVectorI.H.

References SpatialVector(), and Foam::Zero.

Here is the call graph for this function:

◆ SpatialVector() [3/6]

template<class Cmpt>
SpatialVector ( const typename SpatialVector< Cmpt >::vsType & vs)
inline

Construct given VectorSpace of the same rank.

Definition at line 31 of file SpatialVectorI.H.

References SpatialVector().

Here is the call graph for this function:

◆ SpatialVector() [4/6]

template<class Cmpt>
SpatialVector ( const Vector< Cmpt > & w,
const Vector< Cmpt > & l )
inline

Construct from the angular and linear vector components.

Definition at line 41 of file SpatialVectorI.H.

References l(), LX, LY, LZ, VectorSpace< SpatialVector< Cmpt >, Cmpt, 6 >::v_, w(), WX, WY, and WZ.

Here is the call graph for this function:

◆ SpatialVector() [5/6]

template<class Cmpt>
SpatialVector ( const Cmpt & wx,
const Cmpt & wy,
const Cmpt & wz,
const Cmpt & lx,
const Cmpt & ly,
const Cmpt & lz )
inline

Construct given 6 components.

Definition at line 57 of file SpatialVectorI.H.

References LX, LY, LZ, VectorSpace< SpatialVector< Cmpt >, Cmpt, 6 >::v_, WX, WY, and WZ.

◆ SpatialVector() [6/6]

template<class Cmpt>
SpatialVector ( Istream & is)
inlineexplicit

Construct from Istream.

Definition at line 77 of file SpatialVectorI.H.

References SpatialVector().

Here is the call graph for this function:

Member Function Documentation

◆ wx() [1/2]

template<class Cmpt>
const Cmpt & wx ( ) const
inlinenoexcept

Definition at line 144 of file SpatialVector.H.

Referenced by Rx::jcalc(), Foam::operator^(), and Foam::operator^().

Here is the caller graph for this function:

◆ wy() [1/2]

template<class Cmpt>
const Cmpt & wy ( ) const
inlinenoexcept

Definition at line 145 of file SpatialVector.H.

Referenced by Ry::jcalc(), Foam::operator^(), and Foam::operator^().

Here is the caller graph for this function:

◆ wz() [1/2]

template<class Cmpt>
const Cmpt & wz ( ) const
inlinenoexcept

Definition at line 146 of file SpatialVector.H.

Referenced by Rz::jcalc(), Foam::operator^(), and Foam::operator^().

Here is the caller graph for this function:

◆ lx() [1/2]

template<class Cmpt>
const Cmpt & lx ( ) const
inlinenoexcept

Definition at line 148 of file SpatialVector.H.

Referenced by Foam::operator^(), and Foam::operator^().

Here is the caller graph for this function:

◆ ly() [1/2]

template<class Cmpt>
const Cmpt & ly ( ) const
inlinenoexcept

Definition at line 149 of file SpatialVector.H.

Referenced by Foam::operator^(), and Foam::operator^().

Here is the caller graph for this function:

◆ lz() [1/2]

template<class Cmpt>
const Cmpt & lz ( ) const
inlinenoexcept

Definition at line 150 of file SpatialVector.H.

Referenced by Foam::operator^(), and Foam::operator^().

Here is the caller graph for this function:

◆ wx() [2/2]

template<class Cmpt>
Cmpt & wx ( )
inlinenoexcept

Definition at line 152 of file SpatialVector.H.

◆ wy() [2/2]

template<class Cmpt>
Cmpt & wy ( )
inlinenoexcept

Definition at line 153 of file SpatialVector.H.

◆ wz() [2/2]

template<class Cmpt>
Cmpt & wz ( )
inlinenoexcept

Definition at line 154 of file SpatialVector.H.

◆ lx() [2/2]

template<class Cmpt>
Cmpt & lx ( )
inlinenoexcept

Definition at line 156 of file SpatialVector.H.

◆ ly() [2/2]

template<class Cmpt>
Cmpt & ly ( )
inlinenoexcept

Definition at line 157 of file SpatialVector.H.

◆ lz() [2/2]

template<class Cmpt>
Cmpt & lz ( )
inlinenoexcept

Definition at line 158 of file SpatialVector.H.

◆ w()

template<class Cmpt>
Foam::Vector< Cmpt > w ( ) const
inline

Return the angular part of the spatial vector as a vector.

Definition at line 93 of file SpatialVectorI.H.

References VectorSpace< SpatialVector< Cmpt >, Cmpt, 6 >::v_, WX, WY, and WZ.

Referenced by SpatialVector().

Here is the caller graph for this function:

◆ l()

template<class Cmpt>
Foam::Vector< Cmpt > l ( ) const
inline

Return the linear part of the spatial vector as a vector.

Definition at line 99 of file SpatialVectorI.H.

References LX, LY, LZ, and VectorSpace< SpatialVector< Cmpt >, Cmpt, 6 >::v_.

Referenced by SpatialVector(), and rigidBodyMotion::vCofR().

Here is the caller graph for this function:

◆ operator*()

template<class Cmpt>
Foam::SpatialVector< Cmpt >::dual operator* ( ) const
inline

Return the dual spatial vector.

Definition at line 116 of file SpatialVectorI.H.


The documentation for this class was generated from the following files: