Repository: SofaDefrost/ModelOrderReduction (language: python)

Issue:
Follow SOFA last changes
Mostly due to SOFA-NG


Discussion / hints:

Fix patch:
diff --git a/src/ModelOrderReduction/component/contact/MORFrictionContact.cpp b/src/ModelOrderReduction/component/contact/MORFrictionContact.cpp
index ed481881..e2283551 100644
--- a/src/ModelOrderReduction/component/contact/MORFrictionContact.cpp
+++ b/src/ModelOrderReduction/component/contact/MORFrictionContact.cpp
@@ -19,17 +19,18 @@
 *                                                                             *
 * Contact information: contact@sofa-framework.org                             *
 ******************************************************************************/
-#include "MORFrictionContact.inl"
+#include <ModelOrderReduction/component/contact/MORFrictionContact.inl>
 #include <sofa/component/collision/response/mapper/RigidContactMapper.inl>
 #include <sofa/component/collision/response/mapper/BarycentricContactMapper.inl>
 
 
-namespace sofa::component::collision::geometry
+namespace sofa::component::collision::response::contact
 {
 
 using sofa::core::collision::Contact;
 using sofa::defaulttype::Vec3Types;
 using sofa::defaulttype::Rigid3Types;
+using namespace sofa::component::collision::geometry;
 
 Creator<Contact::Factory, MORFrictionContact<PointCollisionModel<Vec3Types>, PointCollisionModel<Vec3Types>> > PointPointMORFrictionContactClass("MORFrictionContact",true);
 Creator<Contact::Factory, MORFrictionContact<LineCollisionModel<Vec3Types>, SphereCollisionModel<Vec3Types>> > LineSphereMORFrictionContactClass("MORFrictionContact",true);
diff --git a/src/ModelOrderReduction/component/contact/MORFrictionContact.h b/src/ModelOrderReduction/component/contact/MORFrictionContact.h
index d75b1a46..adcd3e49 100644
--- a/src/ModelOrderReduction/component/contact/MORFrictionContact.h
+++ b/src/ModelOrderReduction/component/contact/MORFrictionContact.h
@@ -26,27 +26,19 @@
 #include <sofa/component/collision/response/contact/FrictionContact.h>
 #include <sofa/core/collision/Contact.h>
 #include <sofa/core/collision/Intersection.h>
-#include <SofaBaseMechanics/BarycentricMapping.h>
-#include <SofaConstraint/UnilateralInteractionConstraint.h>
-#include "MORUnilateralInteractionConstraint.h"
+#include <sofa/component/mapping/linear/BarycentricMapping.h>
+#include <sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.h>
+#include <ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.h>
 #include <sofa/helper/Factory.h>
-#include <SofaBaseCollision/BaseContactMapper.h>
+#include <sofa/component/collision/response/mapper/BaseContactMapper.h>
 #include <sofa/core/behavior/MechanicalState.h>
 #include <sofa/core/BaseMapping.h>
 
-#include <SofaConstraint/ContactIdentifier.h>
+#include <sofa/component/collision/response/contact/ContactIdentifier.h>
 
-namespace sofa
+namespace sofa::component::collision::response::contact
 {
 
-namespace component
-{
-
-namespace collision
-{
-
-
-
 template <class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes = sofa::defaulttype::Vec3Types >
 class MORFrictionContact : public FrictionContact<TCollisionModel1, TCollisionModel2, ResponseDataTypes>
 {
@@ -108,11 +100,6 @@ class MORFrictionContact : public FrictionContact<TCollisionModel1, TCollisionMo
 
 //    void removeResponse() override;
 };
-
-} // collision
-
-} // component
-
-} // sofa
+} // namespace sofa::component::collision::response::contact
 
 #endif // SOFA_COMPONENT_COLLISION_MORFRICTIONCONTACT_H
diff --git a/src/ModelOrderReduction/component/contact/MORFrictionContact.inl b/src/ModelOrderReduction/component/contact/MORFrictionContact.inl
index b6231b39..71387269 100644
--- a/src/ModelOrderReduction/component/contact/MORFrictionContact.inl
+++ b/src/ModelOrderReduction/component/contact/MORFrictionContact.inl
@@ -22,23 +22,17 @@
 #ifndef MOR_MORFRICTIONCONTACT_INL
 #define MOR_MORFRICTIONCONTACT_INL
 
-#include <SofaConstraint/FrictionContact.inl>
-#include "MORFrictionContact.h"
+#include <sofa/component/collision/response/contact/FrictionContact.inl>
+#include <ModelOrderReduction/component/contact/MORFrictionContact.h>
 #include <sofa/core/visual/VisualParams.h>
-#include <SofaBaseCollision/DefaultContactManager.h>
-#include <SofaMeshCollision/BarycentricContactMapper.h>
-#include <SofaMeshCollision/IdentityContactMapper.h>
-#include <SofaMeshCollision/RigidContactMapper.inl>
+#include <sofa/component/collision/response/contact/DefaultContactManager.h>
+#include <sofa/component/collision/response/mapper/BarycentricContactMapper.h>
+#include <sofa/component/collision/response/mapper/IdentityContactMapper.h>
+#include <sofa/component/collision/response/mapper/RigidContactMapper.inl>
 #include <sofa/simulation/Node.h>
 #include <iostream>
 
-namespace sofa
-{
-
-namespace component
-{
-
-namespace collision
+namespace sofa::component::collision::response::contact
 {
 
 template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes  >
@@ -80,7 +74,7 @@ void MORFrictionContact<TCollisionModel1,TCollisionModel2,ResponseDataTypes>::cl
             parent->removeObject(m_constraint);}
         msg_warning() << "plap!";
         parent = NULL;
-        constraintset::MORUnilateralInteractionConstraint<sofa::defaulttype::Vec3Types>::SPtr tmp( dynamic_cast<constraintset::MORUnilateralInteractionConstraint<sofa::defaulttype::Vec3Types>*>(m_constraint.get()) );
+        sofa::component::constraint::lagrangian::model::MORUnilateralInteractionConstraint<sofa::defaulttype::Vec3Types>::SPtr tmp( dynamic_cast<sofa::component::constraint::lagrangian::model::MORUnilateralInteractionConstraint<sofa::defaulttype::Vec3Types>*>(m_constraint.get()) );
         tmp.reset();
 //        m_MORconstraint.reset();
         msg_warning() << "plup!";
@@ -189,8 +183,7 @@ void MORFrictionContact<TCollisionModel1,TCollisionModel2,ResponseDataTypes>::ac
         msg_warning() << "mu is: " << mu.getValue();
 
         msg_warning() << "********************************************************************************************************************";
-//        m_constraint = sofa::core::objectmodel::New<constraintset::MORUnilateralInteractionConstraint<defaulttype::Vec3Types> >(mmodel1, mmodel2);
-        m_constraint = sofa::core::objectmodel::New<constraintset::MORUnilateralInteractionConstraint<defaulttype::Vec3Types> >(mmodel1, mmodel2, d_lambdaModesPath.getValue(), d_lambdaModesCoeffsPath.getValue());
+        m_constraint = sofa::core::objectmodel::New<sofa::component::constraint::lagrangian::model::MORUnilateralInteractionConstraint<defaulttype::Vec3Types> >(mmodel1, mmodel2, d_lambdaModesPath.getValue(), d_lambdaModesCoeffsPath.getValue());
         m_constraint->setName( this->getName() );
         this->setInteractionTags(mmodel1, mmodel2);
         m_constraint->setCustomTolerance( tol.getValue() );
@@ -247,10 +240,6 @@ void MORFrictionContact<TCollisionModel1,TCollisionModel2,ResponseDataTypes>::ac
 }
 
 
-} // namespace collision
-
-} // namespace component
-
-} // namespace sofa
+} // namespace sofa::component::collision::response::contact
 
 #endif
diff --git a/src/ModelOrderReduction/component/contact/MORFrictionContact[OBBCapsule].cpp b/src/ModelOrderReduction/component/contact/MORFrictionContact[OBBCapsule].cpp
index ae850c7c..5080f3fc 100644
--- a/src/ModelOrderReduction/component/contact/MORFrictionContact[OBBCapsule].cpp
+++ b/src/ModelOrderReduction/component/contact/MORFrictionContact[OBBCapsule].cpp
@@ -25,12 +25,13 @@
 #include <CollisionOBBCapsule/response/mapper/OBBContactMapper.h>
 #include <sofa/component/collision/response/mapper/BarycentricContactMapper.inl>
 
-namespace sofa::component::collision::geometry
+namespace sofa::component::collision::response::contact
 {
 
 using sofa::core::collision::Contact;
 using sofa::defaulttype::Vec3Types;
 using sofa::defaulttype::Rigid3Types;
+using namespace sofa::component::collision::geometry;
 
 Creator<Contact::Factory, MORFrictionContact<CapsuleCollisionModel<Vec3Types>, CapsuleCollisionModel<Vec3Types>> > CapsuleCapsuleMORFrictionContactClass("MORFrictionContact",true);
 Creator<Contact::Factory, MORFrictionContact<CapsuleCollisionModel<Vec3Types>, TriangleCollisionModel<Vec3Types>> > CapsuleTriangleMORFrictionContactClass("MORFrictionContact",true);
diff --git a/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.cpp b/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.cpp
index 7ebb1356..9d7b36f5 100644
--- a/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.cpp
+++ b/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.cpp
@@ -20,18 +20,12 @@
 * Contact information: contact@sofa-framework.org                             *
 ******************************************************************************/
 #define MOR_MORUNILATERALINTERACTIONCONSTRAINT_CPP
-#include "MORUnilateralInteractionConstraint.inl"
+#include <ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.inl>
 #include <sofa/defaulttype/VecTypes.h>
-#include <SofaBaseMechanics/MechanicalObject.h>
+#include <sofa/component/statecontainer/MechanicalObject.h>
 #include <sofa/core/ObjectFactory.h>
 
-namespace sofa
-{
-
-namespace component
-{
-
-namespace constraintset
+namespace sofa::component::constraint::lagrangian::model
 {
 
 using namespace sofa::defaulttype;
@@ -45,14 +39,5 @@ int MORUnilateralInteractionConstraintClass = core::RegisterObject("TODO-MORUnil
 
 
 template class SOFA_MODELORDERREDUCTION_API MORUnilateralInteractionConstraint<Vec3Types>;
-
-
-
-
-
-} // namespace constraintset
-
-} // namespace component
-
-} // namespace sofa
+} // namespace sofa::component::constraint::lagrangian::model
 
diff --git a/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.h b/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.h
index 5348e558..86ae15a1 100644
--- a/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.h
+++ b/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.h
@@ -28,16 +28,10 @@
 #include <iostream>
 #include <map>
 #include <deque>
-#include <SofaConstraint/UnilateralInteractionConstraint.h>
+#include <sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.h>
 #include <Eigen/Sparse>
 
-namespace sofa
-{
-
-namespace component
-{
-
-namespace constraintset
+namespace sofa::component::constraint::lagrangian::model
 {
 class MORUnilateralConstraintResolution : public UnilateralConstraintResolution
 {
@@ -161,11 +155,6 @@ class MORUnilateralInteractionConstraint : public UnilateralInteractionConstrain
 #if  !defined(MOR_MORUNILATERALINTERACTIONCONSTRAINT_CPP)
 extern template class SOFA_MODELORDERREDUCTION_API MORUnilateralInteractionConstraint<defaulttype::Vec3Types>;
 #endif
-
-} // namespace constraintset
-
-} // namespace component
-
-} // namespace sofa
+} // namespace sofa::component::constraint::lagrangian::model
 
 #endif // SOFA_COMPONENT_CONSTRAINTSET_UNILATERALINTERACTIONCONSTRAINT_H
diff --git a/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.inl b/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.inl
index b6cab793..299b54f3 100644
--- a/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.inl
+++ b/src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.inl
@@ -23,7 +23,7 @@
 #define MOR_MORUNILATERALINTERACTIONCONSTRAINT_INL
 
 #include "MORUnilateralInteractionConstraint.h"
-#include <SofaConstraint/UnilateralInteractionConstraint.inl>
+#include <sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.inl>
 #include <sofa/core/visual/VisualParams.h>
 #include <sofa/type/Vec.h>
 #include <sofa/type/RGBAColor.h>
@@ -31,13 +31,7 @@
 #include "../loader/MatrixLoader.h"
 #include "../loader/MatrixLoader.inl"
 
-namespace sofa
-{
-
-namespace component
-{
-
-namespace constraintset
+namespace sofa::component::constraint::lagrangian::model
 {
 using sofa::component::loader::MatrixLoader;
 template<class DataTypes>
@@ -252,7 +246,7 @@ void MORUnilateralInteractionConstraint<DataTypes>::getConstraintViolation(const
         break;
 
     default :
-        serr << "UnilateralInteractionConstraint doesn't implement " << cparams->getName() << " constraint violation\n";
+        msg_error() << this->getClassName() << " doesn't implement " << cparams->getName() << " constraint violation";
         break;
     }
 }
@@ -413,11 +407,6 @@ void MORUnilateralInteractionConstraint<DataTypes>::getConstraintResolution(cons
         }
     }
 }
-
-} // namespace constraintset
-
-} // namespace component
-
-} // namespace sofa
+} // namespace sofa::component::constraint::lagrangian::model
 
 #endif
diff --git a/src/ModelOrderReduction/component/contact/MORpointModel.cpp b/src/ModelOrderReduction/component/contact/MORpointModel.cpp
index f690547d..c634c5c5 100644
--- a/src/ModelOrderReduction/component/contact/MORpointModel.cpp
+++ b/src/ModelOrderReduction/component/contact/MORpointModel.cpp
@@ -20,18 +20,12 @@
 * Contact information: contact@sofa-framework.org                             *
 ******************************************************************************/
 #define MOR_POINTCOLLISIONMODEL_CPP
-#include "MORpointModel.inl"
-#include <SofaMeshCollision/PointModel.inl>
+#include <ModelOrderReduction/component/contact/MORpointModel.inl>
+#include <sofa/component/collision/geometry/PointModel.inl>
 
 #include <sofa/core/ObjectFactory.h>
 
-namespace sofa
-{
-
-namespace component
-{
-
-namespace collision
+namespace sofa::component::collision::geometry
 {
 
 using namespace sofa::defaulttype;
@@ -45,11 +39,5 @@ int MORPointCollisionModelClass = core::RegisterObject("Collision model which re
         ;
 
 template class SOFA_MODELORDERREDUCTION_API MORPointCollisionModel<defaulttype::Vec3Types>;
-
-
-} // namespace collision
-
-} // namespace component
-
-} // namespace sofa
+} // namespace sofa::component::collision::geometry
 
diff --git a/src/ModelOrderReduction/component/contact/MORpointModel.h b/src/ModelOrderReduction/component/contact/MORpointModel.h
index 38775e43..4ad5dc22 100644
--- a/src/ModelOrderReduction/component/contact/MORpointModel.h
+++ b/src/ModelOrderReduction/component/contact/MORpointModel.h
@@ -23,26 +23,20 @@
 #define MOR_POINTCOLLISIONMODEL_H
 #include <ModelOrderReduction/config.h>
 
-#include <SofaMeshCollision/PointModel.h>
-#include <SofaMeshCollision/PointModel.inl>
+#include <sofa/component/collision/geometry/PointModel.h>
+#include <sofa/component/collision/geometry/PointModel.inl>
 
 #include <sofa/core/CollisionModel.h>
-#include <SofaBaseMechanics/MechanicalObject.h>
+#include <sofa/component/statecontainer/MechanicalObject.h>
 #include <sofa/core/topology/BaseMeshTopology.h>
 #include <sofa/defaulttype/VecTypes.h>
-#include <SofaMeshCollision/fwd.h>
+#include <sofa/component/collision/geometry/fwd.h>
 
 #include <vector>
 #include <Eigen/Sparse>
 
 
-namespace sofa
-{
-
-namespace component
-{
-
-namespace collision
+namespace sofa::component::collision::geometry
 {
 
 
@@ -86,11 +80,6 @@ extern template class SOFA_MODELORDERREDUCTION_API MORPointCollisionModel<defaul
 #endif
 
 //bool Point::testLMD(const Vector3 &PQ, double &coneFactor, double &coneExtension);
-
-} // namespace collision
-
-} // namespace component
-
-} // namespace sofa
+} // namespace sofa::component::collision::geometry
 
 #endif
diff --git a/src/ModelOrderReduction/component/contact/MORpointModel.inl b/src/ModelOrderReduction/component/contact/MORpointModel.inl
index dfc872bf..a958c309 100644
--- a/src/ModelOrderReduction/component/contact/MORpointModel.inl
+++ b/src/ModelOrderReduction/component/contact/MORpointModel.inl
@@ -30,24 +30,19 @@
 #include <iostream>
 #include <algorithm>
 
-#include "MORpointModel.h"
+#include <ModelOrderReduction/component/contact/MORpointModel.h>
 #include <sofa/core/visual/VisualParams.h>
-#include <SofaBaseCollision/CubeModel.h>
+#include <sofa/component/collision/geometry/CubeModel.h>
 #include <sofa/core/ObjectFactory.h>
 #include <vector>
 
 #include <sofa/core/topology/BaseMeshTopology.h>
 
 #include <sofa/simulation/Simulation.h>
-#include "../loader/MatrixLoader.h"
-#include "../loader/MatrixLoader.inl"
-namespace sofa
-{
-
-namespace component
-{
+#include <ModelOrderReduction/component/loader/MatrixLoader.h>
+#include <ModelOrderReduction/component/loader/MatrixLoader.inl>
 
-namespace collision
+namespace sofa::component::collision::geometry
 {
 using sofa::component::loader::MatrixLoader;
 template<class DataTypes>
@@ -152,12 +147,6 @@ void MORPointCollisionModel<DataTypes>::draw(const core::visual::VisualParams* v
     if (this->getPrevious() != nullptr && vparams->displayFlags().getShowBoundingCollisionModels())
         this->getPrevious()->draw(vparams);
 }
-
-
-} // namespace collision
-
-} // namespace component
-
-} // namespace sofa
+} // namespace sofa::component::collision::geometry
 
 #endif
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedHelper.cpp b/src/ModelOrderReduction/component/forcefield/HyperReducedHelper.cpp
index 2e2bce7e..586f7cf0 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedHelper.cpp
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedHelper.cpp
@@ -16,7 +16,7 @@
 ******************************************************************************/
 #include <ModelOrderReduction/component/forcefield/HyperReducedHelper.h>
 
-namespace sofa::component::forcefield
+namespace modelorderreduction
 {
 
 HyperReducedHelper::HyperReducedHelper()
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedHelper.h b/src/ModelOrderReduction/component/forcefield/HyperReducedHelper.h
index 01a92245..8709d74d 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedHelper.h
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedHelper.h
@@ -36,16 +36,17 @@
 #include <sofa/core/objectmodel/BaseContext.h>
 
 
-namespace sofa::component::forcefield
+namespace modelorderreduction
 {
 
+using namespace sofa;
 using sofa::component::loader::MatrixLoader;
 
-class SOFA_MODELORDERREDUCTION_API HyperReducedHelper : public virtual core::objectmodel::BaseObject
+class SOFA_MODELORDERREDUCTION_API HyperReducedHelper : public virtual sofa::core::objectmodel::BaseObject
 {
 public:
 
-    SOFA_CLASS(HyperReducedHelper,core::objectmodel::BaseObject);
+    SOFA_CLASS(HyperReducedHelper, sofa::core::objectmodel::BaseObject);
 
     // Reduced order model SOFA Data parameters
     Data< bool > d_prepareECSW;
@@ -108,5 +109,5 @@ void HyperReducedHelper::updateGie(const std::vector<unsigned> indexList,
     }
 
 }
-} // namespace sofa::component::forcefield
+} // namespace modelorderreduction
 
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedHexahedronFEMForceField.h b/src/ModelOrderReduction/component/forcefield/HyperReducedHexahedronFEMForceField.h
index 8de482f8..46fd1e99 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedHexahedronFEMForceField.h
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedHexahedronFEMForceField.h
@@ -29,7 +29,7 @@ using namespace solidmechanics::fem::elastic;
 *   At the moment, it is only implemented for the "large" method (i.e not for small, polar or svd).
 */
 template<class DataTypes>
-class HyperReducedHexahedronFEMForceField : public virtual HexahedronFEMForceField<DataTypes>, public HyperReducedHelper
+class HyperReducedHexahedronFEMForceField : public virtual HexahedronFEMForceField<DataTypes>, public modelorderreduction::HyperReducedHelper
 {
 public:
     SOFA_CLASS2(SOFA_TEMPLATE(HyperReducedHexahedronFEMForceField, DataTypes), SOFA_TEMPLATE(HexahedronFEMForceField, DataTypes), HyperReducedHelper);
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.cpp b/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.cpp
index 2b1e1c5e..472fc9a7 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.cpp
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.cpp
@@ -21,7 +21,7 @@
 #include <sofa/helper/visual/DrawTool.h>
 #include <sofa/core/ObjectFactory.h>
 
-namespace sofa::component::forcefield
+namespace sofa::component::solidmechanics::spring
 {
 
 using namespace sofa::defaulttype;
@@ -35,4 +35,4 @@ int HyperReducedRestShapeSpringsForceFieldClass = core::RegisterObject("Simple e
         ;
 
 template class SOFA_MODELORDERREDUCTION_API HyperReducedRestShapeSpringsForceField<Vec3Types>;
-} // namespace sofa::component::forcefield
+} // namespace sofa::component::solidmechanics::spring
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.h b/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.h
index 13c7dd90..2431dec0 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.h
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.h
@@ -18,14 +18,14 @@
 #include <ModelOrderReduction/config.h>
 
 #include <ModelOrderReduction/component/forcefield/HyperReducedHelper.h>
-#include <SofaDeformable/RestShapeSpringsForceField.h>
+#include <sofa/component/solidmechanics/spring/RestShapeSpringsForceField.h>
 
 namespace sofa::core::behavior
 {
 template< class T > class MechanicalState;
 } // namespace sofa::core::behavior
 
-namespace sofa::component::forcefield
+namespace sofa::component::solidmechanics::spring
 {
 
 /**
@@ -35,7 +35,7 @@ namespace sofa::component::forcefield
 * An external MechanicalState reference can also be passed to the ForceField as rest shape position.
 */
 template<class DataTypes>
-class HyperReducedRestShapeSpringsForceField : public virtual RestShapeSpringsForceField<DataTypes>, public HyperReducedHelper
+class HyperReducedRestShapeSpringsForceField : public virtual RestShapeSpringsForceField<DataTypes>, public modelorderreduction::HyperReducedHelper
 {
 public:
     SOFA_CLASS2(SOFA_TEMPLATE(HyperReducedRestShapeSpringsForceField, DataTypes), SOFA_TEMPLATE(RestShapeSpringsForceField, DataTypes), HyperReducedHelper);
@@ -131,4 +131,4 @@ private :
 extern template class SOFA_MODELORDERREDUCTION_API HyperReducedRestShapeSpringsForceField<sofa::defaulttype::Vec3Types>;
 
 #endif
-} // namespace sofa::component::forcefield
+} // namespace sofa::component::solidmechanics::spring
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.inl b/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.inl
index 19199388..d9dda0b4 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.inl
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.inl
@@ -28,7 +28,7 @@
 #include <assert.h>
 #include <iostream>
 
-namespace sofa::component::forcefield
+namespace sofa::component::solidmechanics::spring
 {
 
 using helper::WriteAccessor;
@@ -488,6 +488,6 @@ void HyperReducedRestShapeSpringsForceField<DataTypes>::addKToMatrix(const Mecha
     }
 }
 
-} // namespace sofa::component::forcefield
+} // namespace sofa::component::solidmechanics::spring
 
 
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.cpp b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.cpp
index 8d36c7bf..39b8d42c 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.cpp
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.cpp
@@ -18,11 +18,11 @@
 
 #include <ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.inl>
 #include <sofa/defaulttype/VecTypes.h>
-#include <SofaBaseMechanics/MechanicalObject.h>
+#include <sofa/component/statecontainer/MechanicalObject.h>
 #include <sofa/core/ObjectFactory.h>
 
 
-namespace sofa::component::forcefield
+namespace sofa::component::solidmechanics::fem::elastic
 {
 
 using namespace sofa::defaulttype;
@@ -36,5 +36,5 @@ int HyperReducedTetrahedralCorotationalFEMForceFieldClass = core::RegisterObject
         ;
 
 template class SOFA_MODELORDERREDUCTION_API HyperReducedTetrahedralCorotationalFEMForceField<Vec3Types>;
-} // namespace sofa::component::forcefield
+} // namespace sofa::component::solidmechanics::fem::elastic
 
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.h b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.h
index 10db6969..d04a8b06 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.h
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.h
@@ -18,15 +18,15 @@
 #include <ModelOrderReduction/config.h>
 
 #include <ModelOrderReduction/component/forcefield/HyperReducedHelper.h>
-#include <SofaGeneralSimpleFem/TetrahedralCorotationalFEMForceField.h>
+#include <sofa/component/solidmechanics/fem/elastic/TetrahedralCorotationalFEMForceField.h>
 
-namespace sofa::component::forcefield
+namespace sofa::component::solidmechanics::fem::elastic
 {
 
 /** Compute Finite Element forces based on tetrahedral elements.
  */
 template<class DataTypes>
-class HyperReducedTetrahedralCorotationalFEMForceField : public virtual TetrahedralCorotationalFEMForceField<DataTypes>, public HyperReducedHelper
+class HyperReducedTetrahedralCorotationalFEMForceField : public virtual TetrahedralCorotationalFEMForceField<DataTypes>, public modelorderreduction::HyperReducedHelper
 {
 public:
     SOFA_CLASS2(SOFA_TEMPLATE(HyperReducedTetrahedralCorotationalFEMForceField, DataTypes), SOFA_TEMPLATE(TetrahedralCorotationalFEMForceField, DataTypes),HyperReducedHelper);
@@ -153,4 +153,4 @@ class HyperReducedTetrahedralCorotationalFEMForceField : public virtual Tetrahed
 #if !defined(SOFA_COMPONENT_FORCEFIELD_HYPERREDUCEDTETRAHEDRALCOROTATIONALFEMFORCEFIELD_CPP)
 extern template class SOFA_MODELORDERREDUCTION_API HyperReducedTetrahedralCorotationalFEMForceField<sofa::defaulttype::Vec3Types>;
 #endif // !defined(SOFA_COMPONENT_FORCEFIELD_HYPERREDUCEDTETRAHEDRALCOROTATIONALFEMFORCEFIELD_CPP)
-} // namespace sofa
+} // namespace sofa::component::solidmechanics::fem::elastic
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.inl b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.inl
index c890bd93..083e07f5 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.inl
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.inl
@@ -19,16 +19,16 @@
 #include <ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.h>
 #include <sofa/core/visual/VisualParams.h>
 #include <sofa/core/MechanicalParams.h>
-#include <SofaBaseTopology/GridTopology.h>
+#include <sofa/component/topology/container/grid/GridTopology.h>
 #include <sofa/simulation/Simulation.h>
 #include <sofa/helper/decompose.h>
-#include <SofaBaseTopology/TopologyData.inl>
+#include <sofa/core/topology/TopologyData.inl>
 #include <assert.h>
 #include <iostream>
 #include <set>
 
 
-namespace sofa::component::forcefield
+namespace sofa::component::solidmechanics::fem::elastic
 {
 
 
@@ -564,7 +564,8 @@ void HyperReducedTetrahedralCorotationalFEMForceField<DataTypes>::accumulateForc
     }
     else
     {
-        serr << "TODO(HyperReducedTetrahedralCorotationalFEMForceField): support for assembling system matrix when using polar method."<<sendl;
+        // TODO: support for assembling system matrix when using polar method.
+        msg_error() << this->getClassName() << " does not support assembling system matrix when using polar method.";
     }
 
     tetrahedronInfo.endEdit();
@@ -755,4 +756,4 @@ void HyperReducedTetrahedralCorotationalFEMForceField<DataTypes>::addKToMatrix(s
         }
     }
 }
-} // namespace sofa::component::forcefield
+} // namespace sofa::component::solidmechanics::fem::elastic
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.h b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.h
index 5a5a3a3b..0d785d6c 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.h
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.h
@@ -39,7 +39,7 @@ using sofa::component::solidmechanics::fem::elastic::TetrahedronFEMForceField;
 *   At the moment, it is only implemented for the "large" method (i.e not for small, polar or svd).
 */
 template<class DataTypes>
-class HyperReducedTetrahedronFEMForceField : public virtual TetrahedronFEMForceField<DataTypes>, public HyperReducedHelper
+class HyperReducedTetrahedronFEMForceField : public virtual TetrahedronFEMForceField<DataTypes>, public modelorderreduction::HyperReducedHelper
 {
 public:
     SOFA_CLASS2(SOFA_TEMPLATE(HyperReducedTetrahedronFEMForceField, DataTypes), SOFA_TEMPLATE(TetrahedronFEMForceField, DataTypes), HyperReducedHelper);
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.inl b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.inl
index 49c9c0d5..711bfe23 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.inl
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.inl
@@ -18,7 +18,7 @@
 
 #include <ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.h>
 #include <sofa/core/visual/VisualParams.h>
-#include <SofaBaseTopology/GridTopology.h>
+#include <sofa/component/topology/container/grid/GridTopology.h>
 #include <sofa/simulation/Simulation.h>
 #include <sofa/core/behavior/MultiMatrixAccessor.h>
 #include <sofa/core/MechanicalParams.h>
@@ -31,7 +31,7 @@
 #include <algorithm>
 #include <limits>
 #include <set>
-#include <SofaBaseLinearSolver/CompressedRowSparseMatrix.h>
+#include <sofa/linearalgebra/CompressedRowSparseMatrix.h>
 #include <sofa/simulation/AnimateBeginEvent.h>
 #include <sofa/helper/AdvancedTimer.h>
 #include <sofa/core/topology/BaseMeshTopology.h>
@@ -674,7 +674,7 @@ void HyperReducedTetrahedronFEMForceField<DataTypes>::addKToMatrix(sofa::lineara
         nbElementsConsidered = m_RIDsize;
     SReal kTimesWeight;
 
-    if (sofa::component::linearsolver::CompressedRowSparseMatrix<type::Mat<3,3,double> > * crsmat = dynamic_cast<sofa::component::linearsolver::CompressedRowSparseMatrix<type::Mat<3,3,double> > * >(mat))
+    if (sofa::linearalgebra::CompressedRowSparseMatrix<type::Mat<3,3,double> > * crsmat = dynamic_cast<sofa::linearalgebra::CompressedRowSparseMatrix<type::Mat<3,3,double> > * >(mat))
     {
 
 
@@ -734,7 +734,7 @@ void HyperReducedTetrahedronFEMForceField<DataTypes>::addKToMatrix(sofa::lineara
         }
 
     }
-    else if (sofa::component::linearsolver::CompressedRowSparseMatrix<type::Mat<3,3,float> > * crsmat = dynamic_cast<sofa::component::linearsolver::CompressedRowSparseMatrix<type::Mat<3,3,float> > * >(mat))
+    else if (sofa::linearalgebra::CompressedRowSparseMatrix<type::Mat<3,3,float> > * crsmat = dynamic_cast<sofa::linearalgebra::CompressedRowSparseMatrix<type::Mat<3,3,float> > * >(mat))
     {
         for( unsigned int numElem = 0 ; numElem<nbElementsConsidered ;++numElem)
         {
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.h b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.h
index f1f16ec4..69bd8288 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.h
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.h
@@ -17,23 +17,25 @@
 #pragma once
 #include <ModelOrderReduction/config.h>
 #include <ModelOrderReduction/component/forcefield/HyperReducedHelper.h>
-#include <SofaMiscFem/TetrahedronHyperelasticityFEMForceField.h>
+#include <sofa/component/solidmechanics/fem/hyperelastic/TetrahedronHyperelasticityFEMForceField.h>
 
 namespace sofa::component::forcefield
 {
 using namespace std;
 using namespace sofa::defaulttype;
 using namespace sofa::core::topology;
+using namespace solidmechanics::fem::hyperelastic;
 
 //***************** Tetrahedron FEM code for several elastic models: TotalLagrangianForceField************************//
 
 /** Compute Finite Element forces based on tetrahedral elements.
 */
 template<class DataTypes>
-class HyperReducedTetrahedronHyperelasticityFEMForceField : public virtual TetrahedronHyperelasticityFEMForceField<DataTypes>, public HyperReducedHelper
+class HyperReducedTetrahedronHyperelasticityFEMForceField : public virtual solidmechanics::fem::hyperelastic::TetrahedronHyperelasticityFEMForceField<DataTypes>, public modelorderreduction::HyperReducedHelper
 {
   public:
-    SOFA_CLASS2(SOFA_TEMPLATE(HyperReducedTetrahedronHyperelasticityFEMForceField, DataTypes), SOFA_TEMPLATE(TetrahedronHyperelasticityFEMForceField, DataTypes), HyperReducedHelper);
+    SOFA_CLASS2(SOFA_TEMPLATE(HyperReducedTetrahedronHyperelasticityFEMForceField, DataTypes),
+        SOFA_TEMPLATE(solidmechanics::fem::hyperelastic::TetrahedronHyperelasticityFEMForceField, DataTypes), HyperReducedHelper);
 
     typedef typename DataTypes::VecCoord VecCoord;
     typedef typename DataTypes::VecDeriv VecDeriv;
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.inl b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.inl
index 82840c76..57545e38 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.inl
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.inl
@@ -17,24 +17,24 @@
 #pragma once
 
 #include <sofa/gl/gl.h>
-#include <SofaMiscFem/BoyceAndArruda.h>
-#include <SofaMiscFem/NeoHookean.h>
-#include <SofaMiscFem/MooneyRivlin.h>
-#include <SofaMiscFem/VerondaWestman.h>
-#include <SofaMiscFem/STVenantKirchhoff.h>
-#include <SofaMiscFem/HyperelasticMaterial.h>
-#include <SofaMiscFem/Costa.h>
-#include <SofaMiscFem/Ogden.h>
+#include <sofa/component/solidmechanics/fem/hyperelastic/material/BoyceAndArruda.h>
+#include <sofa/component/solidmechanics/fem/hyperelastic/material/NeoHookean.h>
+#include <sofa/component/solidmechanics/fem/hyperelastic/material/MooneyRivlin.h>
+#include <sofa/component/solidmechanics/fem/hyperelastic/material/VerondaWestman.h>
+#include <sofa/component/solidmechanics/fem/hyperelastic/material/STVenantKirchhoff.h>
+#include <sofa/component/solidmechanics/fem/hyperelastic/material/HyperelasticMaterial.h>
+#include <sofa/component/solidmechanics/fem/hyperelastic/material/Costa.h>
+#include <sofa/component/solidmechanics/fem/hyperelastic/material/Ogden.h>
 #include <ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.h>
 #include <sofa/core/visual/VisualParams.h>
 #include <sofa/defaulttype/VecTypes.h>
-#include <SofaBaseMechanics/MechanicalObject.h>
+#include <sofa/component/statecontainer/MechanicalObject.h>
 #include <sofa/core/ObjectFactory.h>
 #include <fstream> // for reading the file
 #include <iostream> //for debugging
 #include <sofa/gl/template.h>
 #include <sofa/core/behavior/ForceField.inl>
-#include <SofaBaseTopology/TopologyData.inl>
+#include <sofa/core/topology/TopologyData.inl>
 #include <algorithm>
 #include <iterator>
 
@@ -46,7 +46,6 @@ namespace sofa::component::forcefield
 {
 
 using namespace sofa::defaulttype;
-using namespace	sofa::component::topology;
 using namespace core::topology;
 using sofa::component::loader::MatrixLoader;
 
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.cpp b/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.cpp
index c3588d68..172404f7 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.cpp
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.cpp
@@ -22,7 +22,7 @@
 
 // #define DEBUG_TRIANGLEFEM
 
-namespace sofa::component::forcefield
+namespace sofa::component::solidmechanics::fem::elastic
 {
 
 SOFA_DECL_CLASS(HyperReducedTriangleFEMForceField)
@@ -35,4 +35,4 @@ int HyperReducedTriangleFEMForceFieldClass = core::RegisterObject("Triangular fi
         ;
 
 template class SOFA_MODELORDERREDUCTION_API HyperReducedTriangleFEMForceField<Vec3Types>;
-} // namespace sofa::component::forcefield
+} // namespace sofa::component::solidmechanics::fem::elastic
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.h b/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.h
index 91a17ea7..cfd969fb 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.h
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.h
@@ -18,7 +18,7 @@
 #include <ModelOrderReduction/config.h>
 
 #include <ModelOrderReduction/component/forcefield/HyperReducedHelper.h>
-#include <SofaMiscFem/TriangleFEMForceField.h>
+#include <sofa/component/solidmechanics/fem/elastic/TriangleFEMForceField.h>
 
 
 // corotational triangle from
@@ -34,7 +34,7 @@
 // }
 
 
-namespace sofa::component::forcefield
+namespace sofa::component::solidmechanics::fem::elastic
 {
 
 
@@ -44,7 +44,7 @@ namespace sofa::component::forcefield
   The method for small displacements has not been validated and we suspect that it is broke. Use it very carefully, and compare with the method for large displacements.
   */
 template<class DataTypes>
-class HyperReducedTriangleFEMForceField : public virtual TriangleFEMForceField<DataTypes>, public HyperReducedHelper
+class HyperReducedTriangleFEMForceField : public virtual TriangleFEMForceField<DataTypes>, public modelorderreduction::HyperReducedHelper
 {
 public:
     SOFA_CLASS2(SOFA_TEMPLATE(HyperReducedTriangleFEMForceField, DataTypes), SOFA_TEMPLATE(TriangleFEMForceField, DataTypes),HyperReducedHelper);
@@ -116,12 +116,12 @@ class HyperReducedTriangleFEMForceField : public virtual TriangleFEMForceField<D
     using HyperReducedHelper::m_RIDsize;
 
 
-    virtual void init() override;
-    virtual void addForce(const core::MechanicalParams* mparams, DataVecDeriv& f, const DataVecCoord& x, const DataVecDeriv& v) override;
-    virtual void addDForce(const core::MechanicalParams* mparams, DataVecDeriv& df, const DataVecDeriv& dx) override;
-    virtual SReal getPotentialEnergy(const core::MechanicalParams* /*mparams*/, const DataVecCoord&  /* x */) const override
+    void init() override;
+    void addForce(const core::MechanicalParams* mparams, DataVecDeriv& f, const DataVecCoord& x, const DataVecDeriv& v) override;
+    void addDForce(const core::MechanicalParams* mparams, DataVecDeriv& df, const DataVecDeriv& dx) override;
+    SReal getPotentialEnergy(const core::MechanicalParams* /*mparams*/, const DataVecCoord&  /* x */) const override
     {
-        serr << "Get potentialEnergy not implemented" << sendl;
+        msg_error() << "Get potentialEnergy not implemented";
         return 0.0;
     }
 
@@ -149,4 +149,4 @@ protected :
 #if !defined(SOFA_COMPONENT_FORCEFIELD_HYPERREDUCEDTRIANGLEFEMFORCEFIELD_CPP)
 extern template class SOFA_MODELORDERREDUCTION_API HyperReducedTriangleFEMForceField<sofa::defaulttype::Vec3Types>;
 #endif // !defined(SOFA_COMPONENT_FORCEFIELD_HYPERREDUCEDTRIANGLEFEMFORCEFIELD_CPP)
-} // namespace sofa::component::forcefield
+} // namespace sofa::component::solidmechanics::fem::elastic
diff --git a/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.inl b/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.inl
index 3b588714..990b1751 100644
--- a/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.inl
+++ b/src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.inl
@@ -28,7 +28,7 @@
 #include <sofa/defaulttype/VecTypes.h>
 #include <ModelOrderReduction/component/loader/MatrixLoader.h>
 
-namespace sofa::component::forcefield
+namespace sofa::component::solidmechanics::fem::elastic
 {
 
 using sofa::component::loader::MatrixLoader;
@@ -399,4 +399,4 @@ void HyperReducedTriangleFEMForceField<DataTypes>::addKToMatrix(sofa::linearalge
         }
     }
 }
-} // namespace sofa::component::forcefield
+} // namespace sofa::component::solidmechanics::fem::elastic
diff --git a/src/ModelOrderReduction/component/forcefield/MechanicalMatrixMapperMOR.inl b/src/ModelOrderReduction/component/forcefield/MechanicalMatrixMapperMOR.inl
index 5adfd3ae..6ab519fd 100644
--- a/src/ModelOrderReduction/component/forcefield/MechanicalMatrixMapperMOR.inl
+++ b/src/ModelOrderReduction/component/forcefield/MechanicalMatrixMapperMOR.inl
@@ -18,8 +18,8 @@
 
 #include <ModelOrderReduction/component/forcefield/MechanicalMatrixMapperMOR.h>
 #include <sofa/component/mapping/mappedmatrix/MechanicalMatrixMapper.inl>
-#include <SofaDeformable/SpringForceField.h>
-#include <SofaDeformable/StiffSpringForceField.h>
+#include <sofa/component/solidmechanics/spring/SpringForceField.h>
+#include <sofa/component/solidmechanics/spring/StiffSpringForceField.h>
 #include <ModelOrderReduction/component/loader/MatrixLoader.h>
 
 
diff --git a/src/ModelOrderReduction/component/mapping/MORContactMapping.h b/src/ModelOrderReduction/component/mapping/MORContactMapping.h
index f7d8ddc2..5bd3bffb 100644
--- a/src/ModelOrderReduction/component/mapping/MORContactMapping.h
+++ b/src/ModelOrderReduction/component/mapping/MORContactMapping.h
@@ -23,12 +23,12 @@
 #define SOFA_COMPONENT_MAPPING_MORCONTACTMAPPING_H
 #include <ModelOrderReduction/config.h>
 #include <sofa/core/Mapping.h>
-#include <SofaBaseLinearSolver/CompressedRowSparseMatrix.h>
+#include <sofa/linearalgebra/CompressedRowSparseMatrix.h>
 #include <sofa/defaulttype/VecTypes.h>
 #include <sofa/defaulttype/RigidTypes.h>
 #include <vector>
 #include <memory>
-#include <SofaEigen2Solver/EigenSparseMatrix.h>
+#include <sofa/linearalgebra/EigenSparseMatrix.h>
 #include <sofa/core/objectmodel/DataFileName.h>
 
 
@@ -132,7 +132,7 @@ class MORContactMapping : public core::Mapping<TIn, TOut>
 
 protected:
 
-    typedef linearsolver::EigenSparseMatrix<TIn, TOut> eigen_type;
+    typedef sofa::linearalgebra::EigenSparseMatrix<TIn, TOut> eigen_type;
     eigen_type J;
 
     typedef type::vector< linearalgebra::BaseMatrix* > js_type;
diff --git a/src/ModelOrderReduction/component/mapping/ModelOrderReductionMapping.h b/src/ModelOrderReduction/component/mapping/ModelOrderReductionMapping.h
index cccffb47..78c81984 100644
--- a/src/ModelOrderReduction/component/mapping/ModelOrderReductionMapping.h
+++ b/src/ModelOrderReduction/component/mapping/ModelOrderReductionMapping.h
@@ -20,13 +20,13 @@
 
 #include <vector>
 
-#include <SofaBaseLinearSolver/CompressedRowSparseMatrix.h>
+#include <sofa/linearalgebra/CompressedRowSparseMatrix.h>
 #include <sofa/defaulttype/VecTypes.h>
 #include <sofa/core/topology/BaseMeshTopology.h>
 
 #include <boost/scoped_ptr.hpp>
 
-#include <SofaEigen2Solver/EigenSparseMatrix.h>
+#include <sofa/linearalgebra/EigenSparseMatrix.h>
 #include <sofa/core/objectmodel/BaseObject.h>
 #include <sofa/core/State.h>
 #include <sofa/core/objectmodel/DataFileName.h>
@@ -89,7 +89,7 @@ class ModelOrderReductionMapping : public core::Mapping<TIn, TOut>
     typedef core::topology::BaseMeshTopology::Tetra Element;
     typedef core::topology::BaseMeshTopology::SeqTetrahedra VecElement;
 
-    typedef linearsolver::EigenSparseMatrix<TIn, TOut> eigen_type;
+    typedef sofa::linearalgebra::EigenSparseMatrix<TIn, TOut> eigen_type;
     typedef type::vector< linearalgebra::BaseMatrix* > js_type;
 
 
diff --git a/src/ModelOrderReduction/component/mapping/ModelOrderReductionMapping.inl b/src/ModelOrderReduction/component/mapping/ModelOrderReductionMapping.inl
index ec05387c..ce1e749e 100644
--- a/src/ModelOrderReduction/component/mapping/ModelOrderReductionMapping.inl
+++ b/src/ModelOrderReduction/component/mapping/ModelOrderReductionMapping.inl
@@ -19,7 +19,7 @@
 
 #include "ModelOrderReductionMapping.h"
 #include <sofa/defaulttype/RigidTypes.h>
-#include <SofaBaseTopology/GridTopology.h>
+#include <sofa/component/topology/container/grid/GridTopology.h>
 #include <sofa/defaulttype/VecTypes.h>
 #include <sofa/helper/AdvancedTimer.h>
 #include <iostream>


Test patch:
diff --git a/ModelOrderReduction_test/ModelOrderReduction_test.cpp b/ModelOrderReduction_test/ModelOrderReduction_test.cpp
index 7ed9dcb8..fdf03402 100644
--- a/ModelOrderReduction_test/ModelOrderReduction_test.cpp
+++ b/ModelOrderReduction_test/ModelOrderReduction_test.cpp
@@ -1,5 +1,5 @@
 #include <sofa/testing/BaseSimulationTest.h>
-#include <SofaSimulationGraph/DAGSimulation.h>
+#include <sofa/simulation/graph/DAGSimulation.h>
 
 namespace sofa {