Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Sofa/Component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ sofa_add_subdirectory_modules(SOFACOMPONENT_TARGETS
LinearSolver
Mass
ODESolver
Diffusion
Mapping
StateContainer
SolidMechanics
Diffusion
Constraint
AnimationLoop
MechanicalLoad
Expand Down
7 changes: 5 additions & 2 deletions Sofa/Component/Diffusion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ set(SOFACOMPONENTDIFFUSION_SOURCE_DIR "src/sofa/component/diffusion")
set(HEADER_FILES
${SOFACOMPONENTDIFFUSION_SOURCE_DIR}/config.h.in
${SOFACOMPONENTDIFFUSION_SOURCE_DIR}/init.h
${SOFACOMPONENTDIFFUSION_SOURCE_DIR}/DiffusionFEMForceField.h
${SOFACOMPONENTDIFFUSION_SOURCE_DIR}/DiffusionFEMForceField.inl
${SOFACOMPONENTDIFFUSION_SOURCE_DIR}/TetrahedronDiffusionFEMForceField.h
${SOFACOMPONENTDIFFUSION_SOURCE_DIR}/TetrahedronDiffusionFEMForceField.inl
)

set(SOURCE_FILES
${SOFACOMPONENTDIFFUSION_SOURCE_DIR}/init.cpp
${SOFACOMPONENTDIFFUSION_SOURCE_DIR}/DiffusionFEMForceField.cpp
${SOFACOMPONENTDIFFUSION_SOURCE_DIR}/TetrahedronDiffusionFEMForceField.cpp
)

sofa_find_package(Sofa.Simulation.Core REQUIRED)
sofa_find_package(Sofa.Component.SolidMechanics.FEM.Elastic REQUIRED)

add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core)
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Component.SolidMechanics.FEM.Elastic)

sofa_create_package_with_targets(
PACKAGE_NAME ${PROJECT_NAME}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/******************************************************************************
* 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 *
******************************************************************************/
#define SOFA_COMPONENT_DIFFUSION_DIFFUSION_FEM_FORCE_FIELD_CPP

#include <sofa/component/diffusion/DiffusionFEMForceField.inl>

#include <sofa/core/ObjectFactory.h>
#include <sofa/fem/FiniteElement[all].h>

namespace sofa::component::diffusion
{

using sofa::defaulttype::Vec1Types;
using sofa::defaulttype::Vec2Types;
using sofa::defaulttype::Vec3Types;
using sofa::geometry::Edge;
using sofa::geometry::Triangle;
using sofa::geometry::Quad;
using sofa::geometry::Tetrahedron;
using sofa::geometry::Hexahedron;
using sofa::geometry::Prism;
using sofa::geometry::Pyramid;

void registerDiffusionFEMForceField(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Generic isotropic FEM diffusion force field")
.add< DiffusionFEMForceField<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec1Types, Edge> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec2Types, sofa::defaulttype::Vec1Types, Edge> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec1Types, Edge> >()

.add< DiffusionFEMForceField<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec2Types, Edge> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec2Types, sofa::defaulttype::Vec2Types, Edge> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec2Types, Edge> >()

.add< DiffusionFEMForceField<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec3Types, Edge> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec2Types, sofa::defaulttype::Vec3Types, Edge> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec3Types, Edge> >()

.add< DiffusionFEMForceField<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec2Types, Triangle> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec2Types, sofa::defaulttype::Vec2Types, Triangle> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec2Types, Triangle> >()

.add< DiffusionFEMForceField<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec3Types, Triangle> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec2Types, sofa::defaulttype::Vec3Types, Triangle> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec3Types, Triangle> >()

.add< DiffusionFEMForceField<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec2Types, Quad> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec2Types, sofa::defaulttype::Vec2Types, Quad> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec2Types, Quad> >()

.add< DiffusionFEMForceField<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec3Types, Quad> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec2Types, sofa::defaulttype::Vec3Types, Quad> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec3Types, Quad> >()

.add< DiffusionFEMForceField<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec3Types, Tetrahedron> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec2Types, sofa::defaulttype::Vec3Types, Tetrahedron> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec3Types, Tetrahedron> >()

.add< DiffusionFEMForceField<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec3Types, Hexahedron> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec2Types, sofa::defaulttype::Vec3Types, Hexahedron> >()
.add< DiffusionFEMForceField<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec3Types, Hexahedron> >()
);
}

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec1Types, Edge>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec1Types, Edge>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec1Types, Edge>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec2Types, Edge>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec2Types, Edge>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec2Types, Edge>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec3Types, Edge>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec3Types, Edge>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec3Types, Edge>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec2Types, Triangle>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec2Types, Triangle>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec2Types, Triangle>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec3Types, Triangle>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec3Types, Triangle>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec3Types, Triangle>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec2Types, Quad>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec2Types, Quad>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec2Types, Quad>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec3Types, Quad>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec3Types, Quad>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec3Types, Quad>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec3Types, Tetrahedron>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec3Types, Tetrahedron>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec3Types, Tetrahedron>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec3Types, Hexahedron>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec3Types, Hexahedron>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec3Types, Hexahedron>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec3Types, Prism>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec3Types, Prism>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec3Types, Prism>;

template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec1Types, Vec3Types, Pyramid>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec2Types, Vec3Types, Pyramid>;
template class SOFA_COMPONENT_DIFFUSION_API DiffusionFEMForceField<Vec3Types, Vec3Types, Pyramid>;

} // namespace sofa::component::diffusion
Loading
Loading