Re: [Yade-users] [Question #696198]: Using the Parallel Collider
Question #696198 on Yade changed: https://answers.launchpad.net/yade/+question/696198 Status: Answered => Solved Yuxuan Wang confirmed that the question is solved: Thanks Bruno! That solved my question. -- You received this question notification because your team yade-users 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
[Yade-users] [Question #696198]: Using the Parallel Collider
New question #696198 on Yade: https://answers.launchpad.net/yade/+question/696198 Hi Yade programmers and users, I have been trying to to shorten the run time of my code on a multi-CPU cluster. As I was going through past Q's on the forum, I noticed discussions about the parallel collider that was tested a while ago in [1] . However, I wasn't able to find out clearly the state of the parallel collider after those tests in 2012. My questions are: 1. Has the parallel collider already been pushed into the trunk version? Or is there a separate version of Yade that I need to use the collider? 2. Are there any specific commands to call the collider or would yade -j suffice? Thank you for helping me in advance!! Best, Yuxuan [1]: https://yade-dem.org/wiki/Performance_Test -- You received this question notification because your team yade-users 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 #692420]: Select bodies under post2d.extractor function
Question #692420 on Yade changed: https://answers.launchpad.net/yade/+question/692420 Status: Needs information => Solved Yuxuan Wang confirmed that the question is solved: Thank you so much Jan, I used extractVelocity=lambda b: flattener.normal(b,b.state.vel) if -0.15< b.state.pos[2] <= 0.15 else None and it worked perfectly. Best, Yuxuan -- You received this question notification because your team yade-users 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 #692420]: Select bodies under post2d.extractor function
Question #692420 on Yade changed: https://answers.launchpad.net/yade/+question/692420 Description changed to: Hello yade programmers and fellow users, Hope all is well! I have been trying to mimic the uniax-post.py example to produce a velocity contour plot of a slice of particles in the simulation. Following Jan’s advice in post [1], I tried searching for ways to construct an extractor function to output “2-tuple velocity” for the bodies I want and “None” for the rest. I was only able to think of two ways to attack this being fairly new to python. Both of them did not work out so it would be greatly appreciated if you could offer me some hints!! Below are the two methods I attempted: 1. I tried defining a new extractor function vExtract() that could take the body instance outputs (b) looped by post2d.data() as its own argument. That way I would be able to use the following structure to accomplish my goal. def vExtract(b): if -0.15< b.state.pos[2] <= 0.15:return flattener.normal(b,b.state.vel) else:return None # raw velocity (vector field) plot pylab.figure(); post2d.plot(post2d.data(vExtract(),flattener)) However, this would yield an error due to the fact that vExtract is expecting exactly one argument while I passed zero to post2d.data. If there is a way to write the vExtract() function to use arguments (body b) not specified in its own definitions, but in the higher level post2d.data function it would work. 2. I also looked for ways to modify the extractor extractVelocity() used by the original uniax-post.py. I thought of adding the if-else condition if -0.15< b.state.pos[2] <= 0.15:return flattener.normal(b,b.state.vel) else:return None to the lambda expression “extractVelocity=lambda b: flattener.normal(b,b.state.vel)”, but seems like lambda expressions cannot take conditional statements. Thank you in advance! My Yade version is 2018.02b. [1] https://answers.launchpad.net/yade/+question/404193 -- You received this question notification because your team yade-users 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
[Yade-users] [Question #692420]: Select bodies under post2d.extractor function
New question #692420 on Yade: https://answers.launchpad.net/yade/+question/692420 Hello yade programmers and fellow users, Hope all is well! I have been trying to mimic the uniax-post.py example to produce a velocity contour plot of a slice of particles in the simulation. Following Jan’s advice in post [2], I tried searching for ways to construct an extractor function to output “2-tuple velocity” for the bodies I want and “None” for the rest. I was only able to think of two ways to attack this being fairly new to python. Both of them did not work out so it would be greatly appreciated if you could offer me some hints!! Below are the two methods I attempted: 1. I tried defining a new extractor function vExtract() that could take the body instance outputs (b) looped by post2d.data() as its own argument. That way I would be able to use the following structure to accomplish my goal. def vExtract(b): if -0.15< b.state.pos[2] <= 0.15:return flattener.normal(b,b.state.vel) else:return None # raw velocity (vector field) plot pylab.figure(); post2d.plot(post2d.data(vExtract(),flattener)) However, this would yield an error due to the fact that vExtract is expecting exactly one argument while I passed zero to post2d.data. If there is a way to write the vExtract() function to use arguments (body b) not specified in its own definitions, but in the higher level post2d.data function it would work. 2. I also looked for ways to modify the extractor extractVelocity() used by the original uniax-post.py. I thought of adding the if-else condition if -0.15< b.state.pos[2] <= 0.15:return flattener.normal(b,b.state.vel) else:return None to the lambda expression “extractVelocity=lambda b: flattener.normal(b,b.state.vel)”, but seems like lambda expressions cannot take conditional statements. Thank you in advance! My Yade version is 2018.02b. [1] https://answers.launchpad.net/yade/+question/404193 -- You received this question notification because your team yade-users 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 #691829]: Filterpack predicate definition issue
Question #691829 on Yade changed: https://answers.launchpad.net/yade/+question/691829 Yuxuan Wang posted a new comment: Hi Jan, Thank you again for the much needed help! I avoided the problem by outputting a table with the particles' locations and visualized the particles in a separate script. Sincerely, Yuxuan -- You received this question notification because your team yade-users 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 #691829]: Filterpack predicate definition issue
Question #691829 on Yade changed: https://answers.launchpad.net/yade/+question/691829 Status: Open => Solved Yuxuan Wang confirmed that the question is solved: Thanks Jan Stránský, that solved my question. -- You received this question notification because your team yade-users 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 #691829]: Filterpack predicate definition issue
Question #691829 on Yade changed: https://answers.launchpad.net/yade/+question/691829 Status: Answered => Open Yuxuan Wang is still having a problem: Thanks you so much for the effort, Jan! I wasn't able to even locate the errors but you made it clear now. I'll keep researching for an answer on my end! Best, Yuxuan -- You received this question notification because your team yade-users 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 #691828]: Deactivate triaxial stress controller
Question #691828 on Yade changed: https://answers.launchpad.net/yade/+question/691828 Status: Answered => Solved Yuxuan Wang confirmed that the question is solved: Thanks Jan Stránský, that solved my question. -- You received this question notification because your team yade-users 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 #691829]: Filterpack predicate definition issue
Question #691829 on Yade changed: https://answers.launchpad.net/yade/+question/691829 Status: Answered => Open Yuxuan Wang is still having a problem: Hi Jan, Thank you for the suggestions and they worked quite well for me upon implementation. I saw a significant reduction of particles going from the compressed pack to the filtered pack. There is only one thing that I'm still confused about now: I was not able to see any of the particles after "assembly.toSimulation()" in the simulation view, even though I could output their locations. Would you mind giving me a hand on that again? Thanks again! Best, Yuxuan - #!/usr/bin/python # -*- coding: utf-8 -*- #modifications from trial 10: incorporating Jan's advice on filterpack. from __future__ import print_function import matplotlib; matplotlib.rc('axes',grid=True) import pylab from yade import pack, plot, qt from yade import export ### DEFINING VARIABLES AND MATERIALS ### #geometry definition Ri,Rs,Ro=6.5,8.5,10.5 H=3.5 p=H/2 k=0.01 Hs=H*k hs=Hs/2 Rx=2*Ro Hx=2*H c1=geom.facetCylinder(center=(0,0,p),radius=Ro, height=H, segmentsNumber=20, wallMask=6) c2=geom.facetCylinder(center=(0,0,hs),radius=Rs, height=Hs, segmentsNumber=20, wallMask=7) c3=geom.facetCylinder(center=(0,0,p),radius=Ri, height=H, segmentsNumber=20, wallMask=7) nRead=readParamsFromTable( num_spheres=5000, compFricDegree = 30, unknownOk=True ) from yade.params import table num_spheres=table.num_spheres compFricDegree = table.compFricDegree damp=0.2 young=5e6 # contact stiffness mn,mx=Vector3(-12,-12,-12),Vector3(12,12,12) # corners of the initial packing ## create materials for spheres and plates O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls')) ## create walls around the packing walls=aabbWalls([mn,mx],thickness=0,material='walls') wallIds=O.bodies.append(walls) ## use a SpherePack object to generate a psd loose particles packing global sp sp=pack.SpherePack() sp.makeCloud(mn,mx,num=1000,psdSizes=[0.399,0.4,0.799,0.8],psdCumm=[0,0.5,0.5,1]) sp.toSimulation(material='spheres') ### DEFINING ENGINES ### triax=TriaxialStressController( thickness = 0, stressMask = 7, internalCompaction=False, label='controller' ) newton=NewtonIntegrator(damping=damp) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PyRunner(command='stop()',iterPeriod=1,label='checker'), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, newton ] #Display spheres with 2 colors for seeing rotations better Gl1_Sphere.stripes=0 if nRead==0: yade.qt.Controller(), yade.qt.View() ### ### APPLYING CONFINING PRESSURE ### ### triax.goal1=triax.goal2=triax.goal3=-100 def stop(): if O.iter<100:return else: controller.dead=True for wall in walls: wall.state.vel = Vector3.Zero for b in O.bodies: b.state.vel = Vector3.Zero sp.fromSimulation() # update sp from original loose pack to compressed dense pack checker.command='gravityDeposition()' def gravityDeposition(): if O.iter==101: pred=pack.inCylinder((0,0,0),(0,0,H),Ro)-pack.inCylinder((0,0,0),(0,0,Hs),Rs)-pack.inCylinder((0,0,0),(0,0,H),Ri) assembly=pack.filterSpherePack(pred,sp,True) O.bodies.clear() #delete compressed pack sp print(len(O.bodies)) assembly.toSimulation() print(len(O.bodies)) for b in O.bodies:print(b.id,b.state.pos,b.shape.radius) else: print ('done') O.pause() #...connect to next steps in simulation -- You received this question notification because your team yade-users 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 #691829]: Filterpack predicate definition issue
Question #691829 on Yade changed: https://answers.launchpad.net/yade/+question/691829 Status: Needs information => Open Yuxuan Wang gave more information on the question: Thanks for getting back to me, Jan! When I entered O.pause() in the terminal and called for "pred", the output was as in my original question, "NameError: name 'pred' is not defined". The same issue happened when I called for "assembly". That was why I thought the predicate was not applied. Another thing that led me to that conclusion was this: particles in the compressed pack (sp) outside of the predicate (pred) were not deleted after I applied "filterpack". Now coming to think of it, filterpack probably only selects particles within the predicate region but doesn't delete other particles? However, the fact that you were able to see a reduction in # of bodies means "pred" was recognized by the program. Is that truely the case even though the terminal outputs show they are undefined? Regards, Yuxuan -- You received this question notification because your team yade-users 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 #691828]: Deactivate triaxial stress controller
Question #691828 on Yade changed: https://answers.launchpad.net/yade/+question/691828 Status: Answered => Open Yuxuan Wang is still having a problem: Thanks for the clarification, Chu and Jan! I am still quite new to python and struggled to understand the error message. It's clear now! I hoped to use "triaxialStressEngine.dead" to stop the walls from compressing the particles while O.engines is still running. Now although it returns “true” when I ask for “In [3]: controller.dead” in the terminal, the walls don’t stop compressing. Is it because “triaxialStressEngine.dead” isn’t the way to accomplish it or are there other errors in my code? I have done some slight modifications on “stop()” and “gravityDeposition()” at the end of my code. Really appreciate your help! -Yuxuan #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import matplotlib; matplotlib.rc('axes',grid=True) import pylab from yade import pack, plot, qt from yade import export ### DEFINING VARIABLES AND MATERIALS ### #geometry definition Ri,Rs,Ro=6.5,8.5,10.5 H=3.5 p=H/2 k=0.01 Hs=H*k hs=Hs/2 Rx=2*Ro Hx=2*H c1=geom.facetCylinder(center=(0,0,p),radius=Ro, height=H, segmentsNumber=20, wallMask=6) c2=geom.facetCylinder(center=(0,0,hs),radius=Rs, height=Hs, segmentsNumber=20, wallMask=7) c3=geom.facetCylinder(center=(0,0,p),radius=Ri, height=H, segmentsNumber=20, wallMask=7) nRead=readParamsFromTable( num_spheres=5000, compFricDegree = 30, unknownOk=True ) from yade.params import table num_spheres=table.num_spheres compFricDegree = table.compFricDegree damp=0.2 young=5e6 # contact stiffness mn,mx=Vector3(-50,-50,-50),Vector3(50,50,50) # corners of the initial packing ## create materials for spheres and plates O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls')) ## create walls around the packing walls=aabbWalls([mn,mx],thickness=0,material='walls') wallIds=O.bodies.append(walls) ## use a SpherePack object to generate a psd loose particles packing global sp sp=pack.SpherePack() sp.makeCloud(mn,mx,num=6000,psdSizes=[1,2,2.25,2.5,3,4,6],psdCumm=[0.,0.1,0.3,0.3,.3,.7,1.]) sp.toSimulation(material='spheres') ### DEFINING ENGINES ### triax=TriaxialStressController( thickness = 0, stressMask = 7, internalCompaction=False, label='controller' ) newton=NewtonIntegrator(damping=damp) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PyRunner(command='stop()',iterPeriod=10,label='checker'), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, newton ] #Display spheres with 2 colors for seeing rotations better Gl1_Sphere.stripes=0 if nRead==0: yade.qt.Controller(), yade.qt.View() ### ### APPLYING CONFINING PRESSURE ### ### triax.goal1=triax.goal2=triax.goal3=-1 def stop(): if O.iter<100:return else: controller.dead=True #O.pause() checker.command='gravityDeposition()' def gravityDeposition(): if O.iter<103: pred=pack.inCylinder((0,0,0),(0,0,H),Ro)-pack.inCylinder((0,0,0),(0,0,Hs),Rs)-pack.inCylinder((0,0,0),(0,0,H),Ri) assembly=pack.filterSpherePack(pred,sp,True) assembly.toSimulation() else: print ('done') #O.pause() #...connect to next steps in simulation -- You received this question notification because your team yade-users 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 #691829]: Filterpack predicate definition issue
Question #691829 on Yade changed: https://answers.launchpad.net/yade/+question/691829 Description changed to: Hello Yade programmers and users, I encountered a problem in my recent simulation script which has been troubling me, and it’d be much appreciated if I can get some advice. Here are the steps I’m trying to accomplish: 1. Make a loose pack of particles following defined PSD. 2. Use compression engine to generate a denser pack. 3. At defined iteration #, turn off compression engine. 4. Filter pack with pack.filterpack into desired shape. 5. Continue with further steps (gravity deposition, geometry rotation, etc). Problem: My error came from step 4, in the "gravityDeposition()" portion of my code. When I tried using pack.filterpack with the engine running, the filter was not applied. I then paused O.engines to check if my predicate definition was truly recognized, and it turns out that it wasn’t for some reason. Would anyone be able to help me find the cause of this? Thanks a lot! Error: --- NameError Traceback (most recent call last) /usr/bin/yade in () > 1 pred NameError: name 'pred' is not defined --- Here is my script using yade 2018.02b: - #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import matplotlib; matplotlib.rc('axes',grid=True) import pylab from yade import pack, plot, qt from yade import export ### DEFINING VARIABLES AND MATERIALS ### #geometry definition Ri,Rs,Ro=6.5,8.5,10.5 H=3.5 p=H/2 k=0.01 Hs=H*k hs=Hs/2 Rx=2*Ro Hx=2*H c1=geom.facetCylinder(center=(0,0,p),radius=Ro, height=H, segmentsNumber=20, wallMask=6) c2=geom.facetCylinder(center=(0,0,hs),radius=Rs, height=Hs, segmentsNumber=20, wallMask=7) c3=geom.facetCylinder(center=(0,0,p),radius=Ri, height=H, segmentsNumber=20, wallMask=7) nRead=readParamsFromTable( num_spheres=5000, compFricDegree = 30, unknownOk=True ) from yade.params import table num_spheres=table.num_spheres compFricDegree = table.compFricDegree damp=0.2 young=5e6 # contact stiffness mn,mx=Vector3(-50,-50,-50),Vector3(50,50,50) # corners of the initial packing ## create materials for spheres and plates O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls')) ## create walls around the packing walls=aabbWalls([mn,mx],thickness=0,material='walls') wallIds=O.bodies.append(walls) ## use a SpherePack object to generate a psd loose particles packing global sp sp=pack.SpherePack() sp.makeCloud(mn,mx,num=6000,psdSizes=[1,2,2.25,2.5,3,4,6],psdCumm=[0.,0.1,0.3,0.3,.3,.7,1.]) sp.toSimulation(material='spheres') ### DEFINING ENGINES ### triax=TriaxialStressController( thickness = 0, stressMask = 7, internalCompaction=False, label='controller' ) newton=NewtonIntegrator(damping=damp) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PyRunner(command='stop()',iterPeriod=10,label='checker'), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, newton ] #Display spheres with 2 colors for seeing rotations better Gl1_Sphere.stripes=0 if nRead==0: yade.qt.Controller(), yade.qt.View() ### APPLYING CONFINING PRESSURE ### triax.goal1=triax.goal2=triax.goal3=-1 def stop(): if O.iter<100:return checker.command='gravityDeposition()' def gravityDeposition(): pred=pack.inCylinder((0,0,0),(0,0,H),Ro)-pack.inCylinder((0,0,0),(0,0,Hs),Rs)-pack.inCylinder((0,0,0),(0,0,H),Ri) assembly=pack.filterSpherePack(pred,sp,True) assembly.toSimulation() #...connect to next steps in simulation --- -- You received this question notification because your team yade-users 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 #691829]: Filterpack predicate definition issue
Question #691829 on Yade changed: https://answers.launchpad.net/yade/+question/691829 Summary changed to: Filterpack predicate definition issue -- You received this question notification because your team yade-users 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 #691828]: Deactivate triaxial stress controller
Question #691828 on Yade changed: https://answers.launchpad.net/yade/+question/691828 Description changed to: Hello Yade programmers and users, I encountered a problem in my recent simulation script which has been troubling me, and it’d be much appreciated if I can get some advice. Here are the steps I’m trying to accomplish: 1. Make a loose pack of particles following defined PSD. 2. Use compression engine to generate a denser pack. 3. At defined iteration #, turn off compression engine. 4. Filter pack with pack.filterpack into desired shape. 5. Continue with further steps (gravity deposition, geometry rotation, etc). My question came with step 3. While using “triaxialStressController.dead=True” to turn off the compression engine, I kept getting the following error: --- ---> 97 controller.dead=True, ArgumentError: Python argument types in None.None(TriaxialStressController, tuple) did not match C++ signature: None(Engine {lvalue}, bool) --- Here is my script using yade 2018.02b: #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import matplotlib; matplotlib.rc('axes',grid=True) import pylab from yade import pack, plot, qt from yade import export ### DEFINING VARIABLES AND MATERIALS ### #geometry definition Ri,Rs,Ro=6.5,8.5,10.5 H=3.5 p=H/2 k=0.01 Hs=H*k hs=Hs/2 Rx=2*Ro Hx=2*H c1=geom.facetCylinder(center=(0,0,p),radius=Ro, height=H, segmentsNumber=20, wallMask=6) c2=geom.facetCylinder(center=(0,0,hs),radius=Rs, height=Hs, segmentsNumber=20, wallMask=7) c3=geom.facetCylinder(center=(0,0,p),radius=Ri, height=H, segmentsNumber=20, wallMask=7) nRead=readParamsFromTable( num_spheres=5000, compFricDegree = 30, unknownOk=True ) from yade.params import table num_spheres=table.num_spheres compFricDegree = table.compFricDegree damp=0.2 young=5e6 # contact stiffness mn,mx=Vector3(-50,-50,-50),Vector3(50,50,50) # corners of the initial packing ## create materials for spheres and plates O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls')) ## create walls around the packing walls=aabbWalls([mn,mx],thickness=0,material='walls') wallIds=O.bodies.append(walls) ## use a SpherePack object to generate a psd loose particles packing global sp sp=pack.SpherePack() sp.makeCloud(mn,mx,num=6000,psdSizes=[1,2,2.25,2.5,3,4,6],psdCumm=[0.,0.1,0.3,0.3,.3,.7,1.]) sp.toSimulation(material='spheres') ### DEFINING ENGINES ### triax=TriaxialStressController( thickness = 0, stressMask = 7, internalCompaction=False, label='controller' ) newton=NewtonIntegrator(damping=damp) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PyRunner(command='stop()',iterPeriod=10,label='checker'), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, newton ] #Display spheres with 2 colors for seeing rotations better Gl1_Sphere.stripes=0 if nRead==0: yade.qt.Controller(), yade.qt.View() ### APPLYING CONFINING PRESSURE ### triax.goal1=triax.goal2=triax.goal3=-1 def stop(): if O.iter<100:return controller.dead=True, checker.command='gravityDeposition()' def gravityDeposition(): pred=pack.inCylinder((0,0,0),(0,0,H),Ro)-pack.inCylinder((0,0,0),(0,0,Hs),Rs)-pack.inCylinder((0,0,0),(0,0,H),Ri) assembly=pack.filterSpherePack(pred,sp,True) assembly.toSimulation() #...connect to next steps in simulation --- Thanks for the help in advance! -- You received this question notification because your team yade-users 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
[Yade-users] [Question #691829]: filterpack predicate definition issue
New question #691829 on Yade: https://answers.launchpad.net/yade/+question/691829 Hello Yade programmers and users, I encountered a problem in my recent simulation script which has been troubling me, and it’d be much appreciated if I can get some advice. Here are the steps I’m trying to accomplish: 1. Make a loose pack of particles following defined PSD. 2. Use compression engine to generate a denser pack. 3. At defined iteration #, turn off compression engine. 4. Filter pack with pack.filterpack into desired shape. 5. Continue with further steps (gravity deposition, geometry rotation, etc). Problem: My error came from step 4. When I tried using pack.filterpack with the engine running, but the filter was not applied. I then paused O.engines to check if my predicate definition was truly recognized, and it turns out that it wasn’t for some reason. Would anyone be able to help me find the cause of this? Thanks a lot! Error: --- NameError Traceback (most recent call last) /usr/bin/yade in () > 1 pred NameError: name 'pred' is not defined --- Here is my script using yade 2018.02b: - #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import matplotlib; matplotlib.rc('axes',grid=True) import pylab from yade import pack, plot, qt from yade import export ### DEFINING VARIABLES AND MATERIALS ### #geometry definition Ri,Rs,Ro=6.5,8.5,10.5 H=3.5 p=H/2 k=0.01 Hs=H*k hs=Hs/2 Rx=2*Ro Hx=2*H c1=geom.facetCylinder(center=(0,0,p),radius=Ro, height=H, segmentsNumber=20, wallMask=6) c2=geom.facetCylinder(center=(0,0,hs),radius=Rs, height=Hs, segmentsNumber=20, wallMask=7) c3=geom.facetCylinder(center=(0,0,p),radius=Ri, height=H, segmentsNumber=20, wallMask=7) nRead=readParamsFromTable( num_spheres=5000, compFricDegree = 30, unknownOk=True ) from yade.params import table num_spheres=table.num_spheres compFricDegree = table.compFricDegree damp=0.2 young=5e6 # contact stiffness mn,mx=Vector3(-50,-50,-50),Vector3(50,50,50) # corners of the initial packing ## create materials for spheres and plates O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls')) ## create walls around the packing walls=aabbWalls([mn,mx],thickness=0,material='walls') wallIds=O.bodies.append(walls) ## use a SpherePack object to generate a psd loose particles packing global sp sp=pack.SpherePack() sp.makeCloud(mn,mx,num=6000,psdSizes=[1,2,2.25,2.5,3,4,6],psdCumm=[0.,0.1,0.3,0.3,.3,.7,1.]) sp.toSimulation(material='spheres') ### DEFINING ENGINES ### triax=TriaxialStressController( thickness = 0, stressMask = 7, internalCompaction=False, label='controller' ) newton=NewtonIntegrator(damping=damp) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PyRunner(command='stop()',iterPeriod=10,label='checker'), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, newton ] #Display spheres with 2 colors for seeing rotations better Gl1_Sphere.stripes=0 if nRead==0: yade.qt.Controller(), yade.qt.View() ### APPLYING CONFINING PRESSURE ### triax.goal1=triax.goal2=triax.goal3=-1 def stop(): if O.iter<100:return checker.command='gravityDeposition()' def gravityDeposition(): pred=pack.inCylinder((0,0,0),(0,0,H),Ro)-pack.inCylinder((0,0,0),(0,0,Hs),Rs)-pack.inCylinder((0,0,0),(0,0,H),Ri) assembly=pack.filterSpherePack(pred,sp,True) assembly.toSimulation() #...connect to next steps in simulation --- -- You received this question notification because your team yade-users 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