sofa::component::forcefield::BeamFEMForceField< DataTypes > Class Template Reference

Compute Finite Element forces based on 6D beam elements. More...

#include <BeamFEMForceField.h>

Inheritance diagram for sofa::component::forcefield::BeamFEMForceField< DataTypes >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::forcefield::BeamFEMForceField< DataTypes >:

Collaboration graph
[legend]

Data Structures

struct  BeamInfo

Public Types

typedef DataTypes::VecCoord VecCoord
typedef DataTypes::VecDeriv VecDeriv
typedef DataTypes::VecReal VecReal
typedef VecCoord Vector
typedef DataTypes::Coord Coord
typedef DataTypes::Deriv Deriv
typedef Coord::value_type Real
typedef unsigned int Index
typedef topology::Edge Element
typedef sofa::helper::vector
< topology::Edge > 
VecElement

Public Member Functions

 BeamFEMForceField ()
void setUpdateStiffnessMatrix (bool val)
void setComputeGlobalMatrix (bool val)
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
virtual void reinit ()
 Update method called when variables used in precomputation are modified.
virtual void reinitBeam (unsigned int i)
virtual void handleTopologyChange ()
 Handle topological Changes.
virtual void addForce (VecDeriv &f, const VecCoord &x, const VecDeriv &v)
 Given the current position and velocity states, update the current force vector by computing and adding the forces associated with this ForceField.
virtual void addDForce (VecDeriv &df, const VecDeriv &dx)
 Compute the force derivative given a small displacement from the position and velocity used in the previous call to addForce().
virtual double getPotentialEnergy (const VecCoord &)
 Get the potential energy associated to this ForceField.
void addKToMatrix (sofa::defaulttype::BaseMatrix *mat, SReal k, unsigned int &offset)
 Compute the system matrix corresponding to k K.
void draw ()
 Render internal data of this object, for debugging purposes.
void setBeam (unsigned int i, double E, double L, double nu, double r)
void initBeams (unsigned int size)

Protected Types

typedef Vec< 12, Real > Displacement
 the displacement vector
typedef Mat< 3, 3, Real > Transformation
 matrix for rigid transformations like rotations
typedef Mat< 12, 12, Real > StiffnessMatrix

Protected Member Functions

Quat & beamQuat (int i)
Real peudo_determinant_for_coef (const Mat< 2, 3, Real > &M)
void computeStiffness (int i, Index a, Index b)
void initLarge (int i, Index a, Index b)
void accumulateForceLarge (VecDeriv &f, const VecCoord &x, int i, Index a, Index b)
void applyStiffnessLarge (VecDeriv &f, const VecDeriv &x, int i, Index a, Index b)

Static Protected Member Functions

static void BeamFEMEdgeCreationFunction (int edgeIndex, void *param, BeamInfo &ei, const topology::Edge &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &)

Protected Attributes

VecDeriv _forces
topology::EdgeData< BeamInfo > beamsData
const VecElement * _indexedElements
Data< VecCoord > _initialPoints
 the intial positions of the points
int _method
 the computation method of the displacements
Data< Real > _poissonRatio
Data< Real > _youngModulus
Data< bool > _timoshenko
Data< Real > _radius
bool _updateStiffnessMatrix
bool _assembling
StiffnessContainer * stiffnessContainer
LengthContainer * lengthContainer
PoissonContainer * poissonContainer
RadiusContainer * radiusContainer
sofa::core::componentmodel::topology::BaseMeshTopology * _topology
vector< Transformation > _nodeRotations

Detailed Description

template<class DataTypes>
class sofa::component::forcefield::BeamFEMForceField< DataTypes >

Compute Finite Element forces based on 6D beam elements.

Definition at line 57 of file BeamFEMForceField.h.


Member Typedef Documentation

template<class DataTypes >
typedef DataTypes::Coord sofa::component::forcefield::BeamFEMForceField< DataTypes >::Coord

template<class DataTypes >
typedef DataTypes::Deriv sofa::component::forcefield::BeamFEMForceField< DataTypes >::Deriv

template<class DataTypes >
typedef Vec<12, Real> sofa::component::forcefield::BeamFEMForceField< DataTypes >::Displacement [protected]

the displacement vector

Definition at line 76 of file BeamFEMForceField.h.

Definition at line 69 of file BeamFEMForceField.h.

template<class DataTypes >
typedef unsigned int sofa::component::forcefield::BeamFEMForceField< DataTypes >::Index

Definition at line 68 of file BeamFEMForceField.h.

template<class DataTypes >
typedef Coord::value_type sofa::component::forcefield::BeamFEMForceField< DataTypes >::Real

Definition at line 66 of file BeamFEMForceField.h.

template<class DataTypes >
typedef Mat<12, 12, Real> sofa::component::forcefield::BeamFEMForceField< DataTypes >::StiffnessMatrix [protected]

Definition at line 89 of file BeamFEMForceField.h.

template<class DataTypes >
typedef Mat<3, 3, Real> sofa::component::forcefield::BeamFEMForceField< DataTypes >::Transformation [protected]

matrix for rigid transformations like rotations

Definition at line 86 of file BeamFEMForceField.h.

template<class DataTypes >
typedef DataTypes::VecCoord sofa::component::forcefield::BeamFEMForceField< DataTypes >::VecCoord

template<class DataTypes >
typedef DataTypes::VecDeriv sofa::component::forcefield::BeamFEMForceField< DataTypes >::VecDeriv

Definition at line 70 of file BeamFEMForceField.h.

template<class DataTypes >
typedef DataTypes::VecReal sofa::component::forcefield::BeamFEMForceField< DataTypes >::VecReal

Definition at line 62 of file BeamFEMForceField.h.

Definition at line 63 of file BeamFEMForceField.h.


Constructor & Destructor Documentation

template<class DataTypes >
sofa::component::forcefield::BeamFEMForceField< DataTypes >::BeamFEMForceField (  )  [inline]

Definition at line 157 of file BeamFEMForceField.h.


