yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #20998
Re: [Question #685082]: errors in plot, print, save file, micro data, time step, 3D show
Question #685082 on Yade changed:
https://answers.launchpad.net/yade/+question/685082
Status: Needs information => Open
ehsan benabbas gave more information on the question:
Thank you so much Jan. I appreciate your time and help. mostly you
solved my problem. Just few things related to my current code in below:
1- Yes, I get an empty file which only contains the first line of title as e11, e22 .... , but no data is in the file (I want to make a clear and organized text file for post proccesing)
2- When I add "PyRunner(command='checkUnbalanced()',realPeriod=2)" to code in O.engines or those 2 print lines at the end of the code, the plot window doesn't show up
3- still I don't get any output for contact forces (let say data in saved file or plot)
4- in the plot command, the 'i' vs 's11,s22,s33' don't show up
5- I don't know the direction of 1,2,3 axises. is it like 3 for vertical axis, 2 for the horizontal axis and 1 for the third one?
and this is the output I get on Terminal:
Engine::action(): This engine is deprecated, please switch to TriaxialStressController if you expect long term support.
yade.plot: creating new line for kinetic
/home/ehsan/yade/install/lib/x86_64-linux-gnu/yade-2019-08-08.git-775ae74/py/yade/plot.py:505: MatplotlibDeprecationWarning:
The 'verts' kwarg was deprecated in Matplotlib 3.0 and will be removed in 3.2. Use 'marker' instead.
scatter=ax.scatter(scatterPt[0],scatterPt[1],s=60,color=line.get_color(),**scatterMarkerKw)
yade.plot: creating new line for gravWork
yade.plot: creating new line for elastPotential
yade.plot: creating new line for plastDissip
yade.plot: creating new line for nonviscDamp
In [1]: The constructor with a shareWidget is deprecated, use the regular contructor instead.
this is the code:
from yade import pack, plot, qt
sp=pack.SpherePack()
mn, mx=Vector3(0,0,0), Vector3(10,10,10)
sp.makeCloud(minCorner=mn,maxCorner=mx,rRelFuzz=0.2,num=2000,porosity=0.4)
O.materials.append(FrictMat(young=15e6,poisson=0.4,frictionAngle=radians(30),density=2600,label='spheres'))
O.materials.append(FrictMat(young=15e6,poisson=0.4,frictionAngle=0,density=0,label='frictionless'))
O.bodies.append([sphere(center,rad,material='spheres') for center, rad
in sp])
walls=aabbWalls(thickness=1e-10,material='frictionless')
wallIds=O.bodies.append(walls)
triax=TriaxialCompressionEngine(
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],
internalCompaction=False,
sigmaIsoCompaction=-50e3,
sigmaLateralConfinement=-50e3,
max_vel=10,
strainRate=0.01,
label="triax",
)
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()]
),
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
triax,
NewtonIntegrator(damping=0.4)
#PyRunner(command='checkUnbalanced()',realPeriod=2),
]
O.engines=O.engines[0:5]+[PyRunner(iterPeriod=20,command='history()',label='recorder')]+O.engines[5:7]
O.dt=.5*PWaveTimeStep()
def history():
plot.addData(unbalanced=unbalancedForce(),i=O.iter,**O.energy,
e11=-triax.strain[0], e22=-triax.strain[1], e33=-triax.strain[2],
s11=-triax.stress(0)[0], s22=-triax.stress(2)[1], s33=-triax.stress(4)[2],
Etot=O.energy.total())
#O.trackEnergy=True
def checkUnbalanced():
if unbalancedForce()<.05:
O.pause()
plot.saveDataTxt('bbb.txt.bz2')
for i in O.interactions:
id1,id2 = i.id1,i.id2
fn = i.phys.normalForce
fs = i.phys.shearForce
#plot.plots={'i':('unbalanced'),'i':('s11','s22','s33'),'i':('e11','e22','e33'),'i':(O.energy.keys,None,'Etot')}
plot.plots={'i':('unbalanced'),'i':('s11','s22','s33'),'i':('e11','e22','e33'),'e22':('s22'),'e11':('s11')}
Gl1_Sphere.stripes=True
plot.plot()
O.saveTmp()
plot.saveDataTxt('results')
#print 'stress difference:', (triax.stress[2]-triax.stress[1])
#print 'mean stress:',(triax.stress[2]+triax.stress[1]+triax.stress[0])/3
#print 'porosity:', porosity()
Thanks again.
--
You received this question notification because your team yade-users is
an answer contact for Yade.