Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions applications/plugins/SofaCUDA/Component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ set(HEADER_FILES


### solidmechanics
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaElementFEMKernelUtils.cuh
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaElementCorotationalFEMForceField.h
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaElementCorotationalFEMForceField.inl
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaElementLinearSmallStrainFEMForceField.h
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaElementLinearSmallStrainFEMForceField.inl
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaHexahedronFEMForceField.h
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaHexahedronFEMForceField.inl
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/hyperelastic/CudaStandardTetrahedralFEMForceField.h
Expand Down Expand Up @@ -111,6 +116,8 @@ set(SOURCE_FILES
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/mass/CudaUniformMass.cpp

### Solidmechanics
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaElementCorotationalFEMForceField.cpp
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaElementLinearSmallStrainFEMForceField.cpp
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaHexahedronFEMForceField.cpp
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/hyperelastic/CudaStandardTetrahedralFEMForceField.cpp
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/tensormass/CudaTetrahedralTensorMassForceField.cpp
Expand Down Expand Up @@ -181,6 +188,8 @@ set(CUDA_SOURCES
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/mass/CudaUniformMass.cu

### solidmechanics
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaElementCorotationalFEMForceField.cu
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaElementLinearSmallStrainFEMForceField.cu
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/elastic/CudaHexahedronFEMForceField.cu
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/fem/hyperelastic/CudaStandardTetrahedralFEMForceField.cu
${SOFACUDA_COMPONENT_SOURCE_DIR}/SofaCUDA/component/solidmechanics/tensormass/CudaTetrahedralTensorMassForceField.cu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ extern void registerPlaneForceField(sofa::core::ObjectFactory* factory);
extern void registerSphereForceField(sofa::core::ObjectFactory* factory);

// component::solidmechanics::fem::elastic
extern void registerElementCorotationalFEMForceField(sofa::core::ObjectFactory* factory);
extern void registerElementLinearSmallStrainFEMForceField(sofa::core::ObjectFactory* factory);
extern void registerHexahedronFEMForceField(sofa::core::ObjectFactory* factory);
extern void registerTetrahedronFEMForceField(sofa::core::ObjectFactory* factory);
extern void registerTriangularFEMForceFieldOptim(sofa::core::ObjectFactory* factory);
Expand Down Expand Up @@ -224,6 +226,8 @@ void registerObjects(sofa::core::ObjectFactory* factory)
registerLinearForceField(factory);
registerPlaneForceField(factory);
registerSphereForceField(factory);
registerElementCorotationalFEMForceField(factory);
registerElementLinearSmallStrainFEMForceField(factory);
registerHexahedronFEMForceField(factory);
registerTetrahedronFEMForceField(factory);
registerTriangularFEMForceFieldOptim(factory);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture *
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#include <SofaCUDA/component/config.h>

#include <sofa/gpu/cuda/CudaTypes.h>
#include <SofaCUDA/component/solidmechanics/fem/elastic/CudaElementCorotationalFEMForceField.inl>
#include <sofa/core/ObjectFactory.h>

namespace sofa::component::solidmechanics::fem::elastic
{

using namespace sofa::gpu::cuda;

template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Edge>;
template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Triangle>;
template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Quad>;
template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Tetrahedron>;
template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Hexahedron>;

#ifdef SOFA_GPU_CUDA_DOUBLE
template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Edge>;
template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Triangle>;
template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Quad>;
template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Tetrahedron>;
template class SOFACUDA_COMPONENT_API CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Hexahedron>;
#endif

} // namespace sofa::component::solidmechanics::fem::elastic

namespace sofa::gpu::cuda
{

void registerElementCorotationalFEMForceField(sofa::core::ObjectFactory* factory)
{
using namespace sofa::component::solidmechanics::fem::elastic;

factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA for EdgeCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Edge> >()
);
factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA for TriangleCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Triangle> >()
);
factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA for QuadCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Quad> >()
);
factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA for TetrahedronCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Tetrahedron> >()
);
factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA for HexahedronCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3fTypes, sofa::geometry::Hexahedron> >()
);

#ifdef SOFA_GPU_CUDA_DOUBLE
factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA (double) for EdgeCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Edge> >()
);
factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA (double) for TriangleCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Triangle> >()
);
factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA (double) for QuadCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Quad> >()
);
factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA (double) for TetrahedronCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Tetrahedron> >()
);
factory->registerObjects(sofa::core::ObjectRegistrationData(
"Supports GPU-side computations using CUDA (double) for HexahedronCorotationalFEMForceField")
.add< CudaElementCorotationalFEMForceField<CudaVec3dTypes, sofa::geometry::Hexahedron> >()
);
#endif
}

} // namespace sofa::gpu::cuda
Loading
Loading