#include <CudaTestForceField.h>


Data Structures | |
| struct | GPUElement |
| Static data associated with each element. More... | |
| struct | GPUElementState |
| Varying data associated with each element. More... | |
Public Types | |
| typedef CudaVec3fTypes::Real | Real |
| typedef CudaVec3fTypes::Coord | Coord |
| typedef sofa::core::componentmodel::topology::BaseMeshTopology::Cube | Element |
| typedef sofa::core::componentmodel::topology::BaseMeshTopology::SeqCubes | VecElement |
Public Member Functions | |
| CudaTestForceField () | |
| void | init () |
| Initialization method called at graph modification, during bottom-up traversal. | |
| void | reinit () |
| Update method called when variables used in precomputation are modified. | |
| void | addForce (VecDeriv &f, const VecCoord &x, const VecDeriv &) |
| void | addDForce (VecDeriv &df, const VecDeriv &dx) |
| double | getPotentialEnergy (const VecCoord &) |
Data Fields | |
| CudaVector< GPUElement > | elems |
| CudaVector< GPUElementState > | state |
| int | nbVertex |
| number of vertices to process to compute all elements | |
| int | nbElementPerVertex |
| max number of elements connected to a vertex | |
| CudaVector< int > | velems |
| Index of elements attached to each points (layout per bloc of NBLOC vertices, with first element of each vertex, then second element, etc) No that each integer is actually equat the the index of the element * 8 + the index of this vertex inside the element. | |
Protected Member Functions | |
| void | init (int nbe, int nbv, int nbelemperv) |
| void | setV (int vertex, int num, int index) |
| void | setE (int i, const Element &indices, Real vol, Real r, Real Kvol, Real Kr) |
Definition at line 43 of file CudaTestForceField.h.
Reimplemented from sofa::core::componentmodel::behavior::ForceField< TDataTypes >.
Definition at line 47 of file CudaTestForceField.h.
| typedef sofa::core::componentmodel::topology::BaseMeshTopology::Cube sofa::gpu::cuda::CudaTestForceField::Element |
Definition at line 52 of file CudaTestForceField.h.
Definition at line 46 of file CudaTestForceField.h.
| typedef sofa::core::componentmodel::topology::BaseMeshTopology::SeqCubes sofa::gpu::cuda::CudaTestForceField::VecElement |
Definition at line 53 of file CudaTestForceField.h.
| sofa::gpu::cuda::CudaTestForceField::CudaTestForceField | ( | ) |
Definition at line 50 of file CudaTestForceField.cpp.
Definition at line 135 of file CudaTestForceField.cpp.
References sofa::gpu::cuda::CudaTestForceField3f_addDForce(), sofa::gpu::cuda::CudaVector< T >::deviceRead(), sofa::gpu::cuda::CudaVector< T >::deviceWrite(), elems, nbElementPerVertex, nbVertex, sofa::gpu::cuda::CudaVector< T >::size(), state, and velems.
| void sofa::gpu::cuda::CudaTestForceField::addForce | ( | VecDeriv & | f, | |
| const VecCoord & | x, | |||
| const VecDeriv & | v | |||
| ) |
Definition at line 120 of file CudaTestForceField.cpp.
References sofa::gpu::cuda::CudaTestForceField3f_addForce(), sofa::gpu::cuda::CudaVector< T >::deviceRead(), sofa::gpu::cuda::CudaVector< T >::deviceWrite(), elems, nbElementPerVertex, nbVertex, sofa::gpu::cuda::CudaVector< T >::size(), state, and velems.
| double sofa::gpu::cuda::CudaTestForceField::getPotentialEnergy | ( | const VecCoord & | ) | [inline] |
Definition at line 99 of file CudaTestForceField.h.
| void sofa::gpu::cuda::CudaTestForceField::init | ( | int | nbe, | |
| int | nbv, | |||
| int | nbelemperv | |||
| ) | [inline, protected] |
Definition at line 103 of file CudaTestForceField.h.
References BSIZE, elems, nbElementPerVertex, nbVertex, sofa::gpu::cuda::CudaVector< T >::resize(), sofa::gpu::cuda::CudaVector< T >::size(), state, and velems.
| void sofa::gpu::cuda::CudaTestForceField::init | ( | void | ) | [virtual] |
Initialization method called at graph modification, during bottom-up traversal.
Reimplemented from sofa::core::componentmodel::behavior::ForceField< TDataTypes >.
Definition at line 55 of file CudaTestForceField.cpp.
References reinit().
Referenced by reinit().
| void sofa::gpu::cuda::CudaTestForceField::reinit | ( | ) | [virtual] |
Update method called when variables used in precomputation are modified.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 61 of file CudaTestForceField.cpp.
References sofa::core::objectmodel::BaseContext::get(), sofa::core::objectmodel::BaseObject::getContext(), sofa::core::componentmodel::topology::BaseMeshTopology::getHexas(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbHexas(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX(), init(), sofa::core::componentmodel::behavior::ForceField< TDataTypes >::mstate, setE(), and setV().
Referenced by init().
| void sofa::gpu::cuda::CudaTestForceField::setE | ( | int | i, | |
| const Element & | indices, | |||
| Real | vol, | |||
| Real | r, | |||
| Real | Kvol, | |||
| Real | Kr | |||
| ) | [inline, protected] |
Definition at line 124 of file CudaTestForceField.h.
References elems, sofa::gpu::cuda::CudaTestForceField::GPUElement::initr, sofa::gpu::cuda::CudaTestForceField::GPUElement::initvol, sofa::gpu::cuda::CudaTestForceField::GPUElement::Kr, sofa::gpu::cuda::CudaTestForceField::GPUElement::Kvol, and sofa::gpu::cuda::CudaTestForceField::GPUElement::v.
Referenced by reinit().
| void sofa::gpu::cuda::CudaTestForceField::setV | ( | int | vertex, | |
| int | num, | |||
| int | index | |||
| ) | [inline, protected] |
Definition at line 114 of file CudaTestForceField.h.
References BSIZE, nbElementPerVertex, and velems.
Referenced by reinit().
Definition at line 73 of file CudaTestForceField.h.
Referenced by addDForce(), addForce(), init(), and setE().
max number of elements connected to a vertex
Definition at line 89 of file CudaTestForceField.h.
Referenced by addDForce(), addForce(), init(), and setV().
number of vertices to process to compute all elements
Definition at line 88 of file CudaTestForceField.h.
Referenced by addDForce(), addForce(), and init().
Definition at line 86 of file CudaTestForceField.h.
Referenced by addDForce(), addForce(), and init().
Index of elements attached to each points (layout per bloc of NBLOC vertices, with first element of each vertex, then second element, etc) No that each integer is actually equat the the index of the element * 8 + the index of this vertex inside the element.
Definition at line 92 of file CudaTestForceField.h.
Referenced by addDForce(), addForce(), init(), and setV().
1.5.7.1