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

Compute Finite Element forces based on hexahedral elements. More...

#include <HexahedralFEMForceField.h>

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

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

Collaboration graph
[legend]

Data Structures

class  HexahedronInformation
 the information stored for each hexahedron More...

Public Types

typedef DataTypes::VecCoord VecCoord
typedef DataTypes::VecDeriv VecDeriv
typedef VecCoord Vector
typedef DataTypes::Coord Coord
typedef DataTypes::Deriv Deriv
typedef Coord::value_type Real
typedef
core::componentmodel::topology::BaseMeshTopology::index_type 
Index
typedef
core::componentmodel::topology::BaseMeshTopology::Cube 
Element
typedef
core::componentmodel::topology::BaseMeshTopology::SeqCubes 
VecElement

Public Member Functions

 HexahedralFEMForceField ()
void parse (core::objectmodel::BaseObjectDescription *arg)
 Parse the given description to assign values to this object's fields and potentially other parameters.
void setPoissonRatio (Real val)
void setYoungModulus (Real val)
void setMethod (int 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 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 &x)
 Get the potential energy associated to this ForceField.
virtual void handleTopologyChange ()
 Handle topological Changes.
void draw ()
 Render internal data of this object, for debugging purposes.

Data Fields

int method
Data< std::string > f_method
 the computation method of the displacements
Data< Real > f_poissonRatio
Data< Real > f_youngModulus
Data< bool > f_assembling

Static Public Attributes

static const int LARGE = 0
 Symbol of large displacements hexahedron solver.
static const int POLAR = 1
 Symbol of polar displacements hexahedron solver.

Protected Types

typedef Vec< 24, Real > Displacement
 the displacement vector
typedef Mat< 6, 6, Real > MaterialStiffness
 the matrix of material stiffness
typedef vector< MaterialStiffness > VecMaterialStiffness
 a vector of material stiffness matrices
typedef Mat< 24, 24, Real > ElementStiffness
typedef vector< ElementStiffness > VecElementStiffness
typedef Mat< 3, 3, Real > Mat33
typedef Mat33 Transformation
 matrix for rigid transformations like rotations
typedef std::pair< int, Real > Col_Value
typedef vector< Col_Value > CompressedValue
typedef vector< CompressedValue > CompressedMatrix

Protected Member Functions

virtual void computeElementStiffness (ElementStiffness &K, const MaterialStiffness &M, const Vec< 8, Coord > &nodes, const int elementIndice)
Mat33 integrateStiffness (int signx0, int signy0, int signz0, int signx1, int signy1, int signz1, const Real u, const Real v, const Real w, const Mat33 &J_1)
void computeMaterialStiffness (int i)
void computeForce (Displacement &F, const Displacement &Depl, const ElementStiffness &K)
void initLarge (int i)
void computeRotationLarge (Transformation &r, Coord &edgex, Coord &edgey)
virtual void accumulateForceLarge (Vector &f, const Vector &p, int i)
void initPolar (int i)
void computeRotationPolar (Transformation &r, Vec< 8, Coord > &nodes)
virtual void accumulateForcePolar (Vector &f, const Vector &p, int i)

Static Protected Member Functions

static void FHexahedronCreationFunction (int, void *, HexahedronInformation &, const Hexahedron &, const helper::vector< unsigned int > &, const helper::vector< double > &)
 the callback function called when a hexahedron is created

Protected Attributes

HexahedronData
< HexahedronInformation > 
hexahedronInfo
 container that stotes all requires information for each hexahedron
double m_potentialEnergy
sofa::core::componentmodel::topology::BaseMeshTopology * _topology
Mat< 8, 3, int > _coef
 coef of each vertices to compute the strain stress matrix
bool _alreadyInit

Detailed Description

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

Compute Finite Element forces based on hexahedral elements.

Corotational hexahedron from {NMPCPF05, author = "Nesme, Matthieu and Marchal, Maud and Promayon, Emmanuel and Chabanas, Matthieu and Payan, Yohan and Faure, Fran\c{c}ois", title = "Physically Realistic Interactive Simulation for Biological Soft Tissues", journal = "Recent Research Developments in Biomechanics", volume = "2", year = "2005", keywords = "surgical simulation physical animation truth cube", url = "http://www-evasion.imag.fr/Publications/2005/NMPCPF05" }

indices ordering (same as in HexahedronSetTopology):

Y 7---------6 ^ / /| |/ Z / | 3----^----2 | | / | | | 4------|--5 | / | / |/ |/ 0---------1-->X

Definition at line 78 of file HexahedralFEMForceField.h.


Member Typedef Documentation

