← Back to team overview

yade-users team mailing list archive

Re: [Question #230139]: clumps generating randomly in 2D simulation

 

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

    Status: Open => Answered

Christian Jakob proposed the following answer:
to (1): well, maybe include another random parameter for radii ?!

to (2): have a look at releaseFromClump-example.py ... there is a
definition you can use:

def getClumpInfo():
	for b in O.bodies:
		if b.isClump:
			print 'Clump ',b.id,' has following members:'
			keys = b.shape.members.keys()
			for ii in range(0,len(keys)):
				print '- Body ',keys[ii]

Inside the loop you can access information about the clump members by:

O.bodies[keys[ii]].<Info>

e.g. get positions and density:

print O.bodies[keys[ii]].state.pos
print O.bodies[keys[ii]].mat.density

to (3): if clump_ids is a list of clump ids, then you may try:

for ii in clump_ids:
  O.bodies[ii].blockedDOFs='zXY' #for 2D simulation in x-y-plane

OR

for ii in clump_ids:
  O.bodies[ii].blockedDOFs='yXZ' #for 2D simulation in x-z-plane

OR

for ii in clump_ids:
  O.bodies[ii].blockedDOFs='xYZ' #for 2D simulation in y-z-plane

or you loop over all bodies and make something like this:

for b in O.bodies:
  b.blockedDOFs='zXY' #for 2D simulation in x-y-plane

#note: if you have 2D simulation in x-y direction, gravity should act
either in x or in y direction ... ^^

Hope it helps,

Christian

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.