I am trying to simulate uniaxial compression with DEM on yade. I would like to know how to introduce the hertz mindlin contact model to my model. Also, I need the model to be parallel bonded model, how do I do that in the python script?

Asked by Anay Joshi

I am trying to simulate the uniaxial compression test on the cylinder. I would like to introduce the hertz mindlin contact model, parallel bond bonded model for concrete and also I would like to know how to check the number of elements generated in the geometry in yade.

Also, When I try to save the simulation it appears to save to the directory i provide, but when i open that directory its not saved there. can you also help me with that?

I would really appreciate the response from your side.

Thanks,
Anay

Question information

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

Hello Anay,

Firstly, please spend some time reading through [1 https://yade-dem.org/wiki/Howtoask]. It is hard to help you without more information (e.g. your code, your errors, etc.). Try reformatting the question to "I can't seem to [insert problem]. Here is my code [insert code] here is the error I am encountering [insert error] here are the ways I've tried to solve the problem [insert tries] here are the other launchpad questions that seem to pertain to my problem [insert questions]". This way, you will likely see far better results.

To get you started: try starting with an example concrete script [2], and modifying it to what you desire.

>I would like to know how to check the number of elements generated in the geometry in yade.

len(O.bodies)

should do the trick.

>Also, When I try to save the simulation it appears to save to the directory i provide, but when i open that directory >its not saved there. can you also help me with that?

Please be specific with how you save your simulation. In other words, copy and paste the code you use.

Best,

Robert

[1]https://yade-dem.org/wiki/Howtoask
[2]https://github.com/yade/trunk/blob/master/examples/concrete/uniax.py

Revision history for this message
Anay Joshi (petronas) said :
#2

Hi Robert,
I am using one of the reference codes I found on github. I am attaching the
code file in this mail. I am really new to yade platform hence, apologies
for asking very basic questions.
I would really appreciate your help with the code. Please have a look at
the code and let me know the necessary changes.
Also, I am trying to implement the parallel bond model for the concrete
cylinder I am using. Would you help with that also?

Thanks,
Anay

On 1 Dec 2017 11:52 am, "Robert Caulk" <email address hidden>
wrote:

> Your question #661250 on Yade changed:
> https://answers.launchpad.net/yade/+question/661250
>
> Status: Open => Needs information
>
> Robert Caulk requested more information:
> Hello Anay,
>
> Firstly, please spend some time reading through [1
> https://yade-dem.org/wiki/Howtoask]. It is hard to help you without more
> information (e.g. your code, your errors, etc.). Try reformatting the
> question to "I can't seem to [insert problem]. Here is my code [insert
> code] here is the error I am encountering [insert error] here are the ways
> I've tried to solve the problem [insert tries] here are the other launchpad
> questions that seem to pertain to my problem [insert questions]". This way,
> you will likely see far better results.
>
> To get you started: try starting with an example concrete script [2], and
> modifying it to what you desire.
>
> >I would like to know how to check the number of elements generated in
> the geometry in yade.
>
> len(O.bodies)
>
> should do the trick.
>
> >Also, When I try to save the simulation it appears to save to the
> directory i provide, but when i open that directory >its not saved
> there. can you also help me with that?
>
> Please be specific with how you save your simulation. In other words,
> copy and paste the code you use.
>
> Best,
>
> Robert
>
> [1]https://yade-dem.org/wiki/Howtoask
> [2]https://github.com/yade/trunk/blob/master/examples/concrete/uniax.py
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/yade/+question/661250
>
> You received this question notification because you asked the question.
>

Revision history for this message
Anay Joshi (petronas) said :
#3

Hi Robert,
I see that I am using same reference code as you mentioned in the link. I
just have changed geometry and few parameters value. I think this makes it
easier for you to understand my issue.

Regarding the save option, I open the display of the simulation in yade and
hit save button given there. That's doesn't seem to be working in my case.

Again sincere apologies for my silly questions.

Thanks,
Anay

On 1 Dec 2017 11:52 am, "Robert Caulk" <email address hidden>
wrote:

> Your question #661250 on Yade changed:
> https://answers.launchpad.net/yade/+question/661250
>
> Status: Open => Needs information
>
> Robert Caulk requested more information:
> Hello Anay,
>
> Firstly, please spend some time reading through [1
> https://yade-dem.org/wiki/Howtoask]. It is hard to help you without more
> information (e.g. your code, your errors, etc.). Try reformatting the
> question to "I can't seem to [insert problem]. Here is my code [insert
> code] here is the error I am encountering [insert error] here are the ways
> I've tried to solve the problem [insert tries] here are the other launchpad
> questions that seem to pertain to my problem [insert questions]". This way,
> you will likely see far better results.
>
> To get you started: try starting with an example concrete script [2], and
> modifying it to what you desire.
>
> >I would like to know how to check the number of elements generated in
> the geometry in yade.
>
> len(O.bodies)
>
> should do the trick.
>
> >Also, When I try to save the simulation it appears to save to the
> directory i provide, but when i open that directory >its not saved
> there. can you also help me with that?
>
> Please be specific with how you save your simulation. In other words,
> copy and paste the code you use.
>
> Best,
>
> Robert
>
> [1]https://yade-dem.org/wiki/Howtoask
> [2]https://github.com/yade/trunk/blob/master/examples/concrete/uniax.py
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/yade/+question/661250
>
> You received this question notification because you asked the question.
>

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

Hello Anay,

>I am using one of the reference codes I found on github.

Which code? There are so many on github...feel free to copy and paste links to github, yade documentation, etc. It is very helpful for people trying to help you.

>I am attaching the
>code file in this mail.

You will need to copy and paste your code into your replies. Email attachments do not appear anywhere in launchpad communications.

>I am really new to yade platform hence, apologies
>for asking very basic questions.

Welcome to Yade! Actually, you are very welcome to ask the most basic questions. That is not the problem. I am simply suggesting that it is difficult to help you since you are not providing enough information for anyone to help.

>I would really appreciate your help with the code. Please have a look at
>the code and let me know the necessary changes.

Please also add the problem you are facing. For example "when I try to do [blank], the code does [blank]. Why can't I add/change [blank] without the code throwing the error [blank]?"

Revision history for this message
Anay Joshi (petronas) said :
#5

Hi Robert,

I am using this code to get started with the simulation.

#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division

from yade import plot,pack,timing
import time, sys, os, copy

#import matplotlib
#matplotlib.rc('text',usetex=True)
#matplotlib.rc('text.latex',preamble=r'\usepackage{concrete}\usepackage{euler}')

"""
A fairly complex script performing uniaxial tension-compression test
on hyperboloid-shaped specimen.

Most parameters of the model (and of the setup) can be read from table
using yade-multi.

After the simulation setup, tension loading is run and stresses are
periodically saved for plotting
as well as checked for getting below the maximum value so far. This
indicates failure (see stopIfDamaged
function). After failure in tension, the original setup is loaded anew
and the sense of loading reversed.
After failure in compression, strain-stress curves are saved via
plot.saveGnuplot and we exit,
giving some useful information like peak stresses in tension/compression.

Running this script for the first time can take long time, as the
specimen is prepared using triaxial
compression. Next time, however, an attempt is made to load
previously-generated packing
(from /tmp/triaxPackCache.sqlite) and this expensive procedure is avoided.

The specimen length can be specified, its diameter is half of the
length and skirt of the hyperboloid is
4/5 of the width.

The particle size is constant and can be specified using the
sphereRadius parameter.

The 3d display has displacement scaling applied, so that the fracture
looks more spectacular. The scale
is 1000 for tension and 100 for compression.

"""

# default parameters or from table
readParamsFromTable(noTableOk=True, # unknownOk=True,
 young=24e9,
 poisson=.2,

 sigmaT=3.5e6,
 frictionAngle=atan(0.8),
 epsCrackOnset=1e-4,
 relDuctility=30,

 intRadius=1.5,
 dtSafety=.8,
 damping=0.4,
 strainRateTension=.05,
 strainRateCompression=.5,
 setSpeeds=True,
 # 1=tension, 2=compression (ANDed; 3=both)
 doModes=3,

 specimenLength=.15,
 sphereRadius=3.5e-3,

 # isotropic confinement (should be negative)
 isoPrestress=0,
)

from yade.params.table import *

if 'description' in O.tags.keys():
O.tags['id']=O.tags['id']+O.tags['description']

# make geom; the dimensions are hard-coded here; could be in param
table if desired
# z-oriented hyperboloid, length 20cm, diameter 10cm, skirt 8cm
# using spheres 7mm of diameter
concreteId=O.materials.append(CpmMat(young=young,frictionAngle=frictionAngle,poisson=poisson,density=4800,sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=epsCrackOnset,isoPrestress=isoPrestress))

sps=SpherePack()
sp=pack.randomDensePack(pack.inHyperboloid((0,0,-.5*specimenLength),(0,0,.5*specimenLength),.25*specimenLength,.17*specimenLength),spheresInCell=2000,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite',returnSpherePack=True)
#sp=pack.randomDensePack(pack.inAlignedBox((-.25*specimenLength,-.25*specimenLength,-.5*specimenLength),(.25*specimenLength,.25*specimenLength,.5*specimenLength)),spheresInCell=2000,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite',returnSpherePack=True)
sp.toSimulation(material=concreteId)
bb=uniaxialTestFeatures()
negIds,posIds,axis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']
O.dt=dtSafety*PWaveTimeStep()
print 'Timestep',O.dt

mm,mx=[pt[axis] for pt in aabbExtrema()]
coord_25,coord_50,coord_75=mm+.25*(mx-mm),mm+.5*(mx-mm),mm+.75*(mx-mm)
area_25,area_50,area_75=approxSectionArea(coord_25,axis),approxSectionArea(coord_50,axis),approxSectionArea(coord_75,axis)

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intRadius,label='is2aabb'),],verletDist=.05*sphereRadius),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intRadius,label='ss2sc')],
  [Ip2_CpmMat_CpmMat_CpmPhys()],
  [Law2_ScGeom_CpmPhys_Cpm()],
 ),
 NewtonIntegrator(damping=damping,label='damper'),
 CpmStateUpdater(realPeriod=.5),
 UniaxialStrainer(strainRate=strainRateTension,axis=axis,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=False,blockRotations=False,setSpeeds=setSpeeds,label='strainer'),
 PyRunner(virtPeriod=1e-6/strainRateTension,realPeriod=1,command='addPlotData()',label='plotDataCollector',initRun=True),
 PyRunner(realPeriod=4,command='stopIfDamaged()',label='damageChecker'),
]
#O.miscParams=[Gl1_CpmPhys(dmgLabel=False,colorStrain=False,epsNLabel=False,epsT=False,epsTAxes=False,normal=False,contactLine=True)]

# plot stresses in ¼, ½ and ¾ if desired as well; too crowded in the
graph that includes confinement, though
plot.plots={'eps':('sigma',)} #,'sigma.50')},'t':('eps')}
#'sigma.25','sigma.50','sigma.75')}

O.saveTmp('initial');

O.timingEnabled=False

global mode
mode='tension' if doModes & 1 else 'compression'

def initTest():
 global mode
 print "init"
 if O.iter>0:
  O.wait();
  O.loadTmp('initial')
  print "Reversing plot data"; plot.reverseData()
 else: plot.plot(subPlots=False)
 strainer.strainRate=abs(strainRateTension) if mode=='tension' else
-abs(strainRateCompression)
 try:
  from yade import qt
  renderer=qt.Renderer()
  renderer.dispScale=(1000,1000,1000) if mode=='tension' else (100,100,100)
 except ImportError: pass
 print "init done, will now run."
 O.step(); # to create initial contacts
 # now reset the interaction radius and go ahead
 ss2sc.interactionDetectionFactor=1.
 is2aabb.aabbEnlargeFactor=1.

 O.run()

def stopIfDamaged():
 global mode
 if O.iter<2 or not plot.data.has_key('sigma'): return # do nothing at
the very beginning
 sigma,eps=plot.data['sigma'],plot.data['eps']
 extremum=max(sigma) if (strainer.strainRate>0) else min(sigma)
 minMaxRatio=0.5 if mode=='tension' else 0.5
 if extremum==0: return
 import sys; sys.stdout.flush()
 if abs(sigma[-1]/extremum)<minMaxRatio or abs(strainer.strain)>(5e-3
if isoPrestress==0 else 5e-2):
  if mode=='tension' and doModes & 2: # only if compression is enabled
   mode='compression'
   O.save('/tmp/uniax-tension.yade.gz')
   print "Saved /tmp/uniax-tension.yade.gz (for use with
interaction-histogram.py and uniax-post.py)"
   print "Damaged, switching to compression... "; O.pause()
   # important! initTest must be launched in a separate thread;
   # otherwise O.load would wait for the iteration to finish,
   # but it would wait for initTest to return and deadlock would result
   import thread; thread.start_new_thread(initTest,())
   return
  else:
   print "Damaged, stopping."
   ft,fc=max(sigma),min(sigma)
   print 'Strengths fc=%g, ft=%g, |fc/ft|=%g'%(fc,ft,abs(fc/ft))
   title=O.tags['description'] if 'description' in O.tags.keys() else
O.tags['params']
   print 'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)
   print 'Bye.'
   O.pause()
   #sys.exit(0) # results in some threading exception

def addPlotData():
 yade.plot.addData({'t':O.time,'i':O.iter,'eps':strainer.strain,'sigma':strainer.avgStress+isoPrestress,
  'sigma.25':forcesOnCoordPlane(coord_25,axis)[axis]/area_25+isoPrestress,
  'sigma.50':forcesOnCoordPlane(coord_50,axis)[axis]/area_50+isoPrestress,
  'sigma.75':forcesOnCoordPlane(coord_75,axis)[axis]/area_75+isoPrestress,
  })
plot.plot(subPlots=False)
#O.run()
initTest()
waitIfBatch()

Problem I am facing:

I want to include the parallel bond particle model in this code. How
do I do that?

Also, is there any way to check which contact model and parameters
yade is using in this code?

Thanks,

Anay

On Fri, Dec 1, 2017 at 3:08 PM, Robert Caulk <
<email address hidden>> wrote:

> Your question #661250 on Yade changed:
> https://answers.launchpad.net/yade/+question/661250
>
> Status: Open => Needs information
>
> Robert Caulk requested more information:
> Hello Anay,
>
> >I am using one of the reference codes I found on github.
>
> Which code? There are so many on github...feel free to copy and paste
> links to github, yade documentation, etc. It is very helpful for people
> trying to help you.
>
> >I am attaching the
> >code file in this mail.
>
> You will need to copy and paste your code into your replies. Email
> attachments do not appear anywhere in launchpad communications.
>
> >I am really new to yade platform hence, apologies
> >for asking very basic questions.
>
> Welcome to Yade! Actually, you are very welcome to ask the most basic
> questions. That is not the problem. I am simply suggesting that it is
> difficult to help you since you are not providing enough information for
> anyone to help.
>
> >I would really appreciate your help with the code. Please have a look at
> >the code and let me know the necessary changes.
>
> Please also add the problem you are facing. For example "when I try to
> do [blank], the code does [blank]. Why can't I add/change [blank]
> without the code throwing the error [blank]?"
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/yade/+question/661250
>
> You received this question notification because you asked the question.
>

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

>I want to include the parallel bond particle model in this code. How
>do I do that?

Are you referring to [1]? I don't have much experience with CPM, but IINM, CPM is a bonded-particle model, featuring rate dependence, plasticity, and damage. You can investigate CPM further in [2] to see if it is the bonded model you are looking for.

>Also, is there any way to check which contact model and parameters
>yade is using in this code?

These are the model parameters:

 young=24e9,
 poisson=.2,
 sigmaT=3.5e6,
 frictionAngle=atan(0.8),
 epsCrackOnset=1e-4,
 relDuctility=30

concreteId=O.materials.append(CpmMat(young=young,frictionAngle=frictionAngle,poisson=poisson,density=4800,sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=epsCrackOnset,isoPrestress=isoPrestress))

more info on these can be found in [3].

>Regarding the save option, I open the display of the simulation in yade and
>hit save button given there. That's doesn't seem to be working in my case.

I recommend using the terminal. The command O.save('nameOfState.yade.gz') will save the state of your simulation.

[1]Potyondy, D. O., & Cundall, P. A. (2004). A bonded-particle model for rock. International Journal of Rock Mechanics and Mining Sciences, 41(8 SPEC.ISS.), 1329–1364. http://doi.org/10.1016/j.ijrmms.2004.09.011
[2]http://beta.arcig.cz/lide/eudoxos/smilauer2010-phd-thesis.pdf
[3]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.CpmMat

Revision history for this message
Anay Joshi (petronas) said :
#7

Hi Robert,
Apologies for responding so late, I wasn't around the system for the
weekend. Thank you for the help, this will help me with my work. I shall
trouble you if I have further questions. Really appreciate your response
for my queries.

Thanks,
Anay Joshi

On 1 Dec 2017 3:52 pm, "Robert Caulk" <email address hidden>
wrote:

> Your question #661250 on Yade changed:
> https://answers.launchpad.net/yade/+question/661250
>
> Status: Open => Answered
>
> Robert Caulk proposed the following answer:
> >I want to include the parallel bond particle model in this code. How
> >do I do that?
>
> Are you referring to [1]? I don't have much experience with CPM, but
> IINM, CPM is a bonded-particle model, featuring rate dependence,
> plasticity, and damage. You can investigate CPM further in [2] to see if
> it is the bonded model you are looking for.
>
> >Also, is there any way to check which contact model and parameters
> >yade is using in this code?
>
> These are the model parameters:
>
> young=24e9,
> poisson=.2,
> sigmaT=3.5e6,
> frictionAngle=atan(0.8),
> epsCrackOnset=1e-4,
> relDuctility=30
>
> concreteId=O.materials.append(CpmMat(young=young,
> frictionAngle=frictionAngle,poisson=poisson,density=4800,
> sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=
> epsCrackOnset,isoPrestress=isoPrestress))
>
> more info on these can be found in [3].
>
> >Regarding the save option, I open the display of the simulation in yade
> and
> >hit save button given there. That's doesn't seem to be working in my case.
>
> I recommend using the terminal. The command
> O.save('nameOfState.yade.gz') will save the state of your simulation.
>
> [1]Potyondy, D. O., & Cundall, P. A. (2004). A bonded-particle model for
> rock. International Journal of Rock Mechanics and Mining Sciences, 41(8
> SPEC.ISS.), 1329–1364. http://doi.org/10.1016/j.ijrmms.2004.09.011
> [2]http://beta.arcig.cz/lide/eudoxos/smilauer2010-phd-thesis.pdf
> [3]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.CpmMat
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/yade/+question/661250/+confirm?answer_id=5
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/yade/+question/661250
>
> You received this question notification because you asked the question.
>

Revision history for this message
Launchpad Janitor (janitor) said :
#8

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Anay Joshi (petronas) said :
#9

Hi Robert,
I am running the 'uniax.py' on yade and I am getting the following output
in the terminal. I am seeing a lot of "Damaged, stopping" output. My
question is,
is it normal to see this or am I doing something wrong in the python
script. I am coping my python file as well as the output I am seeing in the
terminal below. Please help me with the issue.

Also, to see how many particles are generated, where in the python code
should I use the syntax len(O.bodies) and how will I print it on the
terminal window?

*Python script:*

#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division

from yade import plot,pack,timing
import time, sys, os, copy

#import matplotlib
#matplotlib.rc('text',usetex=True)
#matplotlib.rc('text.latex',preamble=r'\usepackage{concrete}\usepackage{euler}')

"""
A fairly complex script performing uniaxial tension-compression test on
hyperboloid-shaped specimen.

Most parameters of the model (and of the setup) can be read from table
using yade-multi.

After the simulation setup, tension loading is run and stresses are
periodically saved for plotting
as well as checked for getting below the maximum value so far. This
indicates failure (see stopIfDamaged
function). After failure in tension, the original setup is loaded anew and
the sense of loading reversed.
After failure in compression, strain-stress curves are saved via
plot.saveGnuplot and we exit,
giving some useful information like peak stresses in tension/compression.

Running this script for the first time can take long time, as the specimen
is prepared using triaxial
compression. Next time, however, an attempt is made to load
previously-generated packing
(from /tmp/triaxPackCache.sqlite) and this expensive procedure is avoided.

The specimen length can be specified, its diameter is half of the length
and skirt of the hyperboloid is
4/5 of the width.

The particle size is constant and can be specified using the sphereRadius
parameter.

The 3d display has displacement scaling applied, so that the fracture looks
more spectacular. The scale
is 1000 for tension and 100 for compression.

"""

# default parameters or from table
readParamsFromTable(noTableOk=True, # unknownOk=True,
    young=24e9,
    poisson=.2,

    sigmaT=3.5e6,
    frictionAngle=atan(0.8),
    epsCrackOnset=1e-4,
    relDuctility=30,

    intRadius=1.5,
    dtSafety=.8,
    damping=0.4,
    strainRateTension=.05,
    strainRateCompression=.5,
    setSpeeds=True,
    # 1=tension, 2=compression (ANDed; 3=both)
    doModes=2,

    specimenLength=.15,
    sphereRadius=3.5e-3,

    # isotropic confinement (should be negative)
    isoPrestress=0,
)

from yade.params.table import *

if 'description' in O.tags.keys():
O.tags['id']=O.tags['id']+O.tags['description']

rad = 1
# make geom; the dimensions are hard-coded here; could be in param table if
desired
# z-oriented hyperboloid, length 20cm, diameter 10cm, skirt 8cm
# using spheres 7mm of diameter
concreteId=O.materials.append(CpmMat(young=young,frictionAngle=frictionAngle,poisson=poisson,density=4800,sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=epsCrackOnset,isoPrestress=isoPrestress))

sps=SpherePack()
sp=pack.randomDensePack(pack.inCylinder((0.1,0.22,0.33), (0.6,0.22,0.33),
0.1*rad),spheresInCell=500,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite',returnSpherePack=True)
#sp=pack.randomDensePack(pack.inAlignedBox((-.25*specimenLength,-.25*specimenLength,-.5*specimenLength),(.25*specimenLength,.25*specimenLength,.5*specimenLength)),spheresInCell=2000,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite',returnSpherePack=True)
sp.toSimulation(material=concreteId)
bb=uniaxialTestFeatures()
negIds,posIds,axis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']
O.dt=dtSafety*PWaveTimeStep()
print 'Timestep',O.dt

mm,mx=[pt[axis] for pt in aabbExtrema()]
coord_25,coord_50,coord_75=mm+.25*(mx-mm),mm+.5*(mx-mm),mm+.75*(mx-mm)
area_25,area_50,area_75=approxSectionArea(coord_25,axis),approxSectionArea(coord_50,axis),approxSectionArea(coord_75,axis)

O.engines=[
    ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intRadius,label='is2aabb'),],verletDist=.5*sphereRadius),
    InteractionLoop(

 [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intRadius,label='ss2sc')],
        [Ip2_CpmMat_CpmMat_CpmPhys()],
        [Law2_ScGeom_CpmPhys_Cpm()],
    ),
    NewtonIntegrator(damping=damping,label='damper'),
    CpmStateUpdater(realPeriod=.5),

UniaxialStrainer(strainRate=strainRateTension,axis=axis,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=False,blockRotations=False,setSpeeds=setSpeeds,label='strainer'),

PyRunner(virtPeriod=1e-6/strainRateTension,realPeriod=1,command='addPlotData()',label='plotDataCollector',initRun=True),
    PyRunner(realPeriod=4,command='stopIfDamaged()',label='damageChecker'),
]
#O.miscParams=[Gl1_CpmPhys(dmgLabel=False,colorStrain=False,epsNLabel=False,epsT=False,epsTAxes=False,normal=False,contactLine=True)]

# plot stresses in ¼, ½ and ¾ if desired as well; too crowded in the graph
that includes confinement, though
plot.plots={'eps':('sigma',)} #,'sigma.50')},'t':('eps')}
#'sigma.25','sigma.50','sigma.75')}

O.saveTmp('initial');

O.timingEnabled=False

global mode
mode='tension' if doModes & 1 else 'compression'

def initTest():
    global mode
    print "init"
    if O.iter>0:
        O.wait();
        O.loadTmp('initial')
        print "Reversing plot data"; plot.reverseData()
    else: plot.plot(subPlots=False)
    strainer.strainRate=abs(strainRateTension) if mode=='tension' else
-abs(strainRateCompression)
    try:
        from yade import qt
        renderer=qt.Renderer()
        renderer.dispScale=(1000,1000,1000) if mode=='tension' else
(100,100,100)
    except ImportError: pass
    print "init done, will now run."
    O.step(); # to create initial contacts
    # now reset the interaction radius and go ahead
    ss2sc.interactionDetectionFactor=1.
    is2aabb.aabbEnlargeFactor=1.

    O.run()

def stopIfDamaged():
    global mode
    if O.iter<2 or not plot.data.has_key('sigma'): return # do nothing at
the very beginning
    sigma,eps=plot.data['sigma'],plot.data['eps']
    extremum=max(sigma) if (strainer.strainRate>0) else min(sigma)
    minMaxRatio=0.5 if mode=='tension' else 0.5
    if extremum==0: return
    import sys; sys.stdout.flush()
    if abs(sigma[-1]/extremum)<minMaxRatio or abs(strainer.strain)>(5e-3 if
isoPrestress==0 else 5e-2):
        if mode=='tension' and doModes & 2: # only if compression is enabled
            mode='compression'
            O.save('/tmp/uniax-tension.yade.gz')
            print "Saved /tmp/uniax-tension.yade.gz (for use with
interaction-histogram.py and uniax-post.py)"
            print "Damaged, switching to compression... "; O.pause()
            # important! initTest must be launched in a separate thread;
            # otherwise O.load would wait for the iteration to finish,
            # but it would wait for initTest to return and deadlock would
result
            import thread; thread.start_new_thread(initTest,())
            return
        else:
            print "Damaged, stopping."
            ft,fc=max(sigma),min(sigma)
            print 'Strengths fc=%g, ft=%g, |fc/ft|=%g'%(fc,ft,abs(fc/ft))
            title=O.tags['description'] if 'description' in O.tags.keys()
else O.tags['params']
            print 'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)
            print 'Bye.'
            O.pause()
            #sys.exit(0) # results in some threading exception

def addPlotData():

yade.plot.addData({'t':O.time,'i':O.iter,'eps':strainer.strain,'sigma':strainer.avgStress+isoPrestress,

 'sigma.25':forcesOnCoordPlane(coord_25,axis)[axis]/area_25+isoPrestress,

 'sigma.50':forcesOnCoordPlane(coord_50,axis)[axis]/area_50+isoPrestress,

 'sigma.75':forcesOnCoordPlane(coord_75,axis)[axis]/area_75+isoPrestress,
        })
plot.plot(subPlots=False)
#O.run()
initTest()
waitIfBatch()

*Output on the Terminal*

Yade [1]: Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
import yadimport yade.plot; yade.plot.plot();Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in stopIfDamaged()
    158 print "Damaged, stopping."
    159 ft,fc=max(sigma),min(sigma)
--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))
    161 title=O.tags['description'] if
'description' in O.tags.keys() else O.tags['params']
    162 print
'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)

ZeroDivisionError: float division by zero
Damaged, stopping.
Strengths fc=-6.43719e+07, ft=133730, |fc/ft|=481.355
gnuplot 20180122T160351p1971.gnuplot
Bye.

Thanks,
-Anay

On Wed, Dec 20, 2017 at 3:38 AM, Launchpad Janitor <
<email address hidden>> wrote:

> Your question #661250 on Yade changed:
> https://answers.launchpad.net/yade/+question/661250
>
> Status: Open => Expired
>
> Launchpad Janitor expired the question:
> This question was expired because it remained in the 'Open' state
> without activity for the last 15 days.
>
> --
> If you're still having this problem, you can reopen your question either
> by replying to this email or by going to the following page and
> entering more information about your problem:
> https://answers.launchpad.net/yade/+question/661250
>
> You received this question notification because you asked the question.
>

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

Hello,

Surely, there is no need to post the same error 100s of times to this forum. Please avoid spamming the thread like this in the future.

The error says it all:

--> 160 print 'Strengths fc=%g, ft=%g,
|fc/ft|=%g'%(fc,ft,abs(fc/ft))

ZeroDivisionError: float division by zero

At line 160, it is encountering a float division by zero. You are dividing fc by ft. ft is defined as:

ft = max(sigma)

Since you are doing only compression, your maximum sigma is 0. You can do both modes by changing:

doModes=2 to 3.

Or you can just comment out line 160 if you want to keep doModes=2.

Best,

Robert

Revision history for this message
Anay Joshi (petronas) said :
#11

Hi Robert,
Thanks a lot for the help. I actually couldn't understand why is the error
occuring over and over again so thought it might have some meaning to it. I
will keep it in mind next time.

I really appreciate your help and patience with me.

Thanks,
Anay

On 24 Jan 2018 5:02 pm, "Robert Caulk" <email address hidden>
wrote:

> Your question #661250 on Yade changed:
> https://answers.launchpad.net/yade/+question/661250
>
> Status: Open => Answered
>
> Robert Caulk proposed the following answer:
> Hello,
>
> Surely, there is no need to post the same error 100s of times to this
> forum. Please avoid spamming the thread like this in the future.
>
> The error says it all:
>
> --> 160 print 'Strengths fc=%g, ft=%g,
> |fc/ft|=%g'%(fc,ft,abs(fc/ft))
>
> ZeroDivisionError: float division by zero
>
> At line 160, it is encountering a float division by zero. You are
> dividing fc by ft. ft is defined as:
>
> ft = max(sigma)
>
> Since you are doing only compression, your maximum sigma is 0. You can
> do both modes by changing:
>
> doModes=2 to 3.
>
> Or you can just comment out line 160 if you want to keep doModes=2.
>
> Best,
>
> Robert
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/yade/+question/661250/+confirm?answer_id=9
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/yade/+question/661250
>
> You received this question notification because you asked the question.
>

Revision history for this message
Best Luc Scholtès (luc) said :
#12

Wow... so many lines.

I would suggest that you use the following first batch of lines to get used to yade first. If you copy paste these lines in a file and name it "uniaxialCompression.py", you should then be able to run it with "yade uniaxialCompression.py". Basically, it simulates a uniaxial compression with the JCFPM model. Then, if you want to plot some data from the simulation, you can copy the second batch of lines, copy paste them in a file name "plotUniaxialCompression.py" and then launch it with "python plotUniaxialCompression.py".

Then, once you know how to run and exploit this simulation, you'll be able to modify the script with the contact law that suits you the most. If not, please ask a simple question with minimum lines and clear (short) title.

Luc

--- uniaxial compression:

# -*- coding: utf-8 -*-
from yade import pack, plot

################# SIMULATIONS DEFINED HERE

#### packing (previously constructed)
OUT='compressionTest_JCFPM'

#### Simulation Control
rate=-0.01 #deformation rate
iterMax=10000 # maximum number of iterations
saveVTK=2000 # saving output files for paraview

#### Material microproperties
intR=1.1 # allows near neighbour interaction (can be adjusted for every packing)
DENS=2500 # could be adapted to match material density: dens_DEM=dens_rock*(V_rock/V_particles)=dens_rock*1/(1-poro_DEM) -> packing porosity as to be computed?
YOUNG=20e9
FRICT=7
ALPHA=0.1
TENS=1e6
COH=1e6

#### material definition
def sphereMat(): return JCFpmMat(type=1,density=DENS,young=YOUNG,poisson=ALPHA,frictionAngle=radians(FRICT),tensileStrength=TENS,cohesion=COH)

#### create the specimen
pred=pack.inCylinder((0,0,0),(0,1,0),0.25)
O.bodies.append(pack.regularHexa(pred,radius=0.025,gap=0.,material=sphereMat))

R=0
Rmax=0
nbSpheres=0.
for o in O.bodies:
 if isinstance(o.shape,Sphere):
   nbSpheres+=1
   R+=o.shape.radius
   if o.shape.radius>Rmax:
     Rmax=o.shape.radius
Rmean=R/nbSpheres

print 'nbSpheres=',nbSpheres,' | Rmean=',Rmean

#### boundary condition (see utils.uniaxialTestFeatures
bb=utils.uniaxialTestFeatures()
negIds,posIds,longerAxis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']

################# ENGINES DEFINED HERE

O.engines=[
 ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intR,label='Saabb')]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR,label='SSgeom')],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1,label='interactionPhys')],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,Key=OUT,label='interactionLaw')]
 ),
 UniaxialStrainer(strainRate=rate,axis=longerAxis,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=1,blockRotations=1,setSpeeds=0,stopStrain=0.1,dead=1,label='strainer'),
 GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.5, defaultDt=utils.PWaveTimeStep()),
 NewtonIntegrator(damping=0.4,label='newton'),
 PyRunner(iterPeriod=int(100),initRun=True,command='recorder()',label='data'),
        VTKRecorder(iterPeriod=int(saveVTK),initRun=True,fileName=OUT+'-',recorders=['spheres','jcfpm','cracks'],Key=OUT,label='vtk')
]

################# RECORDER DEFINED HERE

def recorder():
    yade.plot.addData({'i':O.iter,
         'eps':strainer.strain,
         'sigma':strainer.avgStress,
         'tc':interactionLaw.nbTensCracks,
         'sc':interactionLaw.nbShearCracks,
         'te':interactionLaw.totalTensCracksE,
         'se':interactionLaw.totalShearCracksE,
         'unbF':utils.unbalancedForce()})
    plot.saveDataTxt(OUT)

# if you want to plot during simulation
plot.plots={'i':('sigma')}
#plot.plot()

################# PREPROCESSING

#### manage interaction detection factor during the first timestep and then set default interaction range ((cf. A DEM model for soft and hard rock, Scholtes & Donze, JMPS 2013))
O.step();
### initializes the interaction detection factor
SSgeom.interactionDetectionFactor=-1.
Saabb.aabbEnlargeFactor=-1.

#### coordination number verification
numSSlinks=0
numCohesivelinks=0
for i in O.interactions:
    if isinstance(O.bodies[i.id1].shape,Sphere) and isinstance(O.bodies[i.id2].shape,Sphere):
      numSSlinks+=1
    if i.phys.isCohesive :
      numCohesivelinks+=1

print "nblinks=", numSSlinks, " | nbCohesivelinks=", numCohesivelinks, " || Kcohesive=", 2.0*numCohesivelinks/nbSpheres

################# SIMULATION REALLY STARTS HERE
strainer.dead=0
O.run(iterMax)

--- plot uniaxial test data:

# -*- coding: utf-8 -*-
from pylab import *

### processing function
def store(var,textFile):
    data=loadtxt(textFile,skiprows=1)
    it=[]
    eps=[]
    sig=[]
    tc=[]
    sc=[]
    te=[]
    se=[]
    ubf=[]
    for i in range(0,len(data)):
      it.append(float(data[i,1]))
      eps.append(abs(float(data[i,0])))
      sig.append(abs(float(data[i,4])))
      tc.append(float(data[i,5]))
      sc.append(float(data[i,2]))
      te.append(float(data[i,6]))
      se.append(float(data[i,3]))
      ubf.append(float(data[i,7]))
    var.append(it)
    var.append(eps)
    var.append(sig)
    var.append(tc)
    var.append(sc)
    var.append(te)
    var.append(se)
    var.append(ubf)

### data input
dataFile1='compressionTest_JCFPM'

a1=[]
store(a1,dataFile1)

rcParams.update({'legend.numpoints':1,'font.size': 20,'axes.labelsize':25,'xtick.major.pad':10,'ytick.major.pad':10,'legend.fontsize':20})
lw=2
ms=10

### plots

figure(0,figsize=(10,10))
ax1=subplot(1,1,1)
xlabel('iteration [-]')
ax1.plot(a1[0],[x/1e6 for x in a1[2]],'-k',linewidth=lw)
ylabel(r'$\sigma_1$ [MPa]')
ax2 = ax1.twinx()
ax2.plot(a1[0],a1[5],'-r',linewidth=lw)
ylabel('unbForce [-]')

figure(1,figsize=(10,10))
ax1=subplot(1,1,1)
xlabel(r'$\epsilon_1$ [millistrain]')
plot([x*1e3 for x in a1[1]],[x/1e6 for x in a1[2]],'-k',linewidth=lw)
ylabel(r'$\sigma_1$ [MPa]')

figure(2,figsize=(10,10))
ax1=subplot(1,1,1)
xlabel(r'$\epsilon_1$ [millistrain]')
ax1.plot([x*1e3 for x in a1[1]],[x/1e6 for x in a1[2]],'-k',linewidth=lw)
ylabel(r'$\sigma_1$ [MPa]')
ax2 = ax1.twinx()
ax2.plot([x*1e3 for x in a1[1]],a1[3],'-b',linewidth=lw)
ax2.plot([x*1e3 for x in a1[1]],a1[4],'-r',linewidth=lw)
ylabel('cumulative number of microcracks [-]')
legend(('tensile','shear'),loc=2)

figure(3,figsize=(10,10))
ax1=subplot(1,1,1)
xlabel(r'$\epsilon_1$ [millistrain]')
ax1.plot([x*1e3 for x in a1[1]],[x/1e6 for x in a1[2]],'-k',linewidth=lw)
ylabel(r'$\sigma_1$ [MPa]')
ax2 = ax1.twinx()
ax2.plot([x*1e3 for x in a1[1]],[x+y for x,y in zip(a1[5],a1[6])],'-r',linewidth=lw)
ylabel('released energy [J]')

### show or save
show()

Revision history for this message
Anay Joshi (petronas) said :
#13

Hi Luc,
Thanks a lot for this descriptive information. I have a few more questions
to ask,
1. I read your paper, ' A DEM model for soft and hard rocks: Role of grain
interlocking on strength' in which you have modeled the granite. However, I
am modeling a concrete cylinder in my work. I have read in several
literatures that they used the bonded particle model (Cundall,2004). My
question is, can I use JCFpm for modeling concrete?

2. I am running the simulation on the remote servers and I would like to
know that is there any way to see the time-dependent animation of the whole
process of my simulation? Also, can you suggest me how to see the
streamlines of the DE with the yade?

Thanks,
Anay

On Wed, Jan 24, 2018 at 9:37 PM, Luc Scholtès <
<email address hidden>> wrote:

> Your question #661250 on Yade changed:
> https://answers.launchpad.net/yade/+question/661250
>
> Status: Open => Answered
>
> Luc Scholtès proposed the following answer:
> Wow... so many lines.
>
> I would suggest that you use the following first batch of lines to get
> used to yade first. If you copy paste these lines in a file and name it
> "uniaxialCompression.py", you should then be able to run it with "yade
> uniaxialCompression.py". Basically, it simulates a uniaxial compression
> with the JCFPM model. Then, if you want to plot some data from the
> simulation, you can copy the second batch of lines, copy paste them in a
> file name "plotUniaxialCompression.py" and then launch it with "python
> plotUniaxialCompression.py".
>
> Then, once you know how to run and exploit this simulation, you'll be
> able to modify the script with the contact law that suits you the most.
> If not, please ask a simple question with minimum lines and clear
> (short) title.
>
> Luc
>
> --- uniaxial compression:
>
> # -*- coding: utf-8 -*-
> from yade import pack, plot
>
> ################# SIMULATIONS DEFINED HERE
>
> #### packing (previously constructed)
> OUT='compressionTest_JCFPM'
>
> #### Simulation Control
> rate=-0.01 #deformation rate
> iterMax=10000 # maximum number of iterations
> saveVTK=2000 # saving output files for paraview
>
> #### Material microproperties
> intR=1.1 # allows near neighbour interaction (can be adjusted for every
> packing)
> DENS=2500 # could be adapted to match material density:
> dens_DEM=dens_rock*(V_rock/V_particles)=dens_rock*1/(1-poro_DEM) ->
> packing porosity as to be computed?
> YOUNG=20e9
> FRICT=7
> ALPHA=0.1
> TENS=1e6
> COH=1e6
>
> #### material definition
> def sphereMat(): return JCFpmMat(type=1,density=DENS,
> young=YOUNG,poisson=ALPHA,frictionAngle=radians(FRICT),
> tensileStrength=TENS,cohesion=COH)
>
> #### create the specimen
> pred=pack.inCylinder((0,0,0),(0,1,0),0.25)
> O.bodies.append(pack.regularHexa(pred,radius=0.025,
> gap=0.,material=sphereMat))
>
> R=0
> Rmax=0
> nbSpheres=0.
> for o in O.bodies:
> if isinstance(o.shape,Sphere):
> nbSpheres+=1
> R+=o.shape.radius
> if o.shape.radius>Rmax:
> Rmax=o.shape.radius
> Rmean=R/nbSpheres
>
> print 'nbSpheres=',nbSpheres,' | Rmean=',Rmean
>
> #### boundary condition (see utils.uniaxialTestFeatures
> bb=utils.uniaxialTestFeatures()
> negIds,posIds,longerAxis,crossSectionArea=bb['negIds'],
> bb['posIds'],bb['axis'],bb['area']
>
> ################# ENGINES DEFINED HERE
>
> O.engines=[
> ForceResetter(),
> InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=
> intR,label='Saabb')]),
> InteractionLoop(
> [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=
> intR,label='SSgeom')],
> [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(
> cohesiveTresholdIteration=1,label='interactionPhys')],
> [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(
> recordCracks=True,Key=OUT,label='interactionLaw')]
> ),
> UniaxialStrainer(strainRate=rate,axis=longerAxis,
> asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,
> blockDisplacements=1,blockRotations=1,setSpeeds=0,
> stopStrain=0.1,dead=1,label='strainer'),
> GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.5,
> defaultDt=utils.PWaveTimeStep()),
> NewtonIntegrator(damping=0.4,label='newton'),
> PyRunner(iterPeriod=int(100),initRun=True,command='
> recorder()',label='data'),
> VTKRecorder(iterPeriod=int(saveVTK),initRun=True,
> fileName=OUT+'-',recorders=['spheres','jcfpm','cracks'],
> Key=OUT,label='vtk')
> ]
>
> ################# RECORDER DEFINED HERE
>
> def recorder():
> yade.plot.addData({'i':O.iter,
> 'eps':strainer.strain,
> 'sigma':strainer.avgStress,
> 'tc':interactionLaw.nbTensCracks,
> 'sc':interactionLaw.nbShearCracks,
> 'te':interactionLaw.totalTensCracksE,
> 'se':interactionLaw.totalShearCracksE,
> 'unbF':utils.unbalancedForce()})
> plot.saveDataTxt(OUT)
>
> # if you want to plot during simulation
> plot.plots={'i':('sigma')}
> #plot.plot()
>
> ################# PREPROCESSING
>
> #### manage interaction detection factor during the first timestep and
> then set default interaction range ((cf. A DEM model for soft and hard
> rock, Scholtes & Donze, JMPS 2013))
> O.step();
> ### initializes the interaction detection factor
> SSgeom.interactionDetectionFactor=-1.
> Saabb.aabbEnlargeFactor=-1.
>
> #### coordination number verification
> numSSlinks=0
> numCohesivelinks=0
> for i in O.interactions:
> if isinstance(O.bodies[i.id1].shape,Sphere) and
> isinstance(O.bodies[i.id2].shape,Sphere):
> numSSlinks+=1
> if i.phys.isCohesive :
> numCohesivelinks+=1
>
> print "nblinks=", numSSlinks, " | nbCohesivelinks=", numCohesivelinks, "
> || Kcohesive=", 2.0*numCohesivelinks/nbSpheres
>
> ################# SIMULATION REALLY STARTS HERE
> strainer.dead=0
> O.run(iterMax)
>
> --- plot uniaxial test data:
>
> # -*- coding: utf-8 -*-
> from pylab import *
>
> ### processing function
> def store(var,textFile):
> data=loadtxt(textFile,skiprows=1)
> it=[]
> eps=[]
> sig=[]
> tc=[]
> sc=[]
> te=[]
> se=[]
> ubf=[]
> for i in range(0,len(data)):
> it.append(float(data[i,1]))
> eps.append(abs(float(data[i,0])))
> sig.append(abs(float(data[i,4])))
> tc.append(float(data[i,5]))
> sc.append(float(data[i,2]))
> te.append(float(data[i,6]))
> se.append(float(data[i,3]))
> ubf.append(float(data[i,7]))
> var.append(it)
> var.append(eps)
> var.append(sig)
> var.append(tc)
> var.append(sc)
> var.append(te)
> var.append(se)
> var.append(ubf)
>
> ### data input
> dataFile1='compressionTest_JCFPM'
>
> a1=[]
> store(a1,dataFile1)
>
> rcParams.update({'legend.numpoints':1,'font.size':
> 20,'axes.labelsize':25,'xtick.major.pad':10,'ytick.major.
> pad':10,'legend.fontsize':20})
> lw=2
> ms=10
>
> ### plots
>
> figure(0,figsize=(10,10))
> ax1=subplot(1,1,1)
> xlabel('iteration [-]')
> ax1.plot(a1[0],[x/1e6 for x in a1[2]],'-k',linewidth=lw)
> ylabel(r'$\sigma_1$ [MPa]')
> ax2 = ax1.twinx()
> ax2.plot(a1[0],a1[5],'-r',linewidth=lw)
> ylabel('unbForce [-]')
>
> figure(1,figsize=(10,10))
> ax1=subplot(1,1,1)
> xlabel(r'$\epsilon_1$ [millistrain]')
> plot([x*1e3 for x in a1[1]],[x/1e6 for x in a1[2]],'-k',linewidth=lw)
> ylabel(r'$\sigma_1$ [MPa]')
>
> figure(2,figsize=(10,10))
> ax1=subplot(1,1,1)
> xlabel(r'$\epsilon_1$ [millistrain]')
> ax1.plot([x*1e3 for x in a1[1]],[x/1e6 for x in a1[2]],'-k',linewidth=lw)
> ylabel(r'$\sigma_1$ [MPa]')
> ax2 = ax1.twinx()
> ax2.plot([x*1e3 for x in a1[1]],a1[3],'-b',linewidth=lw)
> ax2.plot([x*1e3 for x in a1[1]],a1[4],'-r',linewidth=lw)
> ylabel('cumulative number of microcracks [-]')
> legend(('tensile','shear'),loc=2)
>
> figure(3,figsize=(10,10))
> ax1=subplot(1,1,1)
> xlabel(r'$\epsilon_1$ [millistrain]')
> ax1.plot([x*1e3 for x in a1[1]],[x/1e6 for x in a1[2]],'-k',linewidth=lw)
> ylabel(r'$\sigma_1$ [MPa]')
> ax2 = ax1.twinx()
> ax2.plot([x*1e3 for x in a1[1]],[x+y for x,y in zip(a1[5],a1[6])],'-r',
> linewidth=lw)
> ylabel('released energy [J]')
>
> ### show or save
> show()
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/yade/+question/661250/+confirm?answer_id=11
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/yade/+question/661250
>
> You received this question notification because you asked the question.
>

Revision history for this message
Anay Joshi (petronas) said :
#14

Thanks Luc Scholtès, that solved my question.