Documentation


animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex > Class Template Reference

#include <massspringsolver.h>

Inheritance diagram for animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >:

animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real > animal::PhysicalSolver< t_Positions, t_Vector, t_InvMasses, t_Real > animal::OdeSolver< t_Positions, t_Vector, t_Real > animal::MassSpringEngine< X3DTK::MFFloat, X3DTK::MFVec3f, X3DTK::MFFloat, X3DTK::MFInt32, X3DTK::MFVec3f, float > List of all members.

Detailed Description

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
class animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >

A solver for mass-spring systems.

A spring is modeled using:

An isotropy coefficient is used to bias the product of the stiffness with a vector when performing implicit integration. This enhances the stability of the system. Reasonable values for anistropy are experimentally around 0.03 or 0.05.

Author:
François Faure, GRAVIR

Definition at line 45 of file massspringsolver.h.

Public Types

typedef t_Positions Positions
 Positions of the particles.

typedef container_traits<
Positions >::value_type 
Position
 Position of a particle.

typedef t_Vector Vector
 Velocities, forces, etc.

typedef container_traits<
Vector >::value_type 
Vec
typedef t_VecReal VecReal
 Vector of real numbers.

typedef value_type< VecReal
>::type 
Real
 Real numbers.

typedef t_VecIndex VecIndex
 Vector of indices.

typedef value_type< VecIndex
>::type 
Index
 Index of a particle.

typedef PhysicalSolver< t_Positions,
t_Vector, t_InvMasses, typename
value_type< t_VecReal >::type > 
_PhysicalSolver
 Parent class.

typedef OdeImplicitSolver<
t_Positions, t_Vector, typename
value_type< t_VecReal >::type > 
_OdeImplicitSolver
 Convenience for disambiguating multiple inheritance.


Public Member Functions

 MassSpringSolver ()
 ~MassSpringSolver ()
void create_rest_lengths (const Positions &p)
 Set the rest lengths of the springs according to the current particle positions.

void set_rest_lengths (VecReal *r)
 Set the given rest lengths.

VecRealget_rest_lengths ()
 rest lengths

bool get_debugInfo () const
 Get debug info boolean.

void set_debugInfo (bool b)
 set debug info boolean

virtual void solveODE (Positions &pos, Vector &vel, Real dt)
 Solve the ODE then applies exponential damping.

virtual void computeForces (Vector &f, const Positions &p, const Vector &v)
 Compute the elastic forces given particle positions and velocities.

virtual void computeAccelerations (Vector &acc, const Positions &pos, const Vector &vel)
 Compute the accelerations given particle positions and velocities.

virtual void computeAccelerationsAndStiffness (Vector &acc, const Positions &pos, const Vector &vel)
 Compute the accelerations given particle positions and velocities, and computes [df/dx].

virtual void applyForces (Vector &a, const Vector &f)
 Compute the acceleration of the particles when given forces are applied.

virtual void v_eq_h_dfdx_x (Vector &v, Real h, const Vector &x)
 Compute $ v = h [df/dx] x $.

virtual void v_peq_h_dfdx_x (Vector &v, Real h, const Vector &x)
 Compute $ v += h ((1-\alpha)[df/dx] + \alpha I) x $.

numerical settings
virtual void setMethod (int)
 Set the integration method.

virtual int getMethod () const
 Get the integration method.

void setIsotropy (Real iso)
 Set the isotropy coefficient.

Real getIsotropy () const
 Get the isotropy coefficient.

physical settings
virtual void set_common_damping_ratio (const Real &_newVal)
 Write property of Real _common_damping_ratio.

virtual const Realget_common_damping_ratio ()
 Read property of Real _common_damping_ratio.

connections
virtual void set_spring_indices (VecIndex *_newVal)
 Set the pointer to the spring indices.

virtual void set_stiffnesses (VecReal *_newVal)
 Set the pointer to the stiffness values.


Static Public Member Functions

Real get_thresholdDistance ()
 return the threshold value

void set_thresholdDistance (Real threshold)
 set the threshold value

void accumulateSpringForce (Vec &fa, Vec &fb, const Vec &pa, const Vec &pb, const Vec &va, const Vec &vb, const Real &stiffness, const Real &dampingRatio, const Real &restLength)
 Accumulate spring force, given particle states and spring constants.

void accumulateSpringForceAndGradientMatrix (Vec &fa, Vec &fb, Vec &grad, const Vec &pa, const Vec &pb, const Vec &va, const Vec &vb, const Real &stiffness, const Real &dampingRatio, const Real &restLength)
 Accumulate spring force, given particle states and spring constants.

bool computeDistanceAndDirection (Real &d, Vec &u, const Vec &pa, const Vec &pb)
 Compute the distance and direction between two given points.


Public Attributes

VecIndex_links
 The set of indices modeling spring topology.

VecReal_stiffnesses
 the set of stiffnesses

VecReal_restLengths
 The rest lengths of the springs.

bool _own_restLengths
 true iff the rest lengths have been built locally and must be deleted by the destructor

animal::vector< Vec_directions
 Unit vectors modeling spring directions.

Real _isotropy
 Fraction of the force gradient applied independently of the spring direction; used to enhance stability; 0.03 is a reasonable value.


Static Public Attributes

Real _thresholdDistance = 1.e-12
 the minimum threshold distance between two points authorized

bool _debug = false
 print computation detail


Member Typedef Documentation

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef OdeImplicitSolver<t_Positions,t_Vector,typename value_type<t_VecReal>::type> animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_OdeImplicitSolver
 

Convenience for disambiguating multiple inheritance.

Definition at line 63 of file massspringsolver.h.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef PhysicalSolver<t_Positions,t_Vector,t_InvMasses,typename value_type<t_VecReal>::type> animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_PhysicalSolver
 

Parent class.

Definition at line 62 of file massspringsolver.h.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef value_type<VecIndex>::type animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Index
 

Index of a particle.

Reimplemented in animal::MassSpringEngine< Inv_Masses, Velocities, SpringStiffness, IndexedSprings, Points, Real >, and animal::MassSpringEngine< X3DTK::MFFloat, X3DTK::MFVec3f, X3DTK::MFFloat, X3DTK::MFInt32, X3DTK::MFVec3f, float >.

Definition at line 58 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeAccelerationsAndStiffness(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeForces().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef container_traits<Positions>::value_type animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Position
 

Position of a particle.

Definition at line 52 of file massspringsolver.h.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef t_Positions animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Positions
 

Positions of the particles.

Reimplemented from animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 51 of file massspringsolver.h.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef value_type<VecReal>::type animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real
 

Real numbers.

Reimplemented from animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 56 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::accumulateSpringForce(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::accumulateSpringForceAndGradientMatrix(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeDistanceAndDirection(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::get_common_damping_ratio(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::getIsotropy(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::set_common_damping_ratio(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::setIsotropy(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::solveODE(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_eq_h_dfdx_x(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_peq_h_dfdx_x().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef container_traits<Vector>::value_type animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Vec
 

Reimplemented from animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 54 of file massspringsolver.h.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef t_VecIndex animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::VecIndex
 

Vector of indices.

Definition at line 57 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::set_spring_indices().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef t_VecReal animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::VecReal
 

Vector of real numbers.

Definition at line 55 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::set_stiffnesses().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
typedef t_Vector animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Vector
 

Velocities, forces, etc.

Reimplemented from animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 53 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::applyForces(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeAccelerations(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeAccelerationsAndStiffness(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeForces(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::solveODE(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_eq_h_dfdx_x(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_peq_h_dfdx_x().


Constructor & Destructor Documentation

template<class P, class V, class Im, class R, class I>
animal::MassSpringSolver< P, V, Im, R, I >::MassSpringSolver  ) 
 

Definition at line 34 of file massspringsolver.inl.

template<class P, class V, class Im, class R, class I>
animal::MassSpringSolver< P, V, Im, R, I >::~MassSpringSolver  ) 
 

Definition at line 58 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_own_restLengths, and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_restLengths.


Member Function Documentation

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::accumulateSpringForce Vec fa,
Vec fb,
const Vec pa,
const Vec pb,
const Vec va,
const Vec vb,
const Real stiffness,
const Real dampingRatio,
const Real restLength
[static]
 

Accumulate spring force, given particle states and spring constants.

Definition at line 139 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_debug, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeDistanceAndDirection(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real, animal::v_dot(), animal::v_meq(), animal::v_peq(), and animal::v_teq().

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeForces().

template<class P, class Vec, class Im, class Real, class I>
void animal::MassSpringSolver< P, Vec, Im, Real, I >::accumulateSpringForceAndGradientMatrix Vec fa,
Vec fb,
Vec grad,
const Vec pa,
const Vec pb,
const Vec va,
const Vec vb,
const Real stiffness,
const Real dampingRatio,
const Real restLength
[static]
 

Accumulate spring force, given particle states and spring constants.

On output, force is accumulated and grad is a unit vector along spring direction

Definition at line 170 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real, animal::v_dot(), animal::v_meq(), animal::v_peq(), and animal::v_teq().

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeAccelerationsAndStiffness().

template<class Positions, class Vector, class Im, class R, class I>
void animal::MassSpringSolver< Positions, Vector, Im, R, I >::applyForces Vector a,
const Vector f
[virtual]
 

Compute the acceleration of the particles when given forces are applied.

Parameters:
a acceleration
f force

Implements animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 322 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Vector.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeAccelerationsAndStiffness().

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::computeAccelerations Vector a,
const Positions p,
const Vector v
[virtual]
 

Compute the accelerations given particle positions and velocities.

Implements animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 227 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Vector.

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::computeAccelerationsAndStiffness Vector f,
const Positions p,
const Vector v
[virtual]
 

Compute the accelerations given particle positions and velocities, and computes [df/dx].

Implements animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 235 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_directions, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_links, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_restLengths, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_stiffnesses, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::accumulateSpringForceAndGradientMatrix(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::applyForces(), animal::PhysicalSolver< t_Positions, t_Vector, t_InvMasses, t_Real >::applyGravity(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Index, animal::size(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Vector.

template<class P, class V, class Im, class R, class I>
bool animal::MassSpringSolver< P, V, Im, R, I >::computeDistanceAndDirection Real d,
Vec u,
const Vec pa,
const Vec pb
[static]
 

Compute the distance and direction between two given points.

Return false iff the distance is below a security threshold.

Definition at line 195 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::get_thresholdDistance(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real, animal::v_norm(), and animal::v_teq().

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::accumulateSpringForce().

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::computeForces Vector f,
const Positions p,
const Vector v
[virtual]
 

Compute the elastic forces given particle positions and velocities.

Reimplemented from animal::PhysicalSolver< t_Positions, t_Vector, t_InvMasses, t_Real >.

Definition at line 207 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_debug, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_links, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_restLengths, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_stiffnesses, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::accumulateSpringForce(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Index, animal::size(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Vector.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
void animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::create_rest_lengths const Positions p  )  [inline]
 

Set the rest lengths of the springs according to the current particle positions.

Parameters:
p the current positions

Definition at line 98 of file massspringsolver.h.

template<class P, class V, class Im, class R, class I>
const MassSpringSolver< P, V, Im, R, I >::Real & animal::MassSpringSolver< P, V, Im, R, I >::get_common_damping_ratio  )  [virtual]
 

Read property of Real _common_damping_ratio.

Definition at line 89 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
bool animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::get_debugInfo  )  const [inline]
 

Get debug info boolean.

Definition at line 142 of file massspringsolver.h.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
VecReal* animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::get_rest_lengths  )  [inline]
 

rest lengths

Definition at line 130 of file massspringsolver.h.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
Real animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::get_thresholdDistance  )  [inline, static]
 

return the threshold value

Definition at line 133 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeDistanceAndDirection().

template<class P, class V, class Im, class R, class I>
MassSpringSolver< P, V, Im, R, I >::Real animal::MassSpringSolver< P, V, Im, R, I >::getIsotropy  )  const
 

Get the isotropy coefficient.

Definition at line 84 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_isotropy, and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real.

template<class P, class V, class Im, class R, class I>
int animal::MassSpringSolver< P, V, Im, R, I >::getMethod  )  const [virtual]
 

Get the integration method.

Definition at line 74 of file massspringsolver.inl.

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::set_common_damping_ratio const Real _newVal  )  [virtual]
 

Write property of Real _common_damping_ratio.

Definition at line 94 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
void animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::set_debugInfo bool  b  )  [inline]
 

set debug info boolean

Definition at line 145 of file massspringsolver.h.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
void animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::set_rest_lengths VecReal r  )  [inline]
 

Set the given rest lengths.

Parameters:
r the vector of rest lengths

Definition at line 119 of file massspringsolver.h.

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::set_spring_indices VecIndex newVal  )  [virtual]
 

Set the pointer to the spring indices.

Definition at line 100 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_links, and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::VecIndex.

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::set_stiffnesses VecReal newVal  )  [virtual]
 

Set the pointer to the stiffness values.

Definition at line 104 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_stiffnesses, and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::VecReal.

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
void animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::set_thresholdDistance Real  threshold  )  [inline, static]
 

set the threshold value

Definition at line 137 of file massspringsolver.h.

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::setIsotropy Real  isot  ) 
 

Set the isotropy coefficient.

Definition at line 79 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_isotropy, and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real.

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::setMethod int  m  )  [virtual]
 

Set the integration method.

Reimplemented from animal::OdeSolver< t_Positions, t_Vector, t_Real >.

Definition at line 69 of file massspringsolver.inl.

template<class P, class V, class Im, class R, class I>
void animal::MassSpringSolver< P, V, Im, R, I >::solveODE Positions pos,
Vector vel,
Real  dt
[virtual]
 

Solve the ODE then applies exponential damping.

Parameters:
pos positions (current and updated
vel velocities (current and updated)
dt time step

Reimplemented from animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 45 of file massspringsolver.inl.

References animal::PhysicalSolver< t_Positions, t_Vector, t_InvMasses, t_Real >::applyExponentialDamping(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real, and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Vector.

template<class Positions, class Vector, class Im, class Real, class I>
void animal::MassSpringSolver< Positions, Vector, Im, Real, I >::v_eq_h_dfdx_x Vector v,
Real  h,
const Vector x
[virtual]
 

Compute $ v = h [df/dx] x $.

Parameters:
v the result vector
h a scalar
x a given vector

Implements animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 396 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real, animal::v_assign(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_peq_h_dfdx_x(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Vector, and animal::PhysicalSolver< t_Positions, t_Vector, t_InvMasses, t_Real >::zero().

template<class Positions, class Vector, class Im, class Real, class I>
void animal::MassSpringSolver< Positions, Vector, Im, Real, I >::v_peq_h_dfdx_x Vector v,
Real  h,
const Vector x
[virtual]
 

Compute $ v += h ((1-\alpha)[df/dx] + \alpha I) x $.

Parameters:
v the result vector
h a scalar
x a given vector

Implements animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >.

Definition at line 410 of file massspringsolver.inl.

References animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_directions, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_isotropy, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_links, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_stiffnesses, animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Real, animal::size(), animal::v_dot(), animal::v_eq_ab(), animal::v_meq(), animal::v_peq(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::Vector.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_eq_h_dfdx_x().


Member Data Documentation

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
bool animal::MassSpringSolver< P, V, Im, R, I >::_debug = false [static]
 

print computation detail

Definition at line 30 of file massspringsolver.inl.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::accumulateSpringForce(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeForces().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
animal::vector<Vec> animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_directions
 

Unit vectors modeling spring directions.

Definition at line 154 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeAccelerationsAndStiffness(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_peq_h_dfdx_x().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
Real animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_isotropy
 

Fraction of the force gradient applied independently of the spring direction; used to enhance stability; 0.03 is a reasonable value.

Definition at line 155 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::getIsotropy(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::setIsotropy(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_peq_h_dfdx_x().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
VecIndex* animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_links
 

The set of indices modeling spring topology.

Definition at line 149 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeAccelerationsAndStiffness(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeForces(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::set_spring_indices(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_peq_h_dfdx_x().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
bool animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_own_restLengths
 

true iff the rest lengths have been built locally and must be deleted by the destructor

Definition at line 152 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::~MassSpringSolver().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
VecReal* animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_restLengths
 

The rest lengths of the springs.

Definition at line 151 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeAccelerationsAndStiffness(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeForces(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::~MassSpringSolver().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
VecReal* animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::_stiffnesses
 

the set of stiffnesses

Definition at line 150 of file massspringsolver.h.

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeAccelerationsAndStiffness(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeForces(), animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::set_stiffnesses(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_peq_h_dfdx_x().

template<class t_Positions, class t_Vector, class t_InvMasses, class t_VecReal, class t_VecIndex>
MassSpringSolver< P, V, Im, R, I >::Real animal::MassSpringSolver< P, V, Im, R, I >::_thresholdDistance = 1.e-12 [static]
 

the minimum threshold distance between two points authorized

Definition at line 27 of file massspringsolver.inl.


The documentation for this class was generated from the following files:
Generated on Thu Dec 23 13:52:30 2004 by doxygen 1.3.6