Introduction
Introduction Statistics Contact Development Disclaimer Help
tadd method to delete a single particle - sphere - GPU-based 3D discrete elemen…
git clone git://src.adamsgaard.dk/sphere
Log
Files
Refs
LICENSE
---
commit 6ac5690868fad9e079fdb44b397f39e35dcbaaa0
parent 58668c68b1fce324d35d1c86991240dabd48591e
Author: Anders Damsgaard <[email protected]>
Date: Fri, 20 Jun 2014 22:44:03 +0200
add method to delete a single particle
Diffstat:
M python/sphere.py | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/python/sphere.py b/python/sphere.py
t@@ -655,6 +655,32 @@ class sim:
self.p = numpy.append(self.p, p)
self.color = numpy.append(self.color, color)
+ def deleteParticle(self, i):
+ '''
+ Delete particle with index ``i``.
+
+ :param i: Particle index to delete
+ :type i: int
+ '''
+
+ self.np = self.np - 1
+
+ self.x = numpy.delete(self.x, i)
+ self.radius = numpy.delete(self.radius, i)
+ self.vel = numpy.delete(self.vel, i, axis=0)
+ self.xysum = numpy.delete(self.xysum, i, axis=0)
+ self.fixvel = numpy.delete(self.fixvel, fixvel)
+ self.force = numpy.delete(self.force, i, axis=0)
+ self.angpos = numpy.delete(self.angpos, i, axis=0)
+ self.angvel = numpy.delete(self.angvel, i, axis=0)
+ self.torque = numpy.delete(self.torque, i, axis=0)
+ self.es_dot = numpy.delete(self.es_dot, i)
+ self.es = numpy.delete(self.es, i)
+ self.ev_dot = numpy.delete(self.ev_dot, i)
+ self.ev = numpy.delete(self.ev, i)
+ self.p = numpy.delete(self.p, i)
+ self.color = numpy.delete(self.color, i)
+
def deleteAllParticles(self):
'''
Deletes all particles in the simulation object.
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.