CudaEllipsoidForceField.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_CUDAELLIPSOIDFORCEFIELD_H
00026 #define SOFA_GPU_CUDA_CUDAELLIPSOIDFORCEFIELD_H
00027
00028 #include "CudaTypes.h"
00029 #include <sofa/component/forcefield/EllipsoidForceField.h>
00030
00031 namespace sofa
00032 {
00033
00034 namespace gpu
00035 {
00036
00037 namespace cuda
00038 {
00039
00040 struct GPUEllipsoid
00041 {
00042 defaulttype::Vec3f center;
00043 defaulttype::Vec3f inv_r2;
00044 float stiffness;
00045 float damping;
00046 };
00047
00048 }
00049
00050 }
00051
00052 namespace component
00053 {
00054
00055 namespace forcefield
00056 {
00057
00058 template <>
00059 class EllipsoidForceFieldInternalData<gpu::cuda::CudaVec3fTypes>
00060 {
00061 public:
00062 gpu::cuda::GPUEllipsoid ellipsoid;
00063 gpu::cuda::CudaVector<float> tmp;
00064 };
00065
00066 template <>
00067 void EllipsoidForceField<gpu::cuda::CudaVec3fTypes>::addForce (VecDeriv& f, const VecCoord& x, const VecDeriv& v);
00068
00069 template <>
00070 void EllipsoidForceField<gpu::cuda::CudaVec3fTypes>::addDForce (VecDeriv& df, const VecDeriv& dx, double kFactor, double bFactor);
00071
00072 template <>
00073 class EllipsoidForceFieldInternalData<gpu::cuda::CudaVec3f1Types>
00074 {
00075 public:
00076 gpu::cuda::GPUEllipsoid ellipsoid;
00077 gpu::cuda::CudaVector<float> tmp;
00078 };
00079
00080 template <>
00081 void EllipsoidForceField<gpu::cuda::CudaVec3f1Types>::addForce (VecDeriv& f, const VecCoord& x, const VecDeriv& v);
00082
00083 template <>
00084 void EllipsoidForceField<gpu::cuda::CudaVec3f1Types>::addDForce (VecDeriv& df, const VecDeriv& dx, double kFactor, double bFactor);
00085
00086 }
00087
00088 }
00089
00090 }
00091
00092 #endif