Member Function Documentation

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::accumulateForceLarge ( VecDeriv &  f,
const VecCoord &  x,
int  i,
Index  a,
Index  b 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::addDForce ( VecDeriv &  df,
const VecDeriv &  dx 
) [inline, virtual]

Compute the force derivative given a small displacement from the position and velocity used in the previous call to addForce().

The derivative should be directly derived from the computations done by addForce. Any forces neglected in addDForce will be integrated explicitly (i.e. using its value at the beginning of the timestep).

If the ForceField can be represented as a matrix, this method computes $ df += K dx $

This method must be implemented by the component, and is usually called by the generic ForceField::addDForce() method.

Deprecated:
to more efficiently accumulate contributions from all terms of the system equation, a new addDForce method allowing to pass two coefficients for the stiffness and damping terms should now be used.

Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.

Definition at line 223 of file BeamFEMForceField.inl.

References sofa::component::forcefield::BeamFEMForceField< DataTypes >::_indexedElements, and sofa::component::forcefield::BeamFEMForceField< DataTypes >::applyStiffnessLarge().

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::addForce ( VecDeriv &  f,
const VecCoord &  x,
const VecDeriv &  v 
) [inline, virtual]

Given the current position and velocity states, update the current force vector by computing and adding the forces associated with this ForceField.

If the ForceField can be represented as a matrix, this method computes $ f += B v + K x $

This method must be implemented by the component, and is usually called by the generic ForceField::addForce() method.

Implements sofa::core::componentmodel::behavior::ForceField< DataTypes >.

Definition at line 192 of file BeamFEMForceField.inl.

References sofa::component::forcefield::BeamFEMForceField< DataTypes >::_indexedElements, sofa::component::forcefield::BeamFEMForceField< DataTypes >::_nodeRotations, sofa::component::forcefield::BeamFEMForceField< DataTypes >::accumulateForceLarge(), and sofa::component::forcefield::BeamFEMForceField< DataTypes >::initLarge().

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::addKToMatrix ( sofa::defaulttype::BaseMatrix *  matrix,
SReal  kFact,
unsigned int &  offset 
) [inline, virtual]

Compute the system matrix corresponding to k K.

Parameters:
matrix matrix to add the result to
kFact coefficient for stiffness contributions (i.e. DOFs term in the ODE)
offset current row/column offset

Reimplemented from sofa::core::componentmodel::behavior::BaseForceField.

Definition at line 447 of file BeamFEMForceField.inl.

References sofa::component::forcefield::BeamFEMForceField< DataTypes >::_indexedElements, sofa::defaulttype::BaseMatrix::add(), sofa::component::forcefield::BeamFEMForceField< DataTypes >::beamQuat(), sofa::component::forcefield::BeamFEMForceField< DataTypes >::beamsData, sofa::defaulttype::Mat< L, C, real >::setsub(), and sofa::helper::Quater< Real >::toMatrix().

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::applyStiffnessLarge ( VecDeriv &  f,
const VecDeriv &  x,
int  i,
Index  a,
Index  b 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::BeamFEMEdgeCreationFunction ( int  edgeIndex,
void *  param,
BeamInfo &  ei,
const topology::Edge &  e,
const sofa::helper::vector< unsigned int > &  a,
const sofa::helper::vector< double > &   
) [inline, static, protected]

template<class DataTypes >
Quat& sofa::component::forcefield::BeamFEMForceField< DataTypes >::beamQuat ( int  i  )  [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::computeStiffness ( int  i,
Index  a,
Index  b 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::draw (  )  [inline, virtual]

template<class DataTypes >
virtual double sofa::component::forcefield::BeamFEMForceField< DataTypes >::getPotentialEnergy ( const VecCoord &  x  )  [inline, virtual]

Get the potential energy associated to this ForceField.

Used to extimate the total energy of the system by some post-stabilization techniques.

This method must be implemented by the component, and is usually called by the generic ForceField::getPotentialEnergy() method.

Implements sofa::core::componentmodel::behavior::ForceField< DataTypes >.

Definition at line 186 of file BeamFEMForceField.h.

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::handleTopologyChange (  )  [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::init ( void   )  [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::initBeams ( unsigned int  size  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::initLarge ( int  i,
Index  a,
Index  b 
) [inline, protected]

template<class DataTypes >
BeamFEMForceField< DataTypes >::Real sofa::component::forcefield::BeamFEMForceField< DataTypes >::peudo_determinant_for_coef ( const Mat< 2, 3, Real > &  M  )  [inline, protected]

Definition at line 243 of file BeamFEMForceField.inl.

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::reinit (  )  [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::reinitBeam ( unsigned int  i  )  [inline, virtual]

Definition at line 139 of file BeamFEMForceField.inl.

References sofa::component::forcefield::BeamFEMForceField< DataTypes >::_poissonRatio, sofa::component::forcefield::BeamFEMForceField< DataTypes >::_radius, sofa::component::forcefield::BeamFEMForceField< DataTypes >::_youngModulus, sofa::component::forcefield::BeamFEMForceField< DataTypes >::beamsData, sofa::component::forcefield::BeamFEMForceField< DataTypes >::computeStiffness(), sofa::component::LengthContainer::getLength(), sofa::component::PoissonContainer::getPoisson(), sofa::component::RadiusContainer::getRadius(), sofa::core::componentmodel::behavior::BaseMechanicalState::getSize(), sofa::component::StiffnessContainer::getStiffness(), sofa::core::objectmodel::Data< T >::getValue(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX0(), sofa::component::forcefield::BeamFEMForceField< DataTypes >::initLarge(), sofa::component::forcefield::BeamFEMForceField< DataTypes >::lengthContainer, sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate, norm(), sofa::component::forcefield::BeamFEMForceField< DataTypes >::poissonContainer, sofa::component::forcefield::BeamFEMForceField< DataTypes >::radiusContainer, sofa::component::forcefield::BeamFEMForceField< DataTypes >::setBeam(), and sofa::component::forcefield::BeamFEMForceField< DataTypes >::stiffnessContainer.

Referenced by sofa::component::forcefield::BeamFEMForceField< DataTypes >::BeamFEMEdgeCreationFunction(), and sofa::component::forcefield::BeamFEMForceField< DataTypes >::reinit().

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::setBeam ( unsigned int  i,
double  E,
double  L,
double  nu,
double  r 
) [inline]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::setComputeGlobalMatrix ( bool  val  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::BeamFEMForceField< DataTypes >::setUpdateStiffnessMatrix ( bool  val  )  [inline]


Field Documentation

template<class DataTypes >
bool sofa::component::forcefield::BeamFEMForceField< DataTypes >::_assembling [protected]

template<class DataTypes >
VecDeriv sofa::component::forcefield::BeamFEMForceField< DataTypes >::_forces [protected]

template<class DataTypes >
const VecElement* sofa::component::forcefield::BeamFEMForceField< DataTypes >::_indexedElements [protected]

the intial positions of the points

Definition at line 138 of file BeamFEMForceField.h.

Referenced by sofa::component::forcefield::BeamFEMForceField< DataTypes >::init().

template<class DataTypes >
int sofa::component::forcefield::BeamFEMForceField< DataTypes >::_method [protected]

the computation method of the displacements

Definition at line 139 of file BeamFEMForceField.h.

template<class DataTypes >
Data<Real> sofa::component::forcefield::BeamFEMForceField< DataTypes >::_radius [protected]

template<class DataTypes >
Data<bool> sofa::component::forcefield::BeamFEMForceField< DataTypes >::_timoshenko [protected]

Definition at line 142 of file BeamFEMForceField.h.


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

Generated on Sun Nov 23 04:18:40 2008 for Sofa by  doxygen 1.5.7.1