From 3ff71ecf78e37fad8ac68f763bf94a3a43daf447 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Mon, 4 May 2026 09:57:04 +0200 Subject: [PATCH 1/2] [LinearSystem] Replace deprecated header --- .../sofa/component/linearsystem/BaseMatrixProjectionMethod.h | 2 +- .../src/sofa/component/linearsystem/MatrixLinearSystem.h | 2 +- .../src/sofa/component/linearsystem/TypedMatrixLinearSystem.h | 2 +- .../visitors/AssembleGlobalVectorFromLocalVectorVisitor.h | 2 +- .../visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/BaseMatrixProjectionMethod.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/BaseMatrixProjectionMethod.h index 68a8b4d6070..6390864ce7c 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/BaseMatrixProjectionMethod.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/BaseMatrixProjectionMethod.h @@ -22,7 +22,7 @@ #pragma once #include -#include +#include #include #include diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.h index a1b7ec9f91e..107909db7a8 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/TypedMatrixLinearSystem.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/TypedMatrixLinearSystem.h index 87e20f62e1d..215115c97bb 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/TypedMatrixLinearSystem.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/TypedMatrixLinearSystem.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h index a57341bad2d..234ca9705bb 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h @@ -23,7 +23,7 @@ #include #include -#include +#include namespace sofa::component::linearsystem { diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h index 45f7650c37e..0db68dafdc1 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h @@ -23,7 +23,7 @@ #include #include -#include +#include namespace sofa::component::linearsystem { From bebe585b4d0caa8fb94d68a7d0a2f6ffd7c3909b Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Mon, 4 May 2026 10:39:20 +0200 Subject: [PATCH 2/2] fix namespaces --- .../linearsystem/BaseMatrixProjectionMethod.h | 2 +- .../sofa/component/linearsystem/MatrixLinearSystem.h | 2 +- .../component/linearsystem/MatrixLinearSystem.inl | 2 +- .../component/linearsystem/MatrixProjectionMethod.h | 10 +++++----- .../component/linearsystem/MatrixProjectionMethod.inl | 11 ++++++----- .../component/linearsystem/TypedMatrixLinearSystem.h | 2 +- .../AssembleGlobalVectorFromLocalVectorVisitor.cpp | 2 +- .../AssembleGlobalVectorFromLocalVectorVisitor.h | 4 ++-- .../DispatchFromGlobalVectorToLocalVectorVisitor.cpp | 2 +- .../DispatchFromGlobalVectorToLocalVectorVisitor.h | 4 ++-- 10 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/BaseMatrixProjectionMethod.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/BaseMatrixProjectionMethod.h index 6390864ce7c..77112c186f3 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/BaseMatrixProjectionMethod.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/BaseMatrixProjectionMethod.h @@ -62,7 +62,7 @@ class BaseMatrixProjectionMethod : public core::behavior::StateAccessor * \param globalMatrix The product is added into this matrix */ virtual void projectMatrixToGlobalMatrix(const core::MechanicalParams* mparams, - const MappingGraph& mappingGraph, + const simulation::MappingGraph& mappingGraph, TMatrix* matrixToProject, linearalgebra::BaseMatrix* globalMatrix) = 0; diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.h index 107909db7a8..2d05d8d8a8a 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.h @@ -80,7 +80,7 @@ class MatrixLinearSystem : public TypedMatrixLinearSystem using Contribution = core::matrixaccumulator::Contribution; using PairMechanicalStates = sofa::type::fixed_array; - [[nodiscard]] const MappingGraph& getMappingGraph() const; + [[nodiscard]] const simulation::MappingGraph& getMappingGraph() const; Data< bool > d_assembleStiffness; ///< If true, the stiffness is added to the global matrix Data< bool > d_assembleMass; ///< If true, the mass is added to the global matrix diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.inl b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.inl index 502e25bd66a..f3a8b125eb2 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.inl +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixLinearSystem.inl @@ -760,7 +760,7 @@ TMatrix, TVector>::getContributors() const } template -const MappingGraph& MatrixLinearSystem::getMappingGraph() const +const simulation::MappingGraph& MatrixLinearSystem::getMappingGraph() const { return m_mappingGraph; } diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixProjectionMethod.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixProjectionMethod.h index 77854b28e79..866949efaab 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixProjectionMethod.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixProjectionMethod.h @@ -42,7 +42,7 @@ class MatrixProjectionMethod : public BaseMatrixProjectionMethod ~MatrixProjectionMethod() override; void computeMatrixJacobians(const core::MechanicalParams* mparams, - const MappingGraph& mappingGraph, + const simulation::MappingGraph& mappingGraph, TMatrix* matrixToProject); protected: @@ -51,12 +51,12 @@ class MatrixProjectionMethod : public BaseMatrixProjectionMethod void reinit() override; - virtual void computeMatrixProduct(const MappingGraph& mappingGraph, + virtual void computeMatrixProduct(const simulation::MappingGraph& mappingGraph, TMatrix* matrixToProject, linearalgebra::BaseMatrix* globalMatrix); virtual void projectMatrixToGlobalMatrix(const core::MechanicalParams* mparams, - const MappingGraph& mappingGraph, + const simulation::MappingGraph& mappingGraph, TMatrix* matrixToProject, linearalgebra::BaseMatrix* globalMatrix) override; @@ -67,7 +67,7 @@ class MatrixProjectionMethod : public BaseMatrixProjectionMethod * Build the jacobian matrices of mappings from a mapped state to its top most parents (in the * sense of mappings) */ - simulation::MappingJacobians computeJacobiansFrom(core::behavior::BaseMechanicalState* mstate, const core::MechanicalParams* mparams, const MappingGraph& mappingGraph, TMatrix* crs); + simulation::MappingJacobians computeJacobiansFrom(core::behavior::BaseMechanicalState* mstate, const core::MechanicalParams* mparams, const simulation::MappingGraph& mappingGraph, TMatrix* crs); core::objectmodel::BaseContext* getSolveContext(); @@ -88,7 +88,7 @@ class MatrixProjectionMethod : public BaseMatrixProjectionMethod sofa::type::fixed_array mstatePair, TMatrix* mappedMatrix, sofa::type::fixed_array, 2> jacobians, - const MappingGraph& mappingGraph, + const simulation::MappingGraph& mappingGraph, linearalgebra::BaseMatrix* globalMatrix); Eigen::Map > makeEigenMap(const TMatrix& matrix); diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixProjectionMethod.inl b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixProjectionMethod.inl index 5eb7d467172..3e9f18078e4 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixProjectionMethod.inl +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/MatrixProjectionMethod.inl @@ -72,7 +72,7 @@ void MatrixProjectionMethod::addMappedMatrixToGlobalMatrixEigen( sofa::type::fixed_array mstatePair, TMatrix* mappedMatrix, sofa::type::fixed_array, 2> jacobians, - const MappingGraph& mappingGraph, linearalgebra::BaseMatrix* globalMatrix) + const simulation::MappingGraph& mappingGraph, linearalgebra::BaseMatrix* globalMatrix) { if (!mappedMatrix) { @@ -203,7 +203,7 @@ void addToGlobalMatrix(linearalgebra::BaseMatrix* globalMatrix, Eigen::SparseMat } template -void MatrixProjectionMethod::computeMatrixJacobians(const core::MechanicalParams* mparams, const MappingGraph& mappingGraph, TMatrix* matrixToProject) +void MatrixProjectionMethod::computeMatrixJacobians(const core::MechanicalParams* mparams, const simulation::MappingGraph& mappingGraph, TMatrix* matrixToProject) { if (!m_mappingJacobians.has_value() || !d_areJacobiansConstant.getValue()) { @@ -219,7 +219,8 @@ void MatrixProjectionMethod::computeMatrixJacobians(const core::Mechani } template -void MatrixProjectionMethod::computeMatrixProduct(const MappingGraph& mappingGraph, TMatrix* matrixToProject, linearalgebra::BaseMatrix* globalMatrix) +void MatrixProjectionMethod::computeMatrixProduct( + const simulation::MappingGraph& mappingGraph, TMatrix* matrixToProject, linearalgebra::BaseMatrix* globalMatrix) { this->addMappedMatrixToGlobalMatrixEigen( {this->l_mechanicalStates[0], this->l_mechanicalStates[1]}, @@ -229,7 +230,7 @@ void MatrixProjectionMethod::computeMatrixProduct(const MappingGraph& m template void MatrixProjectionMethod::projectMatrixToGlobalMatrix(const core::MechanicalParams* mparams, - const MappingGraph& mappingGraph, + const simulation::MappingGraph& mappingGraph, TMatrix* matrixToProject, linearalgebra::BaseMatrix* globalMatrix) { computeMatrixJacobians(mparams, mappingGraph, matrixToProject); @@ -265,7 +266,7 @@ std::vector MatrixProjectionMethod::identifyAffectedDoFs( template simulation::MappingJacobians MatrixProjectionMethod::computeJacobiansFrom( core::behavior::BaseMechanicalState* mstate, const core::MechanicalParams* mparams, - const MappingGraph& mappingGraph, TMatrix* crs) + const simulation::MappingGraph& mappingGraph, TMatrix* crs) { core::ConstraintParams cparams(*mparams); diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/TypedMatrixLinearSystem.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/TypedMatrixLinearSystem.h index 215115c97bb..8970326c8b7 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/TypedMatrixLinearSystem.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/TypedMatrixLinearSystem.h @@ -106,7 +106,7 @@ class TypedMatrixLinearSystem : public sofa::core::behavior::BaseMatrixLinearSys LinearSystemData m_linearSystem; /// Relationships between the mechanical states and their associated components - MappingGraph m_mappingGraph; + ::sofa::simulation::MappingGraph m_mappingGraph; /// The list of force fields contributing to the matrix assembly sofa::type::vector m_forceFields; diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.cpp b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.cpp index 993d0964107..514b109d9c2 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.cpp +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.cpp @@ -26,7 +26,7 @@ namespace sofa::component::linearsystem { AssembleGlobalVectorFromLocalVectorVisitor::AssembleGlobalVectorFromLocalVectorVisitor(const core::ExecParams* params, - const MappingGraph& mappingGraph, sofa::core::ConstMultiVecId src, linearalgebra::BaseVector* globalVector) + const simulation::MappingGraph& mappingGraph, sofa::core::ConstMultiVecId src, linearalgebra::BaseVector* globalVector) : BaseMechanicalVisitor(params) , m_src(src) , m_globalVector(globalVector) diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h index 234ca9705bb..5300b9673e8 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h @@ -38,7 +38,7 @@ class SOFA_COMPONENT_LINEARSYSTEM_API AssembleGlobalVectorFromLocalVectorVisitor AssembleGlobalVectorFromLocalVectorVisitor( const core::ExecParams* params, - const MappingGraph& mappingGraph, + const simulation::MappingGraph& mappingGraph, sofa::core::ConstMultiVecId src, linearalgebra::BaseVector * globalVector); @@ -57,7 +57,7 @@ class SOFA_COMPONENT_LINEARSYSTEM_API AssembleGlobalVectorFromLocalVectorVisitor sofa::linearalgebra::BaseVector *m_globalVector { nullptr}; /// Structure used to identify where in the global vector the local vectors will be copied into - const MappingGraph& m_mappingGraph; + const simulation::MappingGraph& m_mappingGraph; }; } // namespace sofa::component::linearsystem diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.cpp b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.cpp index cd76890414b..e8506ae35bf 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.cpp +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.cpp @@ -26,7 +26,7 @@ namespace sofa::component::linearsystem { DispatchFromGlobalVectorToLocalVectorVisitor::DispatchFromGlobalVectorToLocalVectorVisitor(const core::ExecParams* params, - const MappingGraph& mappingGraph, sofa::core::MultiVecId dst, linearalgebra::BaseVector* globalVector) + const simulation::MappingGraph& mappingGraph, sofa::core::MultiVecId dst, linearalgebra::BaseVector* globalVector) : BaseMechanicalVisitor(params) , m_dst(dst) , m_globalVector(globalVector) diff --git a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h index 0db68dafdc1..42f9ecc1e2c 100644 --- a/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h +++ b/Sofa/Component/LinearSystem/src/sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h @@ -38,7 +38,7 @@ class SOFA_COMPONENT_LINEARSYSTEM_API DispatchFromGlobalVectorToLocalVectorVisit DispatchFromGlobalVectorToLocalVectorVisitor( const core::ExecParams* params, - const MappingGraph& mappingGraph, + const simulation::MappingGraph& mappingGraph, sofa::core::MultiVecId dst, linearalgebra::BaseVector * globalVector); @@ -57,7 +57,7 @@ class SOFA_COMPONENT_LINEARSYSTEM_API DispatchFromGlobalVectorToLocalVectorVisit sofa::linearalgebra::BaseVector *m_globalVector { nullptr}; /// Structure used to identify where in the global vector the local vectors will be copied from - const MappingGraph& m_mappingGraph; + const simulation::MappingGraph& m_mappingGraph; }; } // namespace sofa::component::linearsystem