← Back to team overview

yade-users team mailing list archive

Re: [Question #701936]: Why do particles intersect?

 

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

    Status: Needs information => Open

孙灿 gave more information on the question:
I'm sorry I didn't express it very well. Some of my related codes are as
follows:

def checkUnbalanced():
	if unbalancedForce() < .02:
		#O.pause()
                for b in O.bodies:
                    if isinstance(b.shape,Sphere):
                        b.state.blockedDOFs='zxy'
                        b.state.vel=(0,0,0)
                        b.state.angVel=(0,0,0)
                        
                    d = (b.state.pos - circleCenter).norm() # distance of circleCenter and center of "b"
                    if d < circleRadius :
                       #for i in range(1,2): 
                           #b.shape.radius=b.shape.radius-0.02
                       O.bodies.erase(b.id)
                    
                       qiyong()
def qiyong():
                           
        O.bodies.append(sphere(center=(0.05,1.5,2.451), radius=.049, fixed=True,color=(1.,1.,1.)))
        O.bodies.append(sphere(center=(0.05,1.5,1.549), radius=.049, fixed=True,color=(1.,1.,1.)))
        O.bodies.append(sphere(center=(0.05,1.049,2), radius=.049, fixed=True,color=(1.,1.,1.)))
        O.bodies.append(sphere(center=(0.05,1.951,2), radius=.049, fixed=True,color=(1.,1.,1.)))
                  
        O.bodies.append(sphere(center=(0.05,1.9423,2.0880), radius=.049, fixed=True,color=(1.,1.,1.)))
        O.bodies.append(sphere(center=(0.05,1.9167,2.1726), radius=.049, fixed=True,color=(1.,1.,1.))) 
        O.bodies.append(sphere(center=(0.05,1.8750,2.2506), radius=.049, fixed=True,color=(1.,1.,1.))) 
        O.bodies.append(sphere(center=(0.05,1.8189,2.3189), radius=.049, fixed=True,color=(1.,1.,1.))) 
        O.bodies.append(sphere(center=(0.05,1.7506,2.3750), radius=.049, fixed=True,color=(1.,1.,1.))) 
        O.bodies.append(sphere(center=(0.05,1.6726,2.4167), radius=.049, fixed=True,color=(1.,1.,1.))) 
        O.bodies.append(sphere(center=(0.05,1.5880,2.4423), radius=.049, fixed=True,color=(1.,1.,1.)))
I use checkUnbalanced() to check the balance of the particles, before this string of code, I have set up some particles (you can call it the first part of the code), qiyong() is the function I use to generate the second part of the particles, in the checkUnbalanced() function, after some conditions are met, qiyong() will be called, which will generate the second part of the particles. But when generating the second part of the particles, some particles will intersect with the first part of the particles and cause the subsequent simulations to not run as I expected, how do I solve it?

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.