← Back to team overview

yade-users team mailing list archive

Re: [Question #699375]: Problems with manipulation force container after erasing some bodies

 

Question #699375 on Yade changed:
https://answers.launchpad.net/yade/+question/699375

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

what is the reason to call O.forces.reset() manually?
What is the result of O.forces.reset(resetAll=false)?
What if you call it after O.step()?

In the c++ source, resetAll=false by default [1] and also this way used by ForceResetter [2].
However, resetAll=True is used in Python [3].
The problem probably is in "resetAll=true" if-branch [4,5,6], trying to reset _permForce container, but probably it is not properly resized.

Concerning segmentation fault, you would get more info using catchsegv.
What is the output of "catchsegv yade script.py"? ("yade" replaced by actual version and "script.py" by actual script name)

> a problem with manipulation of force container after I erase some
bodies from simulation.

what are other "manipulations"?

> However, I don't understand this behavior. How should it be properly
handled?

It should be properly handled such that the source code is fixed for the cases you need :-)
The reason of current behavior is that nobody used it / needed it this way so far, so the inconsistencies and mistakes remained hidden.

Feel free to open an issue on gitlab if you find current state not OK.

Cheers
Jan

[1] https://gitlab.com/yade-dev/trunk/-/blob/master/core/ForceContainer.hpp#L130
[2] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/common/ForceResetter.hpp#L13
[3] https://gitlab.com/yade-dev/trunk/-/blob/master/py/wrapper/yadeWrapper.cpp#L1699
[4] https://gitlab.com/yade-dev/trunk/-/blob/master/core/ForceContainerSerial.cpp#L116
[5] https://gitlab.com/yade-dev/trunk/-/blob/master/core/ForceContainerSerial.cpp#L130
[6] https://gitlab.com/yade-dev/trunk/-/blob/master/core/ForceContainerParallel.cpp#L218

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.