Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType > Class Template Reference

A hookean spring between two points with a rest angle and spring constant.

#include <TorsionalSpring.hpp>

Public Types

Type aliases
using value_type = Scalar
 Our scalar type.
using v_segment_t = VSegmentType
 Our line segment type.

Public Member Functions

Constructors and destructor
 TorsionalSpring ()
 Default constructor for owning TorsionalSprings. Default initialize the line segment and set the spring constant and rest angle to -1.
 TorsionalSpring ()=delete
 No default constructor for viewing TorsionalSpringss.
 TorsionalSpring (const v_segment_t &v_segment, const value_type &rest_angle, const value_type &spring_constant)
 Constructor to initialize the line segment, rest angle, and spring constant.
template<mundy::ValidVSegmentType OtherVSegmentType>
 TorsionalSpring (const OtherVSegmentType &v_segment, const value_type &rest_angle, const value_type &spring_constant)
 Constructor to initialize the start and end points.
 ~TorsionalSpring ()=default
 Destructor.
 TorsionalSpring (const TorsionalSpring< value_type, v_segment_t, ownership_t > &other)
 Deep copy constructor.
template<typename OtherTorsionalSpringType>
 TorsionalSpring (const OtherTorsionalSpringType &other)
 Deep copy constructor.
 TorsionalSpring (TorsionalSpring< value_type, v_segment_t, ownership_t > &&other)
 Deep move constructor.
template<typename OtherTorsionalSpringType>
 TorsionalSpring (OtherTorsionalSpringType &&other)
 Deep move constructor.
Operators
TorsionalSpring< value_type, v_segment_t, ownership_t > & operator= (const TorsionalSpring< value_type, v_segment_t, ownership_t > &other)
 Copy assignment operator.
template<typename OtherTorsionalSpringType>
TorsionalSpring< value_type, v_segment_t, ownership_t > & operator= (const OtherTorsionalSpringType &other)
 Copy assignment operator.
TorsionalSpring< value_type, v_segment_t, ownership_t > & operator= (TorsionalSpring< value_type, v_segment_t, ownership_t > &&other)
 Move assignment operator.
template<typename OtherTorsionalSpringType>
TorsionalSpring< value_type, v_segment_t, ownership_t > & operator= (OtherTorsionalSpringType &&other)
 Move assignment operator.
Accessors
const v_segment_tv_segment () const
 Accessor for the line segment.
v_segment_tv_segment ()
 Accessor for the line segment.
const value_typerest_angle () const
 Accessor for the rest angle.
value_typerest_angle ()
 Accessor for the rest angle.
const value_typespring_constant () const
 Accessor for the spring constant.
value_typespring_constant ()
 Accessor for the spring constant.

Setters

template<mundy::ValidVSegmentType OtherVSegmentType>
void set_v_segment (const OtherVSegmentType &v_segment)
 Set the line segment.
void set_rest_angle (const value_type &rest_angle)
 Set the rest angle.
void set_spring_constant (const value_type &spring_constant)
 Set the spring constant.

Member Typedef Documentation

◆ value_type

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
using mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::value_type = Scalar

◆ v_segment_t

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
using mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::v_segment_t = VSegmentType

Constructor & Destructor Documentation

◆ TorsionalSpring() [1/8]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::TorsionalSpring ( )
inline

◆ TorsionalSpring() [2/8]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::TorsionalSpring ( )
delete

◆ TorsionalSpring() [3/8]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::TorsionalSpring ( const v_segment_t & v_segment,
const value_type & rest_angle,
const value_type & spring_constant )
inline

◆ TorsionalSpring() [4/8]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<mundy::ValidVSegmentType OtherVSegmentType>
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::TorsionalSpring ( const OtherVSegmentType & v_segment,
const value_type & rest_angle,
const value_type & spring_constant )
inline
Parameters
[in]startThe start of the TorsionalSpring.
[in]endThe end of the TorsionalSpring.

◆ ~TorsionalSpring()

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::~TorsionalSpring ( )
default

◆ TorsionalSpring() [5/8]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::TorsionalSpring ( const TorsionalSpring< value_type, v_segment_t, ownership_t > & other)
inline

◆ TorsionalSpring() [6/8]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<typename OtherTorsionalSpringType>
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::TorsionalSpring ( const OtherTorsionalSpringType & other)
inline

◆ TorsionalSpring() [7/8]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::TorsionalSpring ( TorsionalSpring< value_type, v_segment_t, ownership_t > && other)
inline

◆ TorsionalSpring() [8/8]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<typename OtherTorsionalSpringType>
mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::TorsionalSpring ( OtherTorsionalSpringType && other)
inline

Member Function Documentation

◆ operator=() [1/4]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
TorsionalSpring< value_type, v_segment_t, ownership_t > & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::operator= ( const TorsionalSpring< value_type, v_segment_t, ownership_t > & other)
inline

◆ operator=() [2/4]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<typename OtherTorsionalSpringType>
TorsionalSpring< value_type, v_segment_t, ownership_t > & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::operator= ( const OtherTorsionalSpringType & other)
inline

◆ operator=() [3/4]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
TorsionalSpring< value_type, v_segment_t, ownership_t > & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::operator= ( TorsionalSpring< value_type, v_segment_t, ownership_t > && other)
inline

◆ operator=() [4/4]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<typename OtherTorsionalSpringType>
TorsionalSpring< value_type, v_segment_t, ownership_t > & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::operator= ( OtherTorsionalSpringType && other)
inline

◆ v_segment() [1/2]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
const v_segment_t & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::v_segment ( ) const
inline

◆ v_segment() [2/2]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
v_segment_t & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::v_segment ( )
inline

◆ rest_angle() [1/2]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
const value_type & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::rest_angle ( ) const
inline

◆ rest_angle() [2/2]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
value_type & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::rest_angle ( )
inline

◆ spring_constant() [1/2]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
const value_type & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::spring_constant ( ) const
inline

◆ spring_constant() [2/2]

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
value_type & mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::spring_constant ( )
inline

◆ set_v_segment()

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<mundy::ValidVSegmentType OtherVSegmentType>
void mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::set_v_segment ( const OtherVSegmentType & v_segment)
inline
Parameters
[in]v_segmentThe new line segment.

◆ set_rest_angle()

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
void mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::set_rest_angle ( const value_type & rest_angle)
inline
Parameters
[in]rest_angleThe new rest angle.

◆ set_spring_constant()

template<typename Scalar, mundy::ValidVSegmentType VSegmentType = mundy::VSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
void mundy::TorsionalSpring< Scalar, VSegmentType, OwnershipType >::set_spring_constant ( const value_type & spring_constant)
inline
Parameters
[in]spring_constantThe new spring constant.