Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#pragma once

#include <sofa/component/linearsystem/config.h>
#include <sofa/component/linearsystem/MappingGraph.h>
#include <sofa/simulation/MappingGraph.h>
#include <sofa/core/behavior/StateAccessor.h>
#include <sofa/linearalgebra/CompressedRowSparseMatrix.h>

Expand Down Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <sofa/core/behavior/BaseLocalForceFieldMatrix.h>
#include <sofa/core/behavior/BaseLocalMassMatrix.h>
#include <sofa/core/BaseLocalMappingMatrix.h>
#include <sofa/component/linearsystem/MappingGraph.h>
#include <sofa/simulation/MappingGraph.h>
#include <sofa/core/behavior/BaseProjectiveConstraintSet.h>
#include <sofa/component/linearsystem/matrixaccumulators/AssemblingMappedMatrixAccumulator.h>
#include <sofa/component/linearsystem/CreateMatrixDispatcher.h>
Expand Down Expand Up @@ -80,7 +80,7 @@ class MatrixLinearSystem : public TypedMatrixLinearSystem<TMatrix, TVector>
using Contribution = core::matrixaccumulator::Contribution;
using PairMechanicalStates = sofa::type::fixed_array<core::behavior::BaseMechanicalState*, 2>;

[[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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ TMatrix, TVector>::getContributors() const
}

template <class TMatrix, class TVector>
const MappingGraph& MatrixLinearSystem<TMatrix, TVector>::getMappingGraph() const
const simulation::MappingGraph& MatrixLinearSystem<TMatrix, TVector>::getMappingGraph() const
{
return m_mappingGraph;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MatrixProjectionMethod : public BaseMatrixProjectionMethod<TMatrix>
~MatrixProjectionMethod() override;

void computeMatrixJacobians(const core::MechanicalParams* mparams,
const MappingGraph& mappingGraph,
const simulation::MappingGraph& mappingGraph,
TMatrix* matrixToProject);

protected:
Expand All @@ -51,12 +51,12 @@ class MatrixProjectionMethod : public BaseMatrixProjectionMethod<TMatrix>

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;

Expand All @@ -67,7 +67,7 @@ class MatrixProjectionMethod : public BaseMatrixProjectionMethod<TMatrix>
* Build the jacobian matrices of mappings from a mapped state to its top most parents (in the
* sense of mappings)
*/
simulation::MappingJacobians<TMatrix> computeJacobiansFrom(core::behavior::BaseMechanicalState* mstate, const core::MechanicalParams* mparams, const MappingGraph& mappingGraph, TMatrix* crs);
simulation::MappingJacobians<TMatrix> computeJacobiansFrom(core::behavior::BaseMechanicalState* mstate, const core::MechanicalParams* mparams, const simulation::MappingGraph& mappingGraph, TMatrix* crs);

core::objectmodel::BaseContext* getSolveContext();

Expand All @@ -88,7 +88,7 @@ class MatrixProjectionMethod : public BaseMatrixProjectionMethod<TMatrix>
sofa::type::fixed_array<core::behavior::BaseMechanicalState*, 2> mstatePair,
TMatrix* mappedMatrix,
sofa::type::fixed_array<simulation::MappingJacobians<TMatrix>, 2> jacobians,
const MappingGraph& mappingGraph,
const simulation::MappingGraph& mappingGraph,
linearalgebra::BaseMatrix* globalMatrix);

Eigen::Map<Eigen::SparseMatrix<Block, Eigen::RowMajor> > makeEigenMap(const TMatrix& matrix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void MatrixProjectionMethod<TMatrix>::addMappedMatrixToGlobalMatrixEigen(
sofa::type::fixed_array<core::behavior::BaseMechanicalState*, 2> mstatePair,
TMatrix* mappedMatrix,
sofa::type::fixed_array<simulation::MappingJacobians<TMatrix>, 2> jacobians,
const MappingGraph& mappingGraph, linearalgebra::BaseMatrix* globalMatrix)
const simulation::MappingGraph& mappingGraph, linearalgebra::BaseMatrix* globalMatrix)
{
if (!mappedMatrix)
{
Expand Down Expand Up @@ -203,7 +203,7 @@ void addToGlobalMatrix(linearalgebra::BaseMatrix* globalMatrix, Eigen::SparseMat
}

template <class TMatrix>
void MatrixProjectionMethod<TMatrix>::computeMatrixJacobians(const core::MechanicalParams* mparams, const MappingGraph& mappingGraph, TMatrix* matrixToProject)
void MatrixProjectionMethod<TMatrix>::computeMatrixJacobians(const core::MechanicalParams* mparams, const simulation::MappingGraph& mappingGraph, TMatrix* matrixToProject)
{
if (!m_mappingJacobians.has_value() || !d_areJacobiansConstant.getValue())
{
Expand All @@ -219,7 +219,8 @@ void MatrixProjectionMethod<TMatrix>::computeMatrixJacobians(const core::Mechani
}

template <class TMatrix>
void MatrixProjectionMethod<TMatrix>::computeMatrixProduct(const MappingGraph& mappingGraph, TMatrix* matrixToProject, linearalgebra::BaseMatrix* globalMatrix)
void MatrixProjectionMethod<TMatrix>::computeMatrixProduct(
const simulation::MappingGraph& mappingGraph, TMatrix* matrixToProject, linearalgebra::BaseMatrix* globalMatrix)
{
this->addMappedMatrixToGlobalMatrixEigen(
{this->l_mechanicalStates[0], this->l_mechanicalStates[1]},
Expand All @@ -229,7 +230,7 @@ void MatrixProjectionMethod<TMatrix>::computeMatrixProduct(const MappingGraph& m

template <class TMatrix>
void MatrixProjectionMethod<TMatrix>::projectMatrixToGlobalMatrix(const core::MechanicalParams* mparams,
const MappingGraph& mappingGraph,
const simulation::MappingGraph& mappingGraph,
TMatrix* matrixToProject, linearalgebra::BaseMatrix* globalMatrix)
{
computeMatrixJacobians(mparams, mappingGraph, matrixToProject);
Expand Down Expand Up @@ -265,7 +266,7 @@ std::vector<unsigned> MatrixProjectionMethod<TMatrix>::identifyAffectedDoFs(
template <class TMatrix>
simulation::MappingJacobians<TMatrix> MatrixProjectionMethod<TMatrix>::computeJacobiansFrom(
core::behavior::BaseMechanicalState* mstate, const core::MechanicalParams* mparams,
const MappingGraph& mappingGraph, TMatrix* crs)
const simulation::MappingGraph& mappingGraph, TMatrix* crs)
{
core::ConstraintParams cparams(*mparams);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <sofa/core/behavior/BaseMatrixLinearSystem.h>
#include <sofa/core/MultiVecId.h>
#include <sofa/component/linearsystem/MappingGraph.h>
#include <sofa/simulation/MappingGraph.h>
#include <sofa/core/behavior/LinearSolver.h>
#include <sofa/component/linearsystem/LinearSystemData.h>
#include <sofa/core/MatrixAccumulator.h>
Expand Down Expand Up @@ -106,7 +106,7 @@ class TypedMatrixLinearSystem : public sofa::core::behavior::BaseMatrixLinearSys
LinearSystemData<TMatrix, TVector> m_linearSystem;

/// Relationships between the mechanical states and their associated components
MappingGraph m_mappingGraph;
::sofa::simulation::MappingGraph m_mappingGraph;
Comment thread
hugtalbot marked this conversation as resolved.

/// The list of force fields contributing to the matrix assembly
sofa::type::vector<sofa::core::behavior::BaseForceField*> m_forceFields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <sofa/component/linearsystem/config.h>
#include <sofa/simulation/BaseMechanicalVisitor.h>
#include <sofa/component/linearsystem/MappingGraph.h>
#include <sofa/simulation/MappingGraph.h>

namespace sofa::component::linearsystem
{
Expand All @@ -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);

Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <sofa/component/linearsystem/config.h>
#include <sofa/simulation/BaseMechanicalVisitor.h>
#include <sofa/component/linearsystem/MappingGraph.h>
#include <sofa/simulation/MappingGraph.h>

namespace sofa::component::linearsystem
{
Expand All @@ -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);

Expand All @@ -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
Loading