Why I can't get stress?

Asked by 张文卿

I’m using PeriTriaxController to get packing with desired porosity.But when I used ‘triax.stress' to get average stresses ,it showed (0,0,0).And it's weird this script can work.So where should I change?Here is my script:
r=1.75e-05
O.periodic=True
O.cell.hSize=Matrix3(41*r,0,0,
      0,41*r,0,
      0,0,41*r)

O.materials.append(FrictMat(young=1.1e11,poisson=0.3,density=8900e12,frictionAngle=0,label='sphere'))
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(40*r,40*r,40*r),r,0,4000,False)
O.bodies.append([sphere(center,rad,material='sphere') for center,rad in sp])

############################triax########################################################
triax=PeriTriaxController(goal=(-2e4,-2e4,-2e4),stressMask=7)
############################Engine#######################################################
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb()],verletDist=0.05*r),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_MindlinPhys()],
  [Law2_ScGeom_MindlinPhys_HertzWithLinearShear()]
 ),
 PyRunner(command='controlporosity()',iterPeriod=1),
 triax,
 NewtonIntegrator(damping=.2)
]

O.dt=PWaveTimeStep()
def controlporosity():
 targateporosity=0.36
 a=utils.porosity()
 if a<targateporosity:
  O.pause()

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
张文卿
Solved:
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

Hello,

Looks like you need to add the O.run() command to start your simulation.

Robert

Revision history for this message
张文卿 (sandedadi) said :
#2

Hello,what do you mean?I have added O.run() to my script.It is still the same.

Revision history for this message
Robert Caulk (rcaulk) said :
#3

I am unsure what you mean by "it is still the same".

I have run your script, including O.run(), and it runs without error. triax.stress returns stresses.

Can you provide more details about your setup?
-which version of yade are you using?
-what distribution of linux are you using?
-details about the behavior of yade and your specific interactions with it when the behavior seems abnormal?

Here is your code, including O.run().

O.dt=PWaveTimeStep()
O.run()

def controlporosity():
     targateporosity=0.36
     a=utils.porosity()
     print 'stress tensor ', triax.stress
     if a<targateporosity:
         O.pause()