template<class DataTypes >
typedef std::pair<int,Real> sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::Col_Value [protected]

Definition at line 138 of file HexahedralFEMForceField.h.

Definition at line 140 of file HexahedralFEMForceField.h.

Definition at line 139 of file HexahedralFEMForceField.h.

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

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

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

the displacement vector

Definition at line 102 of file HexahedralFEMForceField.h.

template<class DataTypes >
typedef core::componentmodel::topology::BaseMeshTopology::Cube sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::Element

Definition at line 93 of file HexahedralFEMForceField.h.

template<class DataTypes >
typedef Mat<24, 24, Real> sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::ElementStiffness [protected]

Definition at line 108 of file HexahedralFEMForceField.h.

Definition at line 88 of file HexahedralFEMForceField.h.

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

Definition at line 112 of file HexahedralFEMForceField.h.

template<class DataTypes >
typedef Mat<6, 6, Real> sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::MaterialStiffness [protected]

the matrix of material stiffness

Definition at line 104 of file HexahedralFEMForceField.h.

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

Definition at line 86 of file HexahedralFEMForceField.h.

template<class DataTypes >
typedef Mat33 sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::Transformation [protected]

matrix for rigid transformations like rotations

Definition at line 113 of file HexahedralFEMForceField.h.

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

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

template<class DataTypes >
typedef core::componentmodel::topology::BaseMeshTopology::SeqCubes sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::VecElement

Definition at line 94 of file HexahedralFEMForceField.h.

Definition at line 109 of file HexahedralFEMForceField.h.

a vector of material stiffness matrices

Definition at line 105 of file HexahedralFEMForceField.h.

Definition at line 83 of file HexahedralFEMForceField.h.


Constructor & Destructor Documentation


Member Function Documentation

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::accumulateForceLarge ( Vector &  f,
const Vector &  p,
int  i 
) [inline, protected, virtual]

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::accumulateForcePolar ( Vector &  f,
const Vector &  p,
int  i 
) [inline, protected, virtual]

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< 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 258 of file HexahedralFEMForceField.inl.

References sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::_topology, sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::computeForce(), sofa::core::componentmodel::topology::BaseMeshTopology::getHexa(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbHexas(), and sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::hexahedronInfo.

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

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::computeElementStiffness ( ElementStiffness &  K,
const MaterialStiffness &  M,
const Vec< 8, Coord > &  nodes,
const int  elementIndice 
) [inline, protected, virtual]

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::computeForce ( Displacement &  F,
const Displacement &  Depl,
const ElementStiffness &  K 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::computeMaterialStiffness ( int  i  )  [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::computeRotationLarge ( Transformation &  r,
Coord &  edgex,
Coord &  edgey 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::computeRotationPolar ( Transformation &  r,
Vec< 8, Coord > &  nodes 
) [inline, protected]

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

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::FHexahedronCreationFunction ( int  hexahedronIndex,
void *  param,
HexahedronInformation &  ,
const Hexahedron &  ,
const helper::vector< unsigned int > &  ,
const helper::vector< double > &   
) [inline, static, protected]

template<class DataTypes >
double sofa::component::forcefield::HexahedralFEMForceField< 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 293 of file HexahedralFEMForceField.inl.

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

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

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

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::initPolar ( int  i  )  [inline, protected]

template<class DataTypes >
HexahedralFEMForceField< DataTypes >::Mat33 sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::integrateStiffness ( int  signx0,
int  signy0,
int  signz0,
int  signx1,
int  signy1,
int  signz1,
const Real  u,
const Real  v,
const Real  w,
const Mat33 &  J_1 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::parse ( core::objectmodel::BaseObjectDescription *  arg  )  [inline, virtual]

Parse the given description to assign values to this object's fields and potentially other parameters.

Reimplemented from sofa::core::objectmodel::Base.

Definition at line 97 of file HexahedralFEMForceField.inl.

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

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

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::setMethod ( int  val  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::setPoissonRatio ( Real  val  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::setYoungModulus ( Real  val  )  [inline]


Field Documentation

template<class DataTypes >
Mat<8,3,int> sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::_coef [protected]

template<class DataTypes >
Data<std::string> sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::f_method

the computation method of the displacements

Definition at line 157 of file HexahedralFEMForceField.h.

Referenced by sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::reinit().

template<class DataTypes >
const int sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::LARGE = 0 [static]

template<class DataTypes >
double sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::m_potentialEnergy [protected]

Definition at line 142 of file HexahedralFEMForceField.h.

template<class DataTypes >
const int sofa::component::forcefield::HexahedralFEMForceField< DataTypes >::POLAR = 1 [static]


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

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