Skip to content

Commit

Permalink
Clean to hopefully fix Win compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
hugtalbot committed Dec 18, 2021
1 parent 6e966db commit 7063102
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
14 changes: 6 additions & 8 deletions src/SofaMJEDFEM/MJEDTetrahedralForceField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,23 @@
#define SOFA_COMPONENT_FORCEFIELD_MJEDTETRAHEDRALFORCEFIELD_CPP

#include <SofaMJEDFEM/MJEDTetrahedralForceField.inl>

#include <SofaMJEDFEM/config.h>
#include <SofaBaseMechanics/MechanicalObject.h>

#include <sofa/core/ObjectFactory.h>
#include <sofa/defaulttype/VecTypes.h>

#include <sofa/core/behavior/ForceField.inl>
#include <SofaBaseTopology/TopologyData.inl>

namespace sofa::component::forcefield
{

using namespace sofa::defaulttype;

// Register in the Factory
int MJEDTetrahedralForceFieldClass = core::RegisterObject("Generic Tetrahedral finite elements")
.add< MJEDTetrahedralForceField<sofa::defaulttype::Vec3dTypes> >()
;
int MJEDTetrahedralForceFieldClass = core::RegisterObject("Tetrahedral FEM model of visco-hyperelastic material using MJED")
.add< MJEDTetrahedralForceField<Vec3Types> >()
;

template class SOFA_MJED_FEM_API MJEDTetrahedralForceField<Vec3dTypes>;
template class SOFA_MJED_FEM_API MJEDTetrahedralForceField<Vec3Types>;


} // namespace sofa::component::forcefield
7 changes: 3 additions & 4 deletions src/SofaMJEDFEM/MJEDTetrahedralForceField.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ using namespace sofa::component::topology;
//******************* It is dependant on the description of material following the model of sofa::component::fem::HyperelasticMaterial.h ************************
//***************************** more explication on MJED explication.pdf****************************

/** Compute Finite Element forces based on tetrahedral elements.
*/
/** Compute Finite Element forces based on tetrahedral elements.*/
template<class DataTypes>
class MJEDTetrahedralForceField : public core::behavior::ForceField<DataTypes>
{
Expand Down Expand Up @@ -267,10 +266,10 @@ protected :

};

using sofa::defaulttype::Vec3dTypes;
using sofa::defaulttype::Vec3Types;

#if !defined(SOFA_COMPONENT_FORCEFIELD_MJEDTETRAHEDRALFORCEFIELD_CPP)
extern template class SOFA_MJED_FEM_API MJEDTetrahedralForceField<Vec3dTypes>;
extern template class SOFA_MJED_FEM_API MJEDTetrahedralForceField<Vec3Types>;
#endif //!defined(SOFA_COMPONENT_FORCEFIELD_MJEDTETRAHEDRALFORCEFIELD_CPP)

} // namespace sofa::component::forcefield
3 changes: 2 additions & 1 deletion src/SofaMJEDFEM/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
#pragma once

#include <sofa/config.h>
#include <sofa/config/sharedlibrary_defines.h>

#define SOFAMJEDFEM_VERSION @PROJECT_VERSION@

#ifdef SOFA_BUILD_MJED_FEM
#ifdef SOFA_BUILD_SOFAMJEDFEM
# define SOFA_TARGET @PROJECT_NAME@
# define SOFA_MJED_FEM_API SOFA_EXPORT_DYNAMIC_LIBRARY
#else
Expand Down
4 changes: 4 additions & 0 deletions src/SofaMJEDFEM/initSofaMJEDFEM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <sofa/core/ObjectFactory.h>
using sofa::core::ObjectFactory;

namespace sofa::component
{

extern "C" {
SOFA_MJED_FEM_API void initExternalModule();
Expand Down Expand Up @@ -68,3 +70,5 @@ const char* getModuleComponentList()
static std::string classes = ObjectFactory::getInstance()->listClassesFromTarget(sofa_tostring(SOFA_TARGET));
return classes.c_str();
}

} // namespace sofa::component

0 comments on commit 7063102

Please sign in to comment.