yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #07794
Re: [Question #230139]: clumps generating randomly in 2D simulation
Question #230139 on Yade changed:
https://answers.launchpad.net/yade/+question/230139
Status: Answered => Open
Fu zuoguang is still having a problem:
Dear Christian Jakob:
Thannks for giving me that perfect advice. Now I have taken a correct running with modified script in which I input some codes about defining the spheres material. So everything looks fine.
But I still have some problems about this update which can be described as that:
(1). In material defination, YADE requires me to assign such parameters for "O.bodies" twice. For the first time, these parameters should be determined when these spheres are generated but not clumps, it just like that:
##############################################################################################
coors1 = [ b[0] - radius , b[1] - radius , 0 ]
coors2 = [ b[0] + radius , b[1] - radius , 0 ]
coors3 = [ b[0] + radius , b[1] + radius , 0 ]
coors4 = [ b[0] - radius , b[1] + radius , 0 ]
spherepara1 = sphere ( coors1 , radius , material=clumpsmat, color = [1,1,1] )
spherepara2 = sphere ( coors2 , radius , material=clumpsmat, color = [1,1,1] )
spherepara3 = sphere ( coors3 , radius , material=clumpsmat, color = [1,1,1] )
spherepara4 = sphere ( coors4 , radius , material=clumpsmat, color = [1,1,1] )
sphere1 = O.bodies.append ( spherepara1 )
sphere2 = O.bodies.append ( spherepara2 )
sphere3 = O.bodies.append ( spherepara3 )
sphere4 = O.bodies.append ( spherepara4 )
################################################################################################
And for the second time, they should be determined when all clumps generating is finished. it just like that:
################################################################################################
def material():
for b in O.bodies:
if b.isClumps:
O.bodies[b].material = O.material[clumpsmat]
################################################################################################
I now understand that the absence of the first time working may cause something wrong in running this simulation and I am not sure that absence of the second time working may cause what. I think there also be something wrong of course.
(2).If they are both necessary for running this simulation. It would
make the script complex because there still exists some repetitive
tasks. What can I do to make the whole script more concise.
(3).I find out that some other attributes of clumps defination is not the same as "material-def", such as DOF condition. I also use these two methods for supplying the DOF condition, one is that:
before the clumps generating, I employ these codes for my purpose:
#################################################################################################
for b in O.bodies:
if isinstance(b.shape,Sphere):
b.state.blockedDOFs='zXY'
#################################################################################################
This is alao doing directly for spheses. But after the clumps generation, these can not work any more when the simulation starts.
And the other is that:
#################################################################################################
def DOF(): # of course, DOF condition only for 2D simulation
for b in O.bodies:
if b.isClump:
b.state.blockedDOFs = 'zXY'
################################################################################################
There is nothing wrong with it when simulation starts.
Why these differences occur? Seeking your help!
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.