- This topic has 1 reply, 1 voice, and was last updated 5 years, 4 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › [SOLVED] Evaluate forces whitout using visitors
Tagged: 64_bits, Linux_ubuntu, SOFA_1812
Hi,
I’m using HookeForceField from the Flexible plugin. Here is the minimal code of my python scene :
# rootNode/MecaNode/behavior/E
E.createObject('MechanicalObject', template='E331')
E.createObject('GreenStrainMapping', template='F331,E331')
E.createObject('HookeForceField', template='E331')
(MecaNode contains the dofs and shape functions, behavior contains the integration parameters. They are all linked by mappings)
If I understood correctly, at each time step, the mechanical visitor browse all force fields of the scene, and in my case, calls the ForceField::addForce method, which calls the BaseMaterialForceFieldT::addForce.
My problem is that I don’t want to call the latter BaseMaterialForceFieldT::addForce. I would like to call the one defined in the component, for example HookeForceField::addForce in my scene.
I believe it is possible given the comment line 78 but I don’t know how to tell the visitor to continue and call the child addForce method instead of the BaseMaterialForceField one.
My final purpose is to implement another material law and I need to override this method. Any help would be appreciated.
Thanks,
Gaetan
As complementary, you can check this git repository. I ran in debug mode with breakpoints and as you can see on the screenshot, the addForce called is not the one I would like to.
Moreover, I get the warning
RTTI symbol not found for class
which I found is qt specific but I’m not sure to understand this error.
Best,
Gaetan
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.