Re: [Yade-users] [Question #432837]: how to get stress values with VTKExporter
Question #432837 on Yade changed: https://answers.launchpad.net/yade/+question/432837 Nishant posted a new comment: Thank you Jan, it helped! :) -- 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 #432837]: how to get stress values with VTKExporter
Question #432837 on Yade changed: https://answers.launchpad.net/yade/+question/432837 Jan Stránský posted a new comment: Hello, as Jerome said in #11, custom variables assigned in Python (liek mystress) is not saved/loaded. A workaround could be to save the data to an auxiliary variable / file and assign the values after load 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 #432837]: how to get stress values with VTKExporter
Question #432837 on Yade changed: https://answers.launchpad.net/yade/+question/432837 Nishant posted a new comment: Hi Gary, Did you solve this issue with exporting bodyStress? I have the same problem: If it a fresh simulations, bodyStresses can be exported to vtkExporter. But if we save and load the configuration, it gives error: Below is my MWE: #- from yade import pack, export Len = 1.0 wallIds=O.bodies.append(geom.facetBox(center=(Len/2,Len/2,Len/2),extents = (Len/2,Len/2,Len/2), wallMask=63, color=(1,0,0))) sp=pack.SpherePack() sp.makeCloud((0,0,0),(Len,Len,Len),rMean=.1, num =10) sp.toSimulation() #- O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), NewtonIntegrator(gravity=(0,0,-9.81),damping = 0.2,label='newton') ] O.dt = 0.5*PWaveTimeStep() O.run(int(1e4),True) O.save('Trial.yade.gz') #-- #O.load('Trial.yade.gz') #O.step() #-- stresses = bodyStressTensors() for b in O.bodies: b.mystress = stresses[b.id] vtkExporter = export.VTKExporter('Check') vtkExporter.exportSpheres(what=[('velocity', 'b.state.vel.norm()'),('stress','b.mystress')]) vtkExporter.exportFacets(what=[('pos','b.state.pos')]) #- Above works!. But if I uncomment: O.load('Trial.yade.gz') O.step() I get error: test = eval(command) # ... eval one example to see what type (float, Vector3, Matrix3) the result is ... File "", line 1, in AttributeError: 'Body' object has no attribute 'mystress' -- 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 #432837]: how to get stress values with VTKExporter
Question #432837 on Yade changed: https://answers.launchpad.net/yade/+question/432837 Gary Pekmezi posted a new comment: Thanks for the reply Jan, I was able to get the output I needed otherwise. However, I did go back and created a MWE to replicate the issue. My problem seems to stem from loading a saved simulation. The MWE below replicates it after saving then reloading a self-contained simulation. from yade import pack,export ### DEFINING SCENE ### O.materials.append(FrictMat(young=15e6, poisson=0.4, frictionAngle=radians(20), density=2600, label='spheres')) O.materials.append(FrictMat(young=15e6, poisson=0.4, frictionAngle=0, density=0, label='walls')) sp=pack.SpherePack() mn,mx=Vector3(0,0,0),Vector3(10,10,10) sp.makeCloud(minCorner=mn,maxCorner=mx,rRelFuzz=.2,num=600) walls=aabbWalls([mn,mx],thickness=0,oversizeFactor=2.0,material='walls') wallIds=O.bodies.append(walls) sp.toSimulation(material='spheres') ### ### CONFINE THE MODEL ### ### O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_MindlinPhys(label='mindlinContact', betan=0.20, betas=0.05)], [Law2_ScGeom_MindlinPhys_Mindlin(label="mindlinLaw2", neverErase=False)], ), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5), TriaxialStressController(thickness = -1,stressMask = 7,label="triax"), NewtonIntegrator(damping=.4) ] triax.goal1=triax.goal2=triax.goal3=-50e3 while 1: O.run(1000, True) unb=unbalancedForce() triDiff=abs((triax.goal1-triax.meanStress)/(triax.goal1)) if unb<0.05 and triDiff<0.05: break O.save('confinedState.yade.gz') O.load('confinedState.yade.gz') ### ### EXPORT STRESSES IN MODEL### ### s=bodyStressTensors() for b in O.bodies: b.mystress=s[b.id] vtkExporter = export.VTKExporter("stress.vtk") vtkExporter.exportSpheres(what=[('stress','b.mystress')]) -- 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 #432837]: how to get stress values with VTKExporter
Question #432837 on Yade changed: https://answers.launchpad.net/yade/+question/432837 Jan Stránský posted a new comment: Hi Gary, please send a MWE [1] Jan [1] https://yade-dem.org/wiki/Howtoask -- 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 #432837]: how to get stress values with VTKExporter
Question #432837 on Yade changed: https://answers.launchpad.net/yade/+question/432837 Gary Pekmezi posted a new comment: Jan Stránský I tried using the method specified in the initial answer for exporting spheres' stresses. I was able to assign the stress values to b.mystress using the code, however I get the following error upon export : - Traceback (most recent call last): File "./yade", line 182, in runScript execfile(script,globals()) File "triaxial_tess_tract.py", line 64, in vtkExporter.exportSpheres(what=[("stress","b.mystress")]) File ".../yade201606/lib64/yade-2016-09-28.git-f355d84/py/yade/export.py", line 431, in exportSpheres test = eval(command) # ... eval one example to see what type (float, Vector3, Matrix3) the result is ... File "", line 1, in AttributeError: 'Body' object has no attribute 'mystress' - I thought this question belonged here being a very recent thread, let me know if I should start a new thread instead. Thanks, Gary -- 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 #432837]: how to get stress values with VTKExporter
Question #432837 on Yade changed: https://answers.launchpad.net/yade/+question/432837 Status: Answered => Open alma is still having a problem: Hi Mr Stransky, Thanks a lot for your response and I'm sorry for responsing in my recenet post; I try clearly to describe and say my problems. in relation to "this method isn't work" that I said, I need to help about two states that you described them (the computation of stress also the export for visualization in Paraview). My leading aim for finding required parameters for visualization in Paraview for polyhedrons that be not referred to them in reference manual. best regards, Alma -- 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 #432837]: how to get stress values with VTKExporter
Question #432837 on Yade changed: https://answers.launchpad.net/yade/+question/432837 Status: Open => Answered Jan Stránský proposed the following answer: Hi Alma, always try to be specific enough [1]. E.g. in the original question, you did not mention polyhedrons although they are not very common in Yade. Here, what does "this method isn't work" mean? The computation of stress? the export? ... Thanks for further information Jan [1] https://yade-dem.org/wiki/Howtoask -- 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 #432837]: how to get stress values with VTKExporter
Question #432837 on Yade changed: https://answers.launchpad.net/yade/+question/432837 Status: Answered => Open alma is still having a problem: Hi Mr stransky, thanks for your guide, but this method isn't work for polyhedrons and I think it works for spheres. Is there any method for getting stress for polyhedra materials? regards, Alma -- 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