yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #12618
[Bug 1570679] Re: Memory leak during updating position of tetrapoly elements
setVertices now works without memory leaks passing each vertex as single
argument
O.bodies[0].shape.setVertices(b[0],b[1],b[2],b[3])
or
O.bodies[0].shape.setVertices(*b) # *b in Python does internally the
above code
currently implemented only for 4 vertices, if needed it is easy to
extend to more vertices
Jan
** Changed in: yade
Status: New => Fix Released
--
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.
https://bugs.launchpad.net/bugs/1570679
Title:
Memory leak during updating position of tetrapoly elements
Status in Yade:
Fix Released
Bug description:
There exists severe memory leaking problem when using intermediate
variables to update positions of tetraPoly in a loop:
running the code, the memory will keep leaking:
#
a = [[0,0,0],[0,0,1],[0,1,0],[1,0,0]]
O.bodies.append(yade.utils.tetraPoly(a))
for i in range(1000000):
b = [[0,0,0],[0,0,1],[0,1,0],[i+2,0,0]]
O.bodies[0].shape.setVertices(b)
O.bodies[0].state.ori = O.bodies[0].shape.GetOri()
O.bodies[0].state.pos = O.bodies[0].shape.GetCentroid()
O.bodies[0].state.mass = O.bodies[0].mat.density * O.bodies[0].shape.GetVolume()
O.bodies[0].state.inertia = O.bodies[0].mat.density * O.bodies[0].shape.GetInertia()
To manage notifications about this bug go to:
https://bugs.launchpad.net/yade/+bug/1570679/+subscriptions
References