|
| 1 | +/****************************************************************************** |
| 2 | +* SOFA, Simulation Open-Framework Architecture * |
| 3 | +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * |
| 4 | +* * |
| 5 | +* This program is free software; you can redistribute it and/or modify it * |
| 6 | +* under the terms of the GNU Lesser General Public License as published by * |
| 7 | +* the Free Software Foundation; either version 2.1 of the License, or (at * |
| 8 | +* your option) any later version. * |
| 9 | +* * |
| 10 | +* This program is distributed in the hope that it will be useful, but WITHOUT * |
| 11 | +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * |
| 12 | +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * |
| 13 | +* for more details. * |
| 14 | +* * |
| 15 | +* You should have received a copy of the GNU Lesser General Public License * |
| 16 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. * |
| 17 | +******************************************************************************* |
| 18 | +* Authors: The SOFA Team and external contributors (see Authors.txt) * |
| 19 | +* * |
| 20 | +* Contact information: contact@sofa-framework.org * |
| 21 | +******************************************************************************/ |
| 22 | +#include <SofaCUDA/component/config.h> |
| 23 | + |
| 24 | +#include <sofa/gpu/cuda/CudaTypes.h> |
| 25 | +#include <SofaCUDA/component/solidmechanics/fem/elastic/CudaElementCorotationalFEMForceField.inl> |
| 26 | +#include <sofa/core/ObjectFactory.h> |
| 27 | + |
| 28 | +namespace sofa::component::solidmechanics::fem::elastic |
| 29 | +{ |
| 30 | + |
| 31 | +using namespace sofa::gpu::cuda; |
| 32 | + |
| 33 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Edge>; |
| 34 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Triangle>; |
| 35 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Quad>; |
| 36 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Tetrahedron>; |
| 37 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Hexahedron>; |
| 38 | + |
| 39 | +#ifdef SOFA_GPU_CUDA_DOUBLE |
| 40 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Edge>; |
| 41 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Triangle>; |
| 42 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Quad>; |
| 43 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Tetrahedron>; |
| 44 | +template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Hexahedron>; |
| 45 | +#endif |
| 46 | + |
| 47 | +} // namespace sofa::component::solidmechanics::fem::elastic |
| 48 | + |
| 49 | +namespace sofa::gpu::cuda |
| 50 | +{ |
| 51 | + |
| 52 | +void registerElementCorotationalFEMForceField(sofa::core::ObjectFactory* factory) |
| 53 | +{ |
| 54 | + using namespace sofa::component::solidmechanics::fem::elastic; |
| 55 | + |
| 56 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 57 | + "Supports GPU-side computations using CUDA for EdgeCorotationalFEMForceField") |
| 58 | + .add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Edge> >() |
| 59 | + ); |
| 60 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 61 | + "Supports GPU-side computations using CUDA for TriangleCorotationalFEMForceField") |
| 62 | + .add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Triangle> >() |
| 63 | + ); |
| 64 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 65 | + "Supports GPU-side computations using CUDA for QuadCorotationalFEMForceField") |
| 66 | + .add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Quad> >() |
| 67 | + ); |
| 68 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 69 | + "Supports GPU-side computations using CUDA for TetrahedronCorotationalFEMForceField") |
| 70 | + .add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Tetrahedron> >() |
| 71 | + ); |
| 72 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 73 | + "Supports GPU-side computations using CUDA for HexahedronCorotationalFEMForceField") |
| 74 | + .add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Hexahedron> >() |
| 75 | + ); |
| 76 | + |
| 77 | +#ifdef SOFA_GPU_CUDA_DOUBLE |
| 78 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 79 | + "Supports GPU-side computations using CUDA (double) for EdgeCorotationalFEMForceField") |
| 80 | + .add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Edge> >() |
| 81 | + ); |
| 82 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 83 | + "Supports GPU-side computations using CUDA (double) for TriangleCorotationalFEMForceField") |
| 84 | + .add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Triangle> >() |
| 85 | + ); |
| 86 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 87 | + "Supports GPU-side computations using CUDA (double) for QuadCorotationalFEMForceField") |
| 88 | + .add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Quad> >() |
| 89 | + ); |
| 90 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 91 | + "Supports GPU-side computations using CUDA (double) for TetrahedronCorotationalFEMForceField") |
| 92 | + .add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Tetrahedron> >() |
| 93 | + ); |
| 94 | + factory->registerObjects(sofa::core::ObjectRegistrationData( |
| 95 | + "Supports GPU-side computations using CUDA (double) for HexahedronCorotationalFEMForceField") |
| 96 | + .add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Hexahedron> >() |
| 97 | + ); |
| 98 | +#endif |
| 99 | +} |
| 100 | + |
| 101 | +} // namespace sofa::gpu::cuda |
0 commit comments