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

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

#include <HookeanSpring.hpp>

Public Types

Type aliases
using value_type = Scalar
 Our scalar type.
using line_segment_t = LineSegmentType
 Our line segment type.

Public Member Functions

Constructors and destructor
 HookeanSpring ()
 Default constructor for owning HookeanSprings. Default initialize the line segment and set the spring constant and rest length to -1.
 HookeanSpring ()=delete
 No default constructor for viewing HookeanSpringss.
 HookeanSpring (const line_segment_t &line_segment, const value_type &rest_length, const value_type &spring_constant)
 Constructor to initialize the line segment, rest length, and spring constant.
template<mundy::ValidLineSegmentType OtherLineSegmentType>
 HookeanSpring (const OtherLineSegmentType &line_segment, const value_type &rest_length, const value_type &spring_constant)
 Constructor to initialize the start and end points.
 ~HookeanSpring ()=default
 Destructor.
 HookeanSpring (const HookeanSpring< value_type, line_segment_t, ownership_t > &other)
 Deep copy constructor.
template<typename OtherHookeanSpringType>
 HookeanSpring (const OtherHookeanSpringType &other)
 Deep copy constructor.
 HookeanSpring (HookeanSpring< value_type, line_segment_t, ownership_t > &&other)
 Deep move constructor.
template<typename OtherHookeanSpringType>
 HookeanSpring (OtherHookeanSpringType &&other)
 Deep move constructor.
Operators
HookeanSpring< value_type, line_segment_t, ownership_t > & operator= (const HookeanSpring< value_type, line_segment_t, ownership_t > &other)
 Copy assignment operator.
template<typename OtherHookeanSpringType>
HookeanSpring< value_type, line_segment_t, ownership_t > & operator= (const OtherHookeanSpringType &other)
 Copy assignment operator.
HookeanSpring< value_type, line_segment_t, ownership_t > & operator= (HookeanSpring< value_type, line_segment_t, ownership_t > &&other)
 Move assignment operator.
template<typename OtherHookeanSpringType>
HookeanSpring< value_type, line_segment_t, ownership_t > & operator= (OtherHookeanSpringType &&other)
 Move assignment operator.
Accessors
const line_segment_tline_segment () const
 Accessor for the line segment.
line_segment_tline_segment ()
 Accessor for the line segment.
const value_typerest_length () const
 Accessor for the rest length.
value_typerest_length ()
 Accessor for the rest length.
const value_typespring_constant () const
 Accessor for the spring constant.
value_typespring_constant ()
 Accessor for the spring constant.

Setters

template<mundy::ValidLineSegmentType OtherLineSegmentType>
void set_line_segment (const OtherLineSegmentType &line_segment)
 Set the line segment.
void set_rest_length (const value_type &rest_length)
 Set the rest length.
void set_spring_constant (const value_type &spring_constant)
 Set the spring constant.

Member Typedef Documentation

◆ value_type

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
using mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::value_type = Scalar

◆ line_segment_t

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
using mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::line_segment_t = LineSegmentType

Constructor & Destructor Documentation

◆ HookeanSpring() [1/8]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::HookeanSpring ( )
inline

◆ HookeanSpring() [2/8]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::HookeanSpring ( )
delete

◆ HookeanSpring() [3/8]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::HookeanSpring ( const line_segment_t & line_segment,
const value_type & rest_length,
const value_type & spring_constant )
inline

◆ HookeanSpring() [4/8]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<mundy::ValidLineSegmentType OtherLineSegmentType>
mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::HookeanSpring ( const OtherLineSegmentType & line_segment,
const value_type & rest_length,
const value_type & spring_constant )
inline
Parameters
[in]startThe start of the HookeanSpring.
[in]endThe end of the HookeanSpring.

◆ ~HookeanSpring()

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::~HookeanSpring ( )
default

◆ HookeanSpring() [5/8]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::HookeanSpring ( const HookeanSpring< value_type, line_segment_t, ownership_t > & other)
inline

◆ HookeanSpring() [6/8]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<typename OtherHookeanSpringType>
mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::HookeanSpring ( const OtherHookeanSpringType & other)
inline

◆ HookeanSpring() [7/8]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::HookeanSpring ( HookeanSpring< value_type, line_segment_t, ownership_t > && other)
inline

◆ HookeanSpring() [8/8]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<typename OtherHookeanSpringType>
mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::HookeanSpring ( OtherHookeanSpringType && other)
inline

Member Function Documentation

◆ operator=() [1/4]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
HookeanSpring< value_type, line_segment_t, ownership_t > & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::operator= ( const HookeanSpring< value_type, line_segment_t, ownership_t > & other)
inline

◆ operator=() [2/4]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<typename OtherHookeanSpringType>
HookeanSpring< value_type, line_segment_t, ownership_t > & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::operator= ( const OtherHookeanSpringType & other)
inline

◆ operator=() [3/4]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
HookeanSpring< value_type, line_segment_t, ownership_t > & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::operator= ( HookeanSpring< value_type, line_segment_t, ownership_t > && other)
inline

◆ operator=() [4/4]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<typename OtherHookeanSpringType>
HookeanSpring< value_type, line_segment_t, ownership_t > & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::operator= ( OtherHookeanSpringType && other)
inline

◆ line_segment() [1/2]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
const line_segment_t & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::line_segment ( ) const
inline

◆ line_segment() [2/2]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
line_segment_t & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::line_segment ( )
inline

◆ rest_length() [1/2]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
const value_type & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::rest_length ( ) const
inline

◆ rest_length() [2/2]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
value_type & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::rest_length ( )
inline

◆ spring_constant() [1/2]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
const value_type & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::spring_constant ( ) const
inline

◆ spring_constant() [2/2]

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
value_type & mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::spring_constant ( )
inline

◆ set_line_segment()

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
template<mundy::ValidLineSegmentType OtherLineSegmentType>
void mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::set_line_segment ( const OtherLineSegmentType & line_segment)
inline
Parameters
[in]line_segmentThe new line segment.

◆ set_rest_length()

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
void mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::set_rest_length ( const value_type & rest_length)
inline
Parameters
[in]rest_lengthThe new rest length.

◆ set_spring_constant()

template<typename Scalar, mundy::ValidLineSegmentType LineSegmentType = mundy::LineSegment<Scalar>, typename OwnershipType = mundy::Ownership::Owns>
void mundy::HookeanSpring< Scalar, LineSegmentType, OwnershipType >::set_spring_constant ( const value_type & spring_constant)
inline
Parameters
[in]spring_constantThe new spring constant.