sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
934 stars 312 forks source link

Investigate the use of non-mechanical mappings if applyJ/applyJT are called #3473

Open hugtalbot opened 2 years ago

hugtalbot commented 2 years ago

To be further discussed with @epernod @fredroy Question arose from the code: https://github.com/sofa-framework/BeamAdapter/blob/master/src/BeamAdapter/component/mapping/AdaptiveBeamMapping.h

damienmarchal commented 2 years ago

What's the point here ?

hugtalbot commented 2 years ago

Fact is that @fredroy noticed in the BeamAdapter that a mapping being defined as non-mechanical got still recurrent calls to applyJT() while it should not be required

hugtalbot commented 2 years ago

Moreover, this looks strange : https://github.com/sofa-framework/sofa/blob/471a3df6a377f92155f34ab4a75e931ec9559f7f/Sofa/framework/Core/src/sofa/core/BaseMapping.cpp#L37-L38

hugtalbot commented 2 years ago

@fredroy could you try to add :

    Inherit::init();

to call Mapping init() which include the function testMechanicalState() checking the isMechanical property.