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 @@ -27,6 +27,7 @@
#include <sofa/helper/AdvancedTimer.h>
#include <sofa/helper/ScopedAdvancedTimer.h>
#include <sofa/simulation/mechanicalvisitor/MechanicalGetNonDiagonalMassesCountVisitor.h>
#include <sofa/simulation/mechanicalvisitor/MechanicalVOpVisitor.h>

using sofa::simulation::mechanicalvisitor::MechanicalGetNonDiagonalMassesCountVisitor;

Expand All @@ -46,8 +47,13 @@ void AccelerationBasedImplicitIntegrationScheme::doSetupIntegrationStep(const co

// This is only there for lagrangian based simulation, to make sure we start using the real pose
// instead of the free pos (same for velocity)
m_vop->v_eq(m_vResult, core::vec_id::write_access::velocity);
m_vop->v_eq(m_xResult, core::vec_id::write_access::position);
simulation::mechanicalvisitor::MechanicalVOpVisitor copyPoseInFreePose(params, m_xResult, core::vec_id::write_access::position);
simulation::mechanicalvisitor::MechanicalVOpVisitor copyVelInFreeVel(params, m_vResult, core::vec_id::write_access::velocity);
copyVelInFreeVel.setMapped(true);
copyPoseInFreePose.setMapped(true);
this->getContext()->executeVisitor(&copyPoseInFreePose);
this->getContext()->executeVisitor(&copyVelInFreeVel);


// Deal with higher order integration scheme
const Size order = getIntegrationSchemeTimeOrder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <sofa/helper/ScopedAdvancedTimer.h>
#include <sofa/simulation/mechanicalvisitor/MechanicalGetNonDiagonalMassesCountVisitor.h>
using sofa::simulation::mechanicalvisitor::MechanicalGetNonDiagonalMassesCountVisitor;
#include <sofa/simulation/mechanicalvisitor/MechanicalVOpVisitor.h>

namespace sofa::simulation::integrationscheme
{
Expand Down Expand Up @@ -65,9 +66,12 @@ void VelocityBasedImplicitIntegrationScheme::doSetupIntegrationStep(const core::

// This is only there for lagrangian based simulation, to make sure we start using the real pose
// instead of the free pos (same for velocity)

m_vop->v_eq(m_vResult, core::vec_id::write_access::velocity);
m_vop->v_eq(m_xResult, core::vec_id::write_access::position);
simulation::mechanicalvisitor::MechanicalVOpVisitor copyPoseInFreePose(params, m_xResult, core::vec_id::write_access::position);
simulation::mechanicalvisitor::MechanicalVOpVisitor copyVelInFreeVel(params, m_vResult, core::vec_id::write_access::velocity);
copyVelInFreeVel.setMapped(true);
copyPoseInFreePose.setMapped(true);
this->getContext()->executeVisitor(&copyPoseInFreePose);

@fredroy fredroy Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

m_vop->v_eq was filtering on the eventual tags apparently, with this->getContext()->executeVisitor the tag filtering is lost. But I dont know it we still really support the tagging system.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The tagging system might be important for some diffusion scenes. Tje v_eq was added by me in my IntegrationScheme PR so I didn't make the use of v_eq because of the tag filtering. In other words, if we don't see any changes in the tests, there is no willingness to keep filtering here.

this->getContext()->executeVisitor(&copyVelInFreeVel);

// Deal with higher order integration scheme
const Size order = getIntegrationSchemeTimeOrder();
Expand Down
Loading