Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Answered = Solved Fu zuoguang confirmed that the question is solved: Thanks Jan Stránský, that solved my question. -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Fu zuoguang gave more information on the question: Dear Jan Stránsky : Thanks for helping me last time, now my work goes ahead and has some other prombles of course, which are as follow: (1). I can successfully use the order O.run(),O.wait() for a correct inheriting. (2). I can successfully use the orders you suggested me last time for getting the results of particles after the simulation is over, which can show as follows: f = open(-txt,'w') for b in O.bodies: pos = b.state.pos dspl = b.state.displ() r = b.shape.radius f.write('%d %g %g %g %g %g %g %g'%(b.id,pos[0],pos[1],pos[2],r,dspl[0],dspl[1],dspl[2])) f.close() But it is not appropriate for me to borrow them directly for the reason that I should do this operation only for particles in Bodies which may include three types of classes-sphere, wall, box. So,I need to pick all spheres out from bodies before using the orders above. For this purpose, I have created a simple script for testing it, which is as follow: O.bodies.append([ utils.sphere(center=(0,0,0),radius=.5,fixed=True,color=[0,1,0]), utils.sphere((0,0,2),.5,color=[0,1,0]) ]) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_L3Geom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_L3Geom_FrictPhys_ElPerfPl()] ), GravityEngine(gravity=(0,0,-9.81)), NewtonIntegrator(damping=0.1) ] O.dt=.5e-3*utils.PWaveTimeStep() O.saveTmp() O.run(2,True) f = open('result.txt','w') for b in O.bodies: if isinstance(b.state,Sphere): pos = b.state.pos dspl = b.state.displ() f.write('%d %g %g %g %g %g %g'%(b.id,pos[0],pos[1],pos[2],dspl[0],dspl[1],dspl[2])) f.close() The 'result.txt' can record nothing without being warned any error after the simulation is finished and I modify this script as that(deleting the command 'if isinstance(b.state,Sphere):'): O.bodies.append([ utils.sphere(center=(0,0,0),radius=.5,fixed=True,color=[0,1,0]), utils.sphere((0,0,2),.5,color=[0,1,0]) ]) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_L3Geom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_L3Geom_FrictPhys_ElPerfPl()] ), GravityEngine(gravity=(0,0,-9.81)), NewtonIntegrator(damping=0.1) ] O.dt=.5e-3*utils.PWaveTimeStep() O.saveTmp() O.run(2,True) f = open('result.txt','w') for b in O.bodies: pos = b.state.pos dspl = b.state.displ() f.write('%d %g %g %g %g %g %g'%(b.id,pos[0],pos[1],pos[2],dspl[0],dspl[1],dspl[2])) f.close() I get a correct running. I don not understand why? SEEKING YOUR HELP! -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Open = Answered Jan Stránský proposed the following answer: Hello, the only missprint is that you shoud test b.shape, not b.state, i.e. if isinstance(b.shape,Sphere): # ... cheers Jan 2013/4/7 Fu zuoguang question224...@answers.launchpad.net Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Fu zuoguang gave more information on the question: Dear Jan Stránsky : Thanks for helping me last time, now my work goes ahead and has some other prombles of course, which are as follow: (1). I can successfully use the order O.run(),O.wait() for a correct inheriting. (2). I can successfully use the orders you suggested me last time for getting the results of particles after the simulation is over, which can show as follows: f = open(-txt,'w') for b in O.bodies: pos = b.state.pos dspl = b.state.displ() r = b.shape.radius f.write('%d %g %g %g %g %g %g %g'%(b.id ,pos[0],pos[1],pos[2],r,dspl[0],dspl[1],dspl[2])) f.close() But it is not appropriate for me to borrow them directly for the reason that I should do this operation only for particles in Bodies which may include three types of classes-sphere, wall, box. So,I need to pick all spheres out from bodies before using the orders above. For this purpose, I have created a simple script for testing it, which is as follow: O.bodies.append([ utils.sphere(center=(0,0,0),radius=.5,fixed=True,color=[0,1,0]), utils.sphere((0,0,2),.5,color=[0,1,0]) ]) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_L3Geom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_L3Geom_FrictPhys_ElPerfPl()] ), GravityEngine(gravity=(0,0,-9.81)), NewtonIntegrator(damping=0.1) ] O.dt=.5e-3*utils.PWaveTimeStep() O.saveTmp() O.run(2,True) f = open('result.txt','w') for b in O.bodies: if isinstance(b.state,Sphere): pos = b.state.pos dspl = b.state.displ() f.write('%d %g %g %g %g %g %g'%(b.id ,pos[0],pos[1],pos[2],dspl[0],dspl[1],dspl[2])) f.close() The 'result.txt' can record nothing without being warned any error after the simulation is finished and I modify this script as that(deleting the command 'if isinstance(b.state,Sphere):'): O.bodies.append([ utils.sphere(center=(0,0,0),radius=.5,fixed=True,color=[0,1,0]), utils.sphere((0,0,2),.5,color=[0,1,0]) ]) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_L3Geom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_L3Geom_FrictPhys_ElPerfPl()] ), GravityEngine(gravity=(0,0,-9.81)), NewtonIntegrator(damping=0.1) ] O.dt=.5e-3*utils.PWaveTimeStep() O.saveTmp() O.run(2,True) f = open('result.txt','w') for b in O.bodies: pos = b.state.pos dspl = b.state.displ() f.write('%d %g %g %g %g %g %g'%(b.id ,pos[0],pos[1],pos[2],dspl[0],dspl[1],dspl[2])) f.close() I get a correct running. I don not understand why? SEEKING YOUR HELP! -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Answered = Open Fu zuoguang is still having a problem: Dear Jan Stránsky : The version of Yade I use now is 0.80, and there is 'sigma_iso=1.25e5' in my script, please use it for another testing. Thanks very much! -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Open = Answered Jan Stránský proposed the following answer: Hello, thanks for providing the script. Unfortunately I am not able to run the script, because ThreeDTriaxialEngine has no parameter 'sigma_iso'. What version of Yade are you using? (1).The python shell provide me an error warning that can be expressed as that: terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::exception_detail::error_info_injectorboost::lock_error ' what(): boost::lock_error Aborted (core dumped) But I divide this script into two parts in order to inheriting initial state to the second-step simulation and the second part of this script starts with O.loadTmp('qw'). It's worth mentioning that I copy all the details of the second script and paste them to YADE shell instead of making them be read by YADE shell directly. So it can work well. I do not know why this phenomenon appear. I am not sure, but the first command O.run() of your script can be the source of the problem. Try to use O.run(); O.wait() (2).I need to do post-processing with third-party software after the simulation task is over. So it is essential for me to record all the variables I want to get in a independent txt, of which the framework is like(I want to get the displacement field of specimen): particles' id X-cord Y-cord X-cord radius disp-1 disp-2 disp-3 I failed to find any example for disp getting, please tell me how to write the py script for this purpose. This is very easy task: f = open(fileName,'w') for b in O.bodies: pos = b.state.pos # https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State.pos dspl = b.state.displ() # https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State.displ r = b.shape.radius # https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Sphere.radius f.write('%d %g %g %g %g %g %g %g'%(b.id ,pos[0],pos[1],pos[2],r,dspl[0],dspl[1],dspl[2])) f.close() (3).The color of particles is randomly assigned in the process of particles generation accord to my script and I can hardly distinguish the statement of particles after simulation stopped. So I intend to define theirs color in special needs and the first step of this work is to define appropriate partition of specimen. Is this can be achieved in YADE and how can I do to accomplish it? It is also very easy :-) for b in O.bodies: pos = b.state.pos if pos[0] 3 and pos[1] 3: b.shape.color = (1,0,0) elif pos[0] 3 and pos[1] =3: b.shape.color = (0,1,0) # ... else: b.shape.pos = (1,1,0) cheers Jan -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Answered = Open Fu zuoguang is still having a problem: Dear Jan Stránsky : Thanks for helping me yesterday, now I can understand the suggestions you gave me, now I have other problems to seek your help, which are as follow: (1). I can use the order global to finish defining the variables(such as unb,meanS ) in ### functions defination ###. (2). I have borrowed O.cell.setBox(7,7,7) in my script before generating particles, but unfortunately it does not have some effect. (3). After initial state determination, I need to achive the second step of my 2D simulation, but firstly I should to inherit the initial state to high-level calculation. So, I make the first attempt at Saving the result in a Tmp and read it before the next simulation. The script is like that: O.dt = 2e-4 O.run() O.saveTmp('init') O.loadTmp('init') triax01=ThreeDTriaxialEngine( wall_bottom_id=wallIds[2],wall_top_id=wallIds[3], wall_left_id=wallIds[0],wall_right_id=wallIds[1], wall_back_id=wallIds[4],wall_front_id=wallIds[5], wall_front_activated = False,wall_back_activated = False, internalCompaction=False, stressControl_1 = True, stressControl_2 = False,stressControl_3 = True, computeStressStrainInterval =10, sigma_iso = 1.25e5, # sigma1 = 1.25e5, # sigma2 = 1.25e5, # sigma3 = 1.25e5, strainRate1 = 0.00,strainRate2 = -0.06, ) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Wall_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()], [Ip2_ViscElMat_ViscElMat_ViscElPhys()], [Law2_ScGeom_ViscElPhys_Basic()] ), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax01, NewtonIntegrator(damping=.2), PyRunner(command='checkUnbalanced()',iterPeriod=200) ] # calculation steps defination O.dt = 2e-4 But the shell says that checkUnbalanced() has not been defined. I make sure that I have defined it at the beginning of this script and I do not know why it does not work here. Please tell me what my fault is and how to make a right inheritance. Seeking your help! -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Answered = Open Fu zuoguang is still having a problem: Dear Jan Stránsky : I am sorry for not giving all details of my script for you, so all the incorrect scripts are as folllw: ### fundamental details of application ### # filename: initial-state.py # unicode: UTF-8 from yade import pack,qt,plot ### prescribing variables ### # material defination spheremat = O.materials.append(ViscElMat(kn=4e6,ks=4e6,cn=.0,cs=.0,density=1500,frictionAngle=25.565)) wallmat = O.materials.append(ViscElMat(kn=1e8,ks=1e8,cn=.0,cs=.0,density=2600,frictionAngle=25.565)) # wallIds defination mn,mx=Vector3(0,0,0),Vector3(7,7,1) wallIds=O.bodies.append(utils.aabbWalls([mn,mx],thickness=.01,material=wallmat)) # ThreeDTriaxialEngine defination triax=ThreeDTriaxialEngine( wall_bottom_id=wallIds[2],wall_top_id=wallIds[3], wall_left_id=wallIds[0],wall_right_id=wallIds[1], wall_back_id=wallIds[4],wall_front_id=wallIds[5], wall_front_activated = False,wall_back_activated = False, internalCompaction=False, stressControl_1 = True, stressControl_2 = True,stressControl_3 = True, computeStressStrainInterval =10, sigma_iso = 1.25e5, sigma1 = 1.25e5, sigma2 = 1.25e5, sigma3 = 1.25e5, strainRate1 = 0.01,strainRate2 = 0.01, ) # Simulation controller defination unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2 q=unb r=abs(meanS-triax.sigma_iso)/triax.sigma_iso ### functions defination ### def checkUnbalanced(): unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2 q=unb r=abs(meanS-triax.sigma_iso)/triax.sigma_iso if q0.01 and r1e-5: O.pause() O.loadTmp('qw') ### control flow ### # particles generation O.periodic=1 O.cell.setBox(7,7,7) sp=pack.SpherePack() sp.makeCloud((0,0,.5),(7,7,.5),rMean=-1,rRelFuzz=0,num=800,periodic=True) sp.toSimulation(material=spheremat) O.periodic=0 # blockedDOFs for b in O.bodies: if isinstance(b.shape,Sphere): b.state.blockedDOFs='zXY' # Simulation defination O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Wall_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()], [Ip2_ViscElMat_ViscElMat_ViscElPhys()], [Law2_ScGeom_ViscElPhys_Basic()] ), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, NewtonIntegrator(damping=.1), PyRunner(command='checkUnbalanced()',iterPeriod=200) ] # calculation steps defination O.dt = 2e-4 O.run() # O.loadTmp('qw') triax01=ThreeDTriaxialEngine( wall_bottom_id=wallIds[2],wall_top_id=wallIds[3], wall_left_id=wallIds[0],wall_right_id=wallIds[1], wall_back_id=wallIds[4],wall_front_id=wallIds[5], wall_front_activated = False,wall_back_activated = False, internalCompaction=False, stressControl_1 = True, stressControl_2 = False,stressControl_3 = True, computeStressStrainInterval =10, sigma_iso = 1.25e5, sigma1 = 1.25e5, sigma2 = 1.25e5, # sigma3 = 1.25e5, strainRate1 = 0.001,strainRate2 = 0.15, ) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Wall_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()], [Ip2_ViscElMat_ViscElMat_ViscElPhys()], [Law2_ScGeom_ViscElPhys_Basic()] ), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax01, NewtonIntegrator(damping=.1), ] # calculation steps defination O.dt = 2e-4 O.run(1,True) (1).The python shell provide me an error warning that can be expressed as that: terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::exception_detail::error_info_injectorboost::lock_error ' what(): boost::lock_error Aborted (core dumped) But I divide this script into two parts in order to inheriting initial state to the second-step simulation and the second part of this script starts with O.loadTmp('qw'). It's worth mentioning that I copy all the details of the second script and paste them to YADE shell instead of making them be read by YADE shell directly. So it can work well. I do not know why this phenomenon appear. (2).I need to do post-processing with third-party software after the simulation task is over. So it is essential for me to record all the variables I want to get in a
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Fu zuoguang gave more information on the question: Dear Jan Stránsky and Bruno Chareyre: Thanks for helping me last time, now I can successfully achieve the initial state determination in my 2D Simulation with this script: ### fundamental details of application ### # filename: initial-state.py # unicode: UTF-8 from yade import pack,qt,plot ### prescribing variables ### # material defination spheremat = O.materials.append(ViscElMat(kn=4e5,ks=4e5,cn=.0,cs=.0,density=1500,frictionAngle=25.565)) wallmat = O.materials.append(ViscElMat(kn=1e8,ks=1e8,cn=.0,cs=.0,density=2600,frictionAngle=25.565)) # wallIds defination mn,mx=Vector3(0,0,0),Vector3(7,7,1) wallIds=O.bodies.append(utils.aabbWalls([mn,mx],thickness=.01,material=wallmat)) # ThreeDTriaxialEngine defination triax=ThreeDTriaxialEngine( wall_bottom_id=wallIds[2],wall_top_id=wallIds[3], wall_left_id=wallIds[0],wall_right_id=wallIds[1], wall_back_id=wallIds[4],wall_front_id=wallIds[5], wall_front_activated = False,wall_back_activated = False, internalCompaction=False, stressControl_1 = True, stressControl_2 = True,stressControl_3 = True, computeStressStrainInterval =10, sigma_iso = 1.25e5, sigma1 = 1.25e5, sigma2 = 1.25e5, sigma3 = 1.25e5, strainRate1 = .02,strainRate2 = .02, ) # Simulation controller defination unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2 ### functions defination ### def checkUnbalanced(): unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2 q=unb r=abs(meanS-triax.sigma_iso)/triax.sigma_iso if q0.01 and r1e-5: O.pause() ### control flow ### # particles generation O.periodic=1 O.cell.setBox(7,7,1) sp=pack.SpherePack() sp.makeCloud((0,0,.5),(7,7,.5),rMean=.145,rRelFuzz=0,num=300,periodic=True) sp.toSimulation(material=spheremat) O.periodic=0 # blockedDOFs for b in O.bodies: if isinstance(b.shape,Sphere): b.state.blockedDOFs='zXY' # Simulation defination O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Wall_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()], [Ip2_ViscElMat_ViscElMat_ViscElPhys()], [Law2_ScGeom_ViscElPhys_Basic()] ), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, NewtonIntegrator(damping=.2), PyRunner(command='checkUnbalanced()',iterPeriod=200) ] # calculation steps defination O.dt = 2e-4 O.run() ### ends ### It is a great step in my process of studying YADE, but now I still have two questions to ask, which are as follow: (1). I have made a little changes in### functions defination ###as that I move unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2 q=unb r=abs(meanS-triax.sigma_iso)/triax.sigma_iso from### functions defination ### to # Simulation controller defination and the script transform into # Simulation controller defination unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2 q=unb r=abs(meanS-triax.sigma_iso)/triax.sigma_iso ### functions defination ### def checkUnbalanced(): if q0.01 and r1e-5: O.pause(). The simulation can not auto-pause when it obtains the check condition. I don not know why and seek your help! (2).I have borrowed the method of particles generation Professor Bruno Chareyre last time gave me, which is that: O.periodic=1 O.cell.setBox(7,7,1) sp=pack.SpherePack() sp.makeCloud((0,0,.5),(7,7,.5),rMean=-1,RelFuzz=0,num=300,periodic=True) O.bodies.append([utils.sphere(s[0],s[1]) for s in sp]) after using it for calculation, the shell bring me the error warning: FATAL /build/buildd/yade-0.80.1/pkg/common/InsertionSortCollider.cpp:459 spatialOverlapPeri: Body #1 spans over half of the cell size 1 (axis=1, min=-1.75, max=-1.25, span=0.5, see flag allowBiggerThanPeriod) FATAL /build/buildd/yade-0.80.1/core/ThreadRunner.cpp:31 run: Exception occured: /build/buildd/yade-0.80.1/pkg/common/InsertionSortCollider.cpp: Body larger than half of the cell size encountered. I don not know why and seek your help! -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Open = Answered Jan Stránský proposed the following answer: Hi, # Simulation controller defination unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2 q=unb r=abs(meanS-triax.sigma_iso)/triax.sigma_iso ### functions defination ### def checkUnbalanced(): if q0.01 and r1e-5: O.pause(). Let me explain what is hapening in your script. Firstly, before the simulation starts, you compute unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2 q=unb r=abs(meanS-triax.sigma_iso)/triax.sigma_iso after this, you define checkUnbalance function def checkUnbalanced(): if q0.01 and r1e-5: O.pause() It runs each 200 iterations, but actually do nothing. Both q and r variables are unchanged values computed in the beginning of the script. Because they have original values (are not changed), your condition if q0.01 and r1e-5 is never fulfilled and O.pause() is never executed. To make it work, you need to do the same as in the original version, i.e.: def checkUnbalanced(): unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax. stress(triax.wall_top_id)[1])/2 q=unb r=abs(meanS-triax.sigma_iso)/triax.sigma_iso if q0.01 and r1e-5: O.pause() (2).I have borrowed the method of particles generation Professor Bruno Chareyre last time gave me, which is that: O.periodic=1 O.cell.setBox(7,7,1) sp=pack.SpherePack() sp.makeCloud((0,0,.5),(7,7,.5),rMean=-1,RelFuzz=0,num=300,periodic=True) O.bodies.append([utils.sphere(s[0],s[1]) for s in sp]) The problem is exactly what the error says: some of your bodies has dimension larger than period of your periodic cell. You can get the maximum dimension of bodies with: print max([b.shape.radius for b in O.bodies]) # [ ] pais might be omitted, but just now I can't try it, so use version with braces. Probably it will be 1.0, so it is larger than the least dimension of periodic cell (1.0 in your case). Fortunately, this dimension dos not play any role in your simulaion, so you can enlarge it as you want to solve you problem, just set the dimension as cube: O.cell.setBox(7,7,7) Please try these suggestions and let us know what are the results :-) cheers Jan -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Answered = Open Fu zuoguang is still having a problem: Dear Jan Stránský: Thanks for helping me last time, now I can successfully use the order O.cell.setBox to modify the periodic cell, in which then to generate the particles. Now, I also have anthor two questions to ask for your help in the process of my 2D simulation. (1) I want that the porosity of particles is as small as possible, in general,I want to get a dense particle-generation. How can I do? (2) I want to load constant stress on the facets of the box. What is the operational process and which exam can I reference? Seeking your help? -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Fu zuoguang gave more information on the question: Dear Jan Stránský: now I have a visualization problem in 2D simulation and I send an e email to you with a document. Seeking your help! -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Open = Answered Jan Stránský proposed the following answer: Hello, please ask questions here (not only to one person), so that other poeple can help you and the answers can be useful also to other people. if you do O.periodic=1 from yade import pack sp=pack.SpherePack() sp.makeCloud((0,0,0.5),(3,3,0.5),-1,.4,200,periodic=True) sp.toSimulation() you get overlaping particles, because the packing is created in an independent periodic cell of defined size (3,3,0), but actual periodic cell in the main simulation (O.cell) has unmodified default size (1,1,1). To obtain desired behavior, you have to set new size to the periodic cell according to the dimensions of creating (third dimensions does not matter, but it should not be zero): O.cell.setBox(3,3,1) # [1] The overalps were therefore not only visualization, but it would affect actual simulation. To your second question, it is possible to specify both particle size and desired number of generated particles, just see makeCloud documentation [2] cheers Jan [1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Cell.setBox [2] https://yade-dem.org/doc/yade.pack.html#yade._packSpheres.SpherePack.makeCloud 2013/3/20 Fu zuoguang question224...@answers.launchpad.net Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Fu zuoguang gave more information on the question: Dear Jan Stránský: now I have a visualization problem in 2D simulation and I send an e email to you with a document. Seeking your help! -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Answered = Open Fu zuoguang is still having a problem: At 2013-03-18 16:56:04,Bruno Chareyre question224...@answers.launchpad.net wrote: Your question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Open = Answered Bruno Chareyre proposed the following answer: The answers to your questions are in my previous post. -- If this answers your question, please go to the following page to let us know that it is solved: https://answers.launchpad.net/yade/+question/224128/+confirm?answer_id=5 If you still need help, you can reply to this email or go to the following page to enter your feedback: https://answers.launchpad.net/yade/+question/224128 You received this question notification because you asked the question. -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Open = Answered Bruno Chareyre proposed the following answer: The answers to your questions are in my previous post. -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Answered = Open Fu zuoguang is still having a problem: Dear Jan Stránský: Thanks for helping me yesterday, now I am starting to Complete this case, as the first step I intend to modify the example of Bouncing sphere and I have changed nothing but the O.bodies.append([...]). The script is as follow: O.bodies.append([ utils.sphere(center=(0,0,0),radius=.5,fixed=True), utils.sphere((0,2,0),.5) ]) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_L3Geom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_L3Geom_FrictPhys_ElPerfPl()] ), GravityEngine(gravity=(0,-9.81,0)), NewtonIntegrator(damping=0.1) ] O.dt=.25e-4*utils.PWaveTimeStep() Changing the Z-axis to zero is used to simulate the 2D disks. But I failed, and the reason for this is that there is nothing different from the initial script. There are no 2D disks but the 3D spheres appearing. My question is, of course, how to correct this script? seeking your help! -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Open = Answered Jan Stránský proposed the following answer: Hello, there are no 2d discs in Yade, but you can do fake 2d simulation with discs by using spheres and blocking some (out of plane) degrees of freedom [1]: for b in O.bodies: b.state.blockedDOFs = 'zXY' # to make 2d simulation in xy plane, z displacement and rotations arounx x and y axes are blocked cheers Jan [1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State.blockedDOFs 2013/3/14 Fu zuoguang question224...@answers.launchpad.net Question #224128 on Yade changed: https://answers.launchpad.net/yade/+question/224128 Status: Answered = Open Fu zuoguang is still having a problem: Dear Jan Stránský: Thanks for helping me yesterday, now I am starting to Complete this case, as the first step I intend to modify the example of Bouncing sphere and I have changed nothing but the O.bodies.append([...]). The script is as follow: O.bodies.append([ utils.sphere(center=(0,0,0),radius=.5,fixed=True), utils.sphere((0,2,0),.5) ]) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_L3Geom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_L3Geom_FrictPhys_ElPerfPl()] ), GravityEngine(gravity=(0,-9.81,0)), NewtonIntegrator(damping=0.1) ] O.dt=.25e-4*utils.PWaveTimeStep() Changing the Z-axis to zero is used to simulate the 2D disks. But I failed, and the reason for this is that there is nothing different from the initial script. There are no 2D disks but the 3D spheres appearing. My question is, of course, how to correct this script? seeking your help! -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp