CudaFixedConstraint.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef SOFA_GPU_CUDA_CUDAFIXEDCONSTRAINT_H
00026 #define SOFA_GPU_CUDA_CUDAFIXEDCONSTRAINT_H
00027
00028 #include "CudaTypes.h"
00029 #include <sofa/component/constraint/FixedConstraint.h>
00030
00031 namespace sofa
00032 {
00033
00034 namespace component
00035 {
00036
00037 namespace constraint
00038 {
00039
00040 template<class TCoord, class TDeriv, class TReal>
00041 class FixedConstraintInternalData< gpu::cuda::CudaVectorTypes<TCoord,TDeriv,TReal> >
00042 {
00043 public:
00044 typedef FixedConstraintInternalData< gpu::cuda::CudaVectorTypes<TCoord,TDeriv,TReal> > Data;
00045 typedef gpu::cuda::CudaVectorTypes<TCoord,TDeriv,TReal> DataTypes;
00046 typedef FixedConstraint<DataTypes> Main;
00047 typedef typename DataTypes::VecDeriv VecDeriv;
00048 typedef typename DataTypes::Deriv Deriv;
00049 typedef typename DataTypes::Real Real;
00050 typedef typename Main::SetIndex SetIndex;
00051
00052
00053 int minIndex;
00054 int maxIndex;
00055
00056 gpu::cuda::CudaVector<int> cudaIndices;
00057
00058 static void init(Main* m);
00059
00060 static void addConstraint(Main* m, unsigned int index);
00061
00062 static void removeConstraint(Main* m, unsigned int index);
00063
00064 static void projectResponse(Main* m, VecDeriv& dx);
00065 };
00066
00067
00068 #define CudaFixedConstraint_DeclMethods(T) \
00069 template<> void FixedConstraint< T >::init(); \
00070 template<> void FixedConstraint< T >::addConstraint(unsigned int index); \
00071 template<> void FixedConstraint< T >::removeConstraint(unsigned int index); \
00072 template<> void FixedConstraint< T >::projectResponse(VecDeriv& dx);
00073
00074 CudaFixedConstraint_DeclMethods(gpu::cuda::CudaVec3fTypes);
00075 CudaFixedConstraint_DeclMethods(gpu::cuda::CudaVec3f1Types);
00076
00077
00078 #undef CudaFixedConstraint_DeclMethods
00079
00080 }
00081
00082 }
00083
00084 }
00085
00086 #endif