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
6 changes: 0 additions & 6 deletions Sofa/Component/LinearSystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ set(HEADER_FILES
${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/matrixaccumulators/ConstantLocalMatrix.h
${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/matrixaccumulators/SparsityPatternLocalMappedMatrix.h
${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/matrixaccumulators/SparsityPatternLocalMatrix.h

${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h
${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h
)

set(SOURCE_FILES
Expand All @@ -50,9 +47,6 @@ set(SOURCE_FILES
${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/MatrixLinearSystem.cpp
${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/MatrixProjectionMethod.cpp
${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/TypedMatrixLinearSystem.cpp

${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/visitors/AssembleGlobalVectorFromLocalVectorVisitor.cpp
${SOFACOMPONENTLINEARSOLVERLINEARSYSTEM_SOURCE_DIR}/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.cpp
)

sofa_find_package(Sofa.Simulation.Core REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include <sofa/component/linearsystem/TypedMatrixLinearSystem.h>
#include <sofa/core/MechanicalParams.h>
#include <sofa/helper/ScopedAdvancedTimer.h>
#include <sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h>
#include <sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h>
#include <sofa/core/behavior/BaseForceField.h>
#include <sofa/core/behavior/BaseMass.h>
#include <sofa/core/BaseMapping.h>
Expand Down Expand Up @@ -101,8 +99,11 @@ void TypedMatrixLinearSystem<TMatrix, TVector>::copyLocalVectorToGlobalVector(co
globalVector->resize(m_mappingGraph.getTotalNbMainDofs());
}

AssembleGlobalVectorFromLocalVectorVisitor(core::execparams::defaultInstance(), m_mappingGraph, v, globalVector)
.execute(getSolveContext());
for (const auto& state : m_mappingGraph.getMainMechanicalStates())
{
auto pos = m_mappingGraph.getPositionInGlobalMatrix(state);
state->copyToBaseVector(globalVector, v.getId(state), pos[0]);
}
}
}

Expand Down Expand Up @@ -179,8 +180,11 @@ void TypedMatrixLinearSystem<TMatrix, TVector>::dispatchSystemSolution(core::Mul
{
if (getSolutionVector())
{
DispatchFromGlobalVectorToLocalVectorVisitor(core::execparams::defaultInstance(), m_mappingGraph, v, getSolutionVector())
.execute(getSolveContext());
for (const auto& state : m_mappingGraph.getMainMechanicalStates())
{
auto pos = m_mappingGraph.getPositionInGlobalMatrix(state);
state->copyFromBaseVector(v.getId(state), getSolutionVector(), pos[0]);
}
}
}

Expand All @@ -189,8 +193,11 @@ void TypedMatrixLinearSystem<TMatrix, TVector>::dispatchSystemRHS(core::MultiVec
{
if (getRHSVector())
{
DispatchFromGlobalVectorToLocalVectorVisitor(core::execparams::defaultInstance(), m_mappingGraph, v, getRHSVector())
.execute(getSolveContext());
for (const auto& state : m_mappingGraph.getMainMechanicalStates())
{
auto pos = m_mappingGraph.getPositionInGlobalMatrix(state);
state->copyFromBaseVector(v.getId(state), getSolutionVector(), pos[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
state->copyFromBaseVector(v.getId(state), getSolutionVector(), pos[0]);
state->copyFromBaseVector(v.getId(state), getRHSVector(), pos[0]);

}
}
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading