|
20 | 20 | * Contact information: contact@sofa-framework.org * |
21 | 21 | ******************************************************************************/ |
22 | 22 | #include <BeamAdapter/CUDA/config.h> |
23 | | -#include <SofaCUDA/sofa/gpu/cuda/CudaTypes.h> |
| 23 | +#include <sofa/gpu/cuda/CudaTypes.h> |
24 | 24 |
|
25 | 25 | #include <BeamAdapter/component/WireBeamInterpolation.inl> |
26 | 26 | #include <BeamAdapter/component/BeamInterpolation.inl> |
|
36 | 36 | #include <sofa/core/behavior/Mass.inl> |
37 | 37 | #include <sofa/core/Mapping.inl> |
38 | 38 | #include <sofa/component/controller/MechanicalStateController.inl> |
39 | | -#include <sofa/component/constraint/projective/FixedConstraint.inl> // for InterventionalRadiologyController |
| 39 | +#include <sofa/component/constraint/projective/FixedProjectiveConstraint.inl> // for InterventionalRadiologyController |
40 | 40 |
|
41 | 41 | #include <sofa/core/ObjectFactory.h> |
42 | 42 |
|
43 | 43 | using namespace sofa::gpu::cuda; |
44 | 44 |
|
45 | | -namespace sofa::component::fem::_beaminterpolation_ |
| 45 | +namespace beamadapter::cuda |
46 | 46 | { |
47 | 47 | // template class SOFA_BEAMADAPTER_CUDA_API BeamInterpolation<CudaRigid3fTypes>; |
48 | | -#ifdef SOFA_GPU_CUDA_DOUBLE |
49 | | - template class SOFA_BEAMADAPTER_CUDA_API BeamInterpolation<CudaRigid3dTypes>; |
50 | | -#endif |
51 | | -} // namespace sofa::component::fem::_beaminterpolation_ |
52 | | - |
53 | | -namespace sofa::component::fem::_wirebeaminterpolation_ |
54 | | -{ |
55 | 48 | // template class SOFA_BEAMADAPTER_CUDA_API WireBeamInterpolation<CudaRigid3fTypes>; |
56 | | -#ifdef SOFA_GPU_CUDA_DOUBLE |
57 | | - template class SOFA_BEAMADAPTER_CUDA_API WireBeamInterpolation<CudaRigid3dTypes>; |
58 | | -#endif |
59 | | -} // namespace sofa::component::fem::_beaminterpolation_ |
60 | | - |
61 | | -namespace sofa::component::engine::_wirerestshape_ |
62 | | -{ |
63 | 49 | template class SOFA_BEAMADAPTER_CUDA_API WireRestShape<CudaRigid3fTypes>; |
64 | | -#ifdef SOFA_GPU_CUDA_DOUBLE |
65 | | - template class SOFA_BEAMADAPTER_CUDA_API WireRestShape<CudaRigid3dTypes>; |
66 | | -#endif |
67 | | -} // namespace sofa::component::engine::_wirerestshape_ |
68 | | - |
69 | | -namespace sofa::component::controller::_interventionalradiologycontroller_ |
70 | | -{ |
71 | 50 | template class SOFA_BEAMADAPTER_CUDA_API InterventionalRadiologyController<CudaRigid3fTypes>; |
72 | | -#ifdef SOFA_GPU_CUDA_DOUBLE |
73 | | - template class SOFA_BEAMADAPTER_CUDA_API InterventionalRadiologyController<CudaRigid3dTypes>; |
74 | | -#endif |
75 | | -} // namespace sofa::component::controller::_interventionalradiologycontroller_ |
76 | | - |
77 | | -namespace sofa::component::mapping::_adaptivebeammapping_ |
78 | | -{ |
79 | 51 | template class SOFA_BEAMADAPTER_CUDA_API AdaptiveBeamMapping<CudaRigid3fTypes, defaulttype::Vec3Types>; |
80 | | -#ifdef SOFA_GPU_CUDA_DOUBLE |
81 | | - template class SOFA_BEAMADAPTER_CUDA_API AdaptiveBeamMapping<CudaRigid3dTypes, defaulttype::Vec3Types>; |
82 | | -#endif |
83 | | -} // namespace sofa::component::mapping::_adaptivebeammapping_ |
84 | | - |
85 | | -namespace sofa::component::mapping |
86 | | -{ |
87 | 52 | template class SOFA_BEAMADAPTER_CUDA_API MultiAdaptiveBeamMapping<CudaRigid3fTypes, defaulttype::Vec3Types>; |
88 | | -#ifdef SOFA_GPU_CUDA_DOUBLE |
89 | | - template class SOFA_BEAMADAPTER_CUDA_API MultiAdaptiveBeamMapping<CudaRigid3dTypes, defaulttype::Vec3Types>; |
90 | | -#endif |
91 | | -} // namespace sofa::component::mapping |
92 | | - |
93 | | -namespace sofa::beamadapter |
94 | | -{ |
95 | 53 | template class SOFA_BEAMADAPTER_CUDA_API RodMeshSection<CudaRigid3fTypes>; |
96 | 54 | template class SOFA_BEAMADAPTER_CUDA_API RodSpireSection<CudaRigid3fTypes>; |
97 | 55 | template class SOFA_BEAMADAPTER_CUDA_API RodStraightSection<CudaRigid3fTypes>; |
98 | 56 |
|
99 | 57 | #ifdef SOFA_GPU_CUDA_DOUBLE |
| 58 | + template class SOFA_BEAMADAPTER_CUDA_API BeamInterpolation<CudaRigid3dTypes>; |
| 59 | + template class SOFA_BEAMADAPTER_CUDA_API WireBeamInterpolation<CudaRigid3dTypes>; |
| 60 | + template class SOFA_BEAMADAPTER_CUDA_API WireRestShape<CudaRigid3dTypes>; |
| 61 | + template class SOFA_BEAMADAPTER_CUDA_API InterventionalRadiologyController<CudaRigid3dTypes>; |
| 62 | + template class SOFA_BEAMADAPTER_CUDA_API AdaptiveBeamMapping<CudaRigid3dTypes, defaulttype::Vec3Types>; |
| 63 | + template class SOFA_BEAMADAPTER_CUDA_API MultiAdaptiveBeamMapping<CudaRigid3dTypes, defaulttype::Vec3Types>; |
100 | 64 | template class SOFA_BEAMADAPTER_CUDA_API RodMeshSection<CudaRigid3dTypes>; |
101 | 65 | template class SOFA_BEAMADAPTER_CUDA_API RodSpireSection<CudaRigid3dTypes>; |
102 | 66 | template class SOFA_BEAMADAPTER_CUDA_API RodStraightSection<CudaRigid3dTypes>; |
103 | 67 | #endif |
104 | | -} // namespace sofa::beamadapter |
105 | 68 |
|
| 69 | +using namespace sofa::gpu::cuda; |
106 | 70 |
|
107 | | -namespace sofa::gpu::cuda |
| 71 | +void registerBeamAdapterCUDAComponents(sofa::core::ObjectFactory* factory) |
108 | 72 | { |
109 | | - |
110 | 73 | #ifdef SOFA_GPU_CUDA_DOUBLE |
111 | | -int CudaBeamInterpolationClass = core::RegisterObject("Adaptive Beam Interpolation - Supports GPU-side computations using CUDA") |
112 | | - // .add< sofa::component::fem::BeamInterpolation<CudaRigid3fTypes> >() |
113 | | - .add< sofa::component::fem::BeamInterpolation<CudaRigid3dTypes> >() |
114 | | - ; |
| 74 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Adaptive Beam Interpolation - Supports GPU-side computations using CUDA") |
| 75 | + // .add< BeamInterpolation<CudaRigid3fTypes> >() |
| 76 | + .add< BeamInterpolation<CudaRigid3dTypes> >()); |
115 | 77 | #endif |
116 | 78 |
|
117 | 79 | #ifdef SOFA_GPU_CUDA_DOUBLE |
118 | | -int CudaWireBeamInterpolationClass = core::RegisterObject("Adaptive Wire Beam Interpolation - Supports GPU-side computations using CUDA") |
119 | | - // .add< sofa::component::fem::WireBeamInterpolation<CudaRigid3fTypes> >() |
120 | | - .add< sofa::component::fem::WireBeamInterpolation<CudaRigid3dTypes> >() |
121 | | - ; |
| 80 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Adaptive Wire Beam Interpolation - Supports GPU-side computations using CUDA") |
| 81 | + // .add< WireBeamInterpolation<CudaRigid3fTypes> >() |
| 82 | + .add< WireBeamInterpolation<CudaRigid3dTypes> >()); |
122 | 83 | #endif |
123 | 84 |
|
124 | | -int CudaWireRestShapenClass = core::RegisterObject("Wire Shape - Supports GPU-side computations using CUDA") |
125 | | - .add< sofa::component::engine::WireRestShape<CudaRigid3fTypes> >() |
| 85 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Wire Shape - Supports GPU-side computations using CUDA") |
| 86 | + .add< WireRestShape<CudaRigid3fTypes> >() |
126 | 87 | #ifdef SOFA_GPU_CUDA_DOUBLE |
127 | | - .add< sofa::component::engine::WireRestShape<CudaRigid3dTypes> >() |
| 88 | + .add< WireRestShape<CudaRigid3dTypes> >() |
128 | 89 | #endif |
129 | | - ; |
| 90 | + ); |
130 | 91 |
|
131 | | -int CudaAdaptiveBeamForceFieldAndMassClass = core::RegisterObject("Adaptive Beam finite elements - Supports GPU-side computations using CUDA") |
132 | | - .add< sofa::component::forcefield::AdaptiveBeamForceFieldAndMass<CudaRigid3fTypes> >() |
| 92 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Adaptive Beam finite elements - Supports GPU-side computations using CUDA") |
| 93 | + .add< AdaptiveBeamForceFieldAndMass<CudaRigid3fTypes> >() |
133 | 94 | #ifdef SOFA_GPU_CUDA_DOUBLE |
134 | | - .add< sofa::component::forcefield::AdaptiveBeamForceFieldAndMass<CudaRigid3dTypes> >() |
| 95 | + .add< AdaptiveBeamForceFieldAndMass<CudaRigid3dTypes> >() |
135 | 96 | #endif |
136 | | - ; |
| 97 | + ); |
137 | 98 |
|
138 | | -int CudaInterventionalRadiologyControllerClass = core::RegisterObject("Provides a Mouse & Keyboard user control on an EdgeSet Topology - Supports GPU-side computations using CUDA") |
139 | | - .add< sofa::component::controller::InterventionalRadiologyController<CudaRigid3fTypes> >() |
| 99 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Provides a Mouse & Keyboard user control on an EdgeSet Topology - Supports GPU-side computations using CUDA") |
| 100 | + .add< InterventionalRadiologyController<CudaRigid3fTypes> >() |
140 | 101 | #ifdef SOFA_GPU_CUDA_DOUBLE |
141 | | - .add< sofa::component::controller::InterventionalRadiologyController<CudaRigid3dTypes> >() |
| 102 | + .add< InterventionalRadiologyController<CudaRigid3dTypes> >() |
142 | 103 | #endif |
143 | | - ; |
| 104 | + ); |
144 | 105 |
|
145 | | -int CudaAdaptiveBeamMappingClass = core::RegisterObject("Set the positions and velocities of points attached to a beam using linear interpolation between DOFs - Supports GPU-side computations using CUDA") |
146 | | - .add< sofa::component::mapping::AdaptiveBeamMapping<CudaRigid3fTypes, defaulttype::Vec3Types> >() |
| 106 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Provides a Mouse & Keyboard user control on an EdgeSet Topology - Supports GPU-side computations using CUDA") |
| 107 | + .add< InterventionalRadiologyController<CudaRigid3fTypes> >() |
147 | 108 | #ifdef SOFA_GPU_CUDA_DOUBLE |
148 | | - .add< sofa::component::mapping::AdaptiveBeamMapping<CudaRigid3dTypes, defaulttype::Vec3Types> >() |
| 109 | + .add< InterventionalRadiologyController<CudaRigid3dTypes> >() |
149 | 110 | #endif |
150 | | - ; |
| 111 | + ); |
151 | 112 |
|
152 | | -int CudaMultiAdaptiveBeamMappingClass = core::RegisterObject("Set the positions and velocities of points attached to a beam using linear interpolation between DOFs - Supports GPU-side computations using CUDA") |
153 | | - .add< sofa::component::mapping::MultiAdaptiveBeamMapping<CudaRigid3fTypes, defaulttype::Vec3Types> >() |
| 113 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Set the positions and velocities of points attached to a beam using linear interpolation between DOFs - Supports GPU-side computations using CUDA") |
| 114 | + .add< AdaptiveBeamMapping<CudaRigid3fTypes, defaulttype::Vec3Types> >() |
154 | 115 | #ifdef SOFA_GPU_CUDA_DOUBLE |
155 | | - .add< sofa::component::mapping::MultiAdaptiveBeamMapping<CudaRigid3dTypes, defaulttype::Vec3Types> >() |
| 116 | + .add< AdaptiveBeamMapping<CudaRigid3dTypes, defaulttype::Vec3Types> >() |
156 | 117 | #endif |
157 | | - ; |
| 118 | + ); |
158 | 119 |
|
159 | | -const int CudaRodMeshSectionClass = core::RegisterObject("Class defining a Rod Section using a MeshLoader and material parameters using CUDA.") |
160 | | - .add< sofa::beamadapter::RodMeshSection<CudaRigid3fTypes> >() |
| 120 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Set the positions and velocities of points attached to a beam using linear interpolation between DOFs - Supports GPU-side computations using CUDA") |
| 121 | + .add< MultiAdaptiveBeamMapping<CudaRigid3fTypes, defaulttype::Vec3Types> >() |
161 | 122 | #ifdef SOFA_GPU_CUDA_DOUBLE |
162 | | - .add< sofa::beamadapter::RodMeshSection<CudaRigid3dTypes> >() |
| 123 | + .add< MultiAdaptiveBeamMapping<CudaRigid3dTypes, defaulttype::Vec3Types> >() |
163 | 124 | #endif |
164 | | - ; |
| 125 | + ); |
165 | 126 |
|
166 | | -const int CudaRodSpireSectionClass = core::RegisterObject("Class defining a rod spire section, defining material and geometry parameters using CUDA.") |
167 | | - .add< sofa::beamadapter::RodSpireSection<CudaRigid3fTypes> >() |
| 127 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Class defining a Rod Section using a MeshLoader and material parameters using CUDA.") |
| 128 | + .add< RodMeshSection<CudaRigid3fTypes> >() |
168 | 129 | #ifdef SOFA_GPU_CUDA_DOUBLE |
169 | | - .add< sofa::beamadapter::RodSpireSection<CudaRigid3dTypes> >() |
| 130 | + .add< RodMeshSection<CudaRigid3dTypes> >() |
170 | 131 | #endif |
171 | | -; |
| 132 | + ); |
172 | 133 |
|
173 | | -const int CudaRodStraightSectionClass = core::RegisterObject("Class defining a rod straight section Material, defining material and geometry parameters using CUDA.") |
174 | | - .add< sofa::beamadapter::RodStraightSection<CudaRigid3fTypes> >() |
| 134 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Class defining a rod spire section, defining material and geometry parameters using CUDA.") |
| 135 | + .add< RodSpireSection<CudaRigid3fTypes> >() |
175 | 136 | #ifdef SOFA_GPU_CUDA_DOUBLE |
176 | | - .add< sofa::beamadapter::RodStraightSection<CudaRigid3dTypes> >() |
| 137 | + .add< RodSpireSection<CudaRigid3dTypes> >() |
177 | 138 | #endif |
178 | | -; |
| 139 | + ); |
179 | 140 |
|
| 141 | + factory->registerObjects(sofa::core::ObjectRegistrationData("Class defining a rod straight section Material, defining material and geometry parameters using CUDA.") |
| 142 | + .add< RodStraightSection<CudaRigid3fTypes> >() |
| 143 | +#ifdef SOFA_GPU_CUDA_DOUBLE |
| 144 | + .add< RodStraightSection<CudaRigid3dTypes> >() |
| 145 | +#endif |
| 146 | + ); |
| 147 | +} |
180 | 148 |
|
181 | | - |
182 | | - |
183 | | -} // namespace sofa::gpu::cuda |
184 | | - |
| 149 | +} // namespace beamadapter |
0 commit comments