remove clump

Asked by Fereshteh Salehi

Hello,I am beginner in Yade, I have a series of particles and I use clumpTemplate for make clumps,and at the end of code , I want to remove the clumps and have the particles with the same properties as before.Please help me,thank you.

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

Please see the example below, where the key is to apply O.bodies.erase to the clump body (its id) itself:

def interrogate(b):
    '''Handy test function'''
    print('is body',b.id,'part of a clump ?',b.isClumpMember,not b.isStandalone,'(of clump with id',b.clumpId,'if yes)')

for z in [0,2]: O.bodies.append(sphere((0,0,z),1))
clumpId = O.bodies.clump([0,1]) # creating the clump
print('\nInitially:')
interrogate(O.bodies[0])

O.bodies.erase(clumpId) # removing the clump

print('\nAfter clump erasing:')
interrogate(O.bodies[0])

Can you help with this problem?

Provide an answer of your own, or ask Fereshteh Salehi for more information if necessary.

To post a message you must log in.