aimstil  5.0.5
til::SpringForce< TMesh, TForceVector > Class Template Reference

A class to compute spring forces on a mesh. More...

#include <cathier/Forces.h>

Public Types

typedef til::value_type_of< TForceVector >::type precision_t
 

Public Member Functions

void initializeLengths (const TMesh &mesh)
 Set the rest lengths of the springs as the length of the edges of the argument mesh. More...
 
void getForces (const TMesh &mesh, std::vector< TForceVector > &forces)
 Computes the forces on the mesh, given the initial length already stored in the class, and store it in second argument. More...
 
const std::vector< std::vector< precision_t > > & getLengths () const
 

Detailed Description

template<class TMesh, typename TForceVector>
class til::SpringForce< TMesh, TForceVector >

A class to compute spring forces on a mesh.

The first template argument corresponds to the mesh type, which should have vertex neighbor indices. The second template argument corresponds to the precision floating point operations should be performed on (typically float or double – TODO: do we actually want to enforce TPrecision to be a numerical floating type?).

Definition at line 114 of file Forces.h.

Member Typedef Documentation

◆ precision_t

template<class TMesh , typename TForceVector >
typedef til::value_type_of<TForceVector>::type til::SpringForce< TMesh, TForceVector >::precision_t

Definition at line 120 of file Forces.h.

Member Function Documentation

◆ getForces()

template<class TMesh , typename TForceVector >
void til::SpringForce< TMesh, TForceVector >::getForces ( const TMesh &  mesh,
std::vector< TForceVector > &  forces 
)
inline

Computes the forces on the mesh, given the initial length already stored in the class, and store it in second argument.

Definition at line 134 of file Forces.h.

References til::for_each_neighbors(), and til::size().

◆ getLengths()

template<class TMesh , typename TForceVector >
const std::vector<std::vector<precision_t> >& til::SpringForce< TMesh, TForceVector >::getLengths ( ) const
inline

Definition at line 150 of file Forces.h.

◆ initializeLengths()

template<class TMesh , typename TForceVector >
void til::SpringForce< TMesh, TForceVector >::initializeLengths ( const TMesh &  mesh)
inline

Set the rest lengths of the springs as the length of the edges of the argument mesh.

Definition at line 126 of file Forces.h.

References til::getEdgeLengths().


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