Re: [Yade-users] [Question #665569]: export the sphere in specific position with VTK format
Question #665569 on Yade changed: https://answers.launchpad.net/yade/+question/665569 Status: Open => Answered Jan Stránský proposed the following answer: Hello, > export the sphere in specific position with VTK format > I plan to export the txt format please be consistent in your requirements :-) > but it's failed please always be as specific as possible (e.g. it gives this and that error, it does not save what it should...). In this case, I got variable 'i' referenced before assignment which is understandable, because in your function exportSelectedSpheres, "i" is used: > xCor = O.bodies[i].state.pos[0] but python don't know what it is.. > I think it's difficult to make it true through this method this should do what you want (although in the given setting, no sphere satisfy your condition and therefore no vtk file is saved) ### vtk = export.VTKExporter("zdj") def exportSelectedSpheres(): def check(b): x,y,z = b.state.pos return isinstance(b.shape,Sphere) and 0<=x and x<=0.000150 and 0<=y and y<=0.00050 and -0.3<=z and z<=0.7 ids = [b.id for b in O.bodies if check(b)] vtk.exportSpheres(ids=ids) ### cheers Jan -- 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 #665564]: EPWP (Excess pore water pressure)
Question #665564 on Yade changed: https://answers.launchpad.net/yade/+question/665564 SayedHessam posted a new comment: Dear Jerome, Thanks for the reply. You can find herewith a part of my model, as you requested: ### DEFINING ENGINES ### triax=TriaxialStressController( maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth) finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth) thickness = 0, stressMask = 7, internalCompaction=True, # If true the confining pressure is generated by growing particles ) 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()] ), ## We will use the global stiffness of each body to determine an optimal timestep (see https://yade-dem.org/w/images/1/1b/Chareyre_licensed.pdf) GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, TriaxialStateRecorder(iterPeriod=100,file='WallStresses'+table.key), 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 ### ### #the value of (isotropic) confining stress defines the target stress to be applied in all three directions triax.goal1=triax.goal2=triax.goal3=-1 while 1: O.run(1000, True) #the global unbalanced force on dynamic bodies, thus excluding boundaries, which are not at equilibrium unb=unbalancedForce() print 'unbalanced force:',unb,' mean stress: ',triax.meanStress if unbhttps://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 #665569]: export the sphere in specific position with VTK format
Question #665569 on Yade changed: https://answers.launchpad.net/yade/+question/665569 Status: Answered => Open zhao dejin is still having a problem: Hi ,Jérôme I think it's difficult to make it true through this method , I plan to export the txt format ,here is my code , but it's failed, can you guide me ? thanks a lot . ###code ## # !/usr/bin/python # -*- coding: utf-8 -*- ### # IMPORT MODULES ### from yade import export from yade import pack from yade import qt ### # DEFINE MATERIALS ### steel=FrictMat(young=2.2e11,poisson=0.3,density=7800,frictionAngle=0.3,label='steel') O.materials.append(steel) ### ### plank1=O.bodies.append(geom.facetBox(center=(0.00075,0.00025,-0.5),extents=(0.00075,0.00025,0.5),wire=True)) plank2=O.bodies.append(geom.facetBox(center=(0.00075,0.0006,0.5),extents=(0.00075,0.0001,0.5),wire=False)) plank2=O.bodies.append(geom.facetBox(center=(0.00075,-0.0001,0.5),extents=(0.00075,0.0001,0.5),wire=False)) sp=pack.SpherePack() sp.makeCloud((-0.0005,-0.0002,0.0001),(0,0.0007,0.0006),psdSizes=[0.17, 0.25, 0.32,0.38, 0.44, 0.53],psdCumm=[0, 0.4, 0.56,0.65, 0.85, 1]) ids=sp.toSimulation(color=(0.8,0.8,0.8),material='steel') ..(omit) ### # ENGINES ### O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()), NewtonIntegrator(gravity=(0,0,-9.81),damping=0.5), PyRunner(command="exportSelectedSpheres()",iterPeriod=5000), ] ### # DEFINE FUNCATIONS ### def exportSelectedSpheres(): xCor = O.bodies[i].state.pos[0] yCor = O.bodies[i].state.pos[1] zCor = O.bodies[i].state.pos[2] for i in sp: if (0 <= xCor <= 0.000150) & (0 <= yCor <= 0.00050) & (-0.3 <= zCor <= 0.7): export.text('zdj.txt') ### #set an optimal timestep O.dt=utils.PWaveTimeStep() O.usesTimeStepper=True qt.View() qt.Controller() -- 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 #662551]: How to show contact force on particles or polyhedre using changing colors
Question #662551 on Yade changed: https://answers.launchpad.net/yade/+question/662551 Status: Answered => Solved Kun Zeng 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 #665569]: export the sphere in specific position with VTK format
Question #665569 on Yade changed: https://answers.launchpad.net/yade/+question/665569 Status: Open => Answered Jérôme Duriez proposed the following answer: Sorry, I misunderstood this part of your question. Then VTKExporter.exportSpheres function from export module (and its ids attribute, picking a list of ids that satisfy your position criteria) would help : https://yade- dem.org/doc/yade.export.html?highlight=vtkexport#yade.export.VTKExporter.exportSpheres -- 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 #665569]: export the sphere in specific position with VTK format
Question #665569 on Yade changed: https://answers.launchpad.net/yade/+question/665569 Status: Answered => Open zhao dejin is still having a problem: Hello, Thanks ,Jérôme , I have tried the VTKRecorder,like this : O.engines=[ ForceResetter(), .. . ( omit) VTKRecorder (fileName='test',recorders=['sphere',iterPeriod=200]) ] but all sphere are exported through this method ,not in specific position ,like sphere in a box [ 0 ≦ x ≦ 1,0 ≦ y ≦ 1, 0 ≦ z ≦ 1] . -- 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 #665569]: export the sphere in specific position with VTK format
Question #665569 on Yade changed: https://answers.launchpad.net/yade/+question/665569 Status: Open => Answered Jérôme Duriez proposed the following answer: Hello, Did you try using (e.g. including it in your O.engines) VTKRecorder [*] ? It seems to me this is exactly what you want [*] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.VTKRecorder, including 'spheres' in recorders attributes -- 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 #665573]: irrelevant facets slow down simulation
New question #665573 on Yade: https://answers.launchpad.net/yade/+question/665573 Good evening, I recently run a test. I created 2 stl structures. Both of them have identical internal shape and in there a fixed number of particles is created and fills up the space. The only difference of the stls is that one has a lot of letters on the outer side, thus increasing the number of facets by a lot. However, those extra facets never interract with the particles. I expected the initialization times to differ, but the run times to be the same To my surprise the example with fewer facets took 3 times less to run. Here is a MWE http://dropmefiles.com/qka53 It is run by giving the command time python calltest.py maze1lid.stl for the simple stl and time python calltest.py letters.stl for the one with the letters Is it something i am missing? Any suggestion is really appreciated Best Regards John -- 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 #665293]: Issues with implementation of Law2_ScGeom_CapillaryPhys_Capillarity
Question #665293 on Yade changed: https://answers.launchpad.net/yade/+question/665293 Jérôme Duriez proposed the following answer: Regarding your questions in post #2: 1. For a narrow psd I guess rRatioVec includes enough values close to 1 to have "good" results, but I never really looked into this. If you wish, you have MATLAB files in #4 of https://bugs.launchpad.net/yade/+bug/1440887 that could help you dig into the capillary files data (plotting them) and check how critical a change in rRatio is. 3. It is exactly "to define a comprehensive lookup table [..] to be used with several user-set capillary pressures" 4. You may consider there is a limit through the maximum capillary pressure which appears in the capillary files. This maximum value (in the normalized fashion) is automatically computed by the MATLAB scripts in "Preliminary C" [*] If you would impose an even greater value in Law2_ScGeom_CapillaryPhys_Capillarity during your YADE simulations, including Law2_ScGeom_CapillaryPhys_Capillarity would go unnoticed : no capillary bridges would be computed because you're outside the bounds of the lookup table. You would get a corresponding warning message in your YADE terminal during simulation. This corresponds neglecting so tiny bridges we may consider this is not a problem (even though this may not be true because capillary force has a non zero limit value when the bridge volume tends to zero) Regarding your question in #4, the value of Law2_ScGeom_CapillaryPhys_Capillarity.capillaryPressure also has to ensure a pendular regime with distinct bridges. You may check whether bridges are distinct or overlap with Law2_ScGeom_CapillaryPhys_Capillarity.fusionDetection and CapillaryPhys.fusionNumber [*] https://github.com/yade/trunk/blob/master/examples/capillaryLaplaceYoung/writesCapFile.m#L84 -- 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 #665314]: save/load precedure
Question #665314 on Yade changed: https://answers.launchpad.net/yade/+question/665314 Status: Open => Answered Jérôme Duriez proposed the following answer: For more details regarding what is saved / loaded, looking into the source code, you may give a look at https://yade-dem.org/doc/prog.html#serialization and https://yade-dem.org/doc/prog.html#yade-class-base-doc -- 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 #665540]: particles partially in the wall
Question #665540 on Yade changed: https://answers.launchpad.net/yade/+question/665540 JOHN 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 #665540]: particles partially in the wall
Question #665540 on Yade changed: https://answers.launchpad.net/yade/+question/665540 Status: Answered => Solved JOHN confirmed that the question is solved: Thanks for that, wall stiffness helped considerable regards John -- 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