"calm function" inside source code
Bug #1026073 reported by
Christian Jakob
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Yade |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
Hi,
I need a "calm function" for my generation process. In python code it looks like this:
def calm():
for b in O.bodies:
if isinstance(
b.state.vel = Vector3(0,0,0)
b.state.angVel = Vector3(0,0,0)
b.state.angMom = Vector3(0,0,0)
I detected, that it is very slow in the case it is called by PyRunner for e.g. every 2 steps.
O.engines=
Would it be faster, when it is implemented inside C++ source code?
If yes, where can I implement it (which file)?
Regards,
Christian
To post a comment you must log in.
Hi,
pkg/dem/Shop.cpp should probably be the right place. getSpheresMass" [1] and [2]
As an example, you can have a look, how "Shop::
was implemented, it can be also useful to keep "mask" parameter for more
flexibility.
Do not forget to add a python-wrapper for this function into
py/_utils.cpp [3] and [4].
Have a luck!
Anton
[1] https:/ /github. com/yade/ trunk/blob/ master/ pkg/dem/ Shop.hpp# L59 /github. com/yade/ trunk/blob/ master/ pkg/dem/ Shop.cpp# L295 /github. com/yade/ trunk/blob/ master/ py/_utils. cpp#L404 /github. com/yade/ trunk/blob/ master/ py/_utils. cpp#L456
[2] https:/
[3] https:/
[4] https:/