Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HyperelasticForcefield] : Breaking bug that prevent MechanicalObject fields modifications when running in batch mode. #104

Open
AlbanOdot opened this issue Mar 2, 2022 · 3 comments

Comments

@AlbanOdot
Copy link
Contributor

AlbanOdot commented Mar 2, 2022

I just encountered a bug that has been replicated on multiple computers when running the given script using python launcher
In the script, the position is modified on the onAnimatedBeginEvent function call.
We can see two behaviors.

By running :

  • python3 SofaBugCaribou.py

    • You can observe from the print that the mechanical object positions are not updated at all.
    • Mechanical values such as residual are not impacted either, so, it's not only a python/display bug.
    • It doesn't work either using with self.MO.position.writeable() as pos:
  • python3 SofaBugCaribou.py gui

    • The positions are properly modified

Commenting/uncommenting the material/constitutive law reveals that it's the HyperelasticForcefield that causes the problem.

This minimal scene replicates the bug:
BugCaribou.zip

@AlbanOdot AlbanOdot changed the title [HyperelasticForcefield] : Breaking bug that prevent MechanicalObject fields modifications when running in batch mode.. [HyperelasticForcefield] : Breaking bug that prevent MechanicalObject fields modifications when running in batch mode. Mar 2, 2022
@AlbanOdot
Copy link
Contributor Author

So far I've tried to remove the draw function from CaribouForcefield (since it interacts with the gui) but it doesn't affect the result.

@jnbrunet
Copy link
Member

jnbrunet commented Mar 5, 2022

Étrange... The only reference to the MO position vector in these codes are const read only, so it should not affect anything...

I will try to have a closer look. Let me know if you find other hints.

@AlbanOdot
Copy link
Contributor Author

For anyone having the same issue, a quick fix has been provided at Sofa issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants