Not able to understand the error

Asked by Anay Joshi

Hi,
I am simulating a uniaxial compression of a concrete cylinder in yade. I am Using the uniax.py reference code from the github and I am editing that as per my problem. I have edited the code to use the JCFpm model for the cohesion. I am copying the code and the error i am getting in the following.

CODE:

#!/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}')

# 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=.01,
 strainRateCompression=.01,
 setSpeeds=True,
 # 1=tension, 2=compression (ANDed; 3=both)
 doModes=2,

 specimenLength=.08,
 sphereRadius=1.25e-3,

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

)

from yade.params.table import *
from yade import pack, plot

#############################Simulation Control#################################

rate =-0.01 #Deformation rate
iterMax = 10000 #Maximum number of iterations
saveVTK = 2000 #Opt files for paraview

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

rad = 5
# 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

############################# Material Definition ##############################
concreteId=O.materials.append(JCFpmMat(type=1,young=young,frictionAngle=frictionAngle,poisson=poisson,density=2400,sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=epsCrackOnset,isoPrestress=isoPrestress,cohesion=1e6))

sps=SpherePack()
sp=pack.randomDensePack(pack.inCylinder((0,0,1),(0,0,1.080), 0.01*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)

########################### Engines are defined here ###########################
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intRadius,label='is2aabb'),],verletDist=.5*sphereRadius),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intRadius,label='ss2sc')],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1, label='interactionPhys')],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True, Key=Out, label='interactionLaw')],
 ),
 NewtonIntegrator(damping=damping,label='damper'),
 #CpmStateUpdater(realPeriod=.5),
 UniaxialStrainer(strainRate=strainRateCompression,axis=axis,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=1,blockRotations=1,setSpeeds=setSpeeds, stopStrain=0.1, dead=1, label='strainer'),
 GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.5, defaultDt=utils.PWaveTimeStep()),
 PyRunner(virtPeriod=1e-6/strainRateCompression,realPeriod=1,command='addPlotData()',label='plotDataCollector',initRun=True),
 PyRunner(realPeriod=4,command='stopIfDamaged()',label='damageChecker'),
  VTKRecorder(iterPeriod=int(saveVTK),initRun=True,fileName=OUT+'-',recorders=['spheres','jcfpm','cracks'],Key=OUT,label='vtk')
]
#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

#Recorder and Plot
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)

#############intraction detection#################
   # interaction range ((cf. A DEM model for soft and hard rock, Scholtes & Donze, JMPS 2013))
O.step();

#plot.plots={'eps':('sigma',)} #,'sigma.50')},'t':('eps')} Plot during the simulation #'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)
strainer.dead=0
#O.run()
initTest()
waitIfBatch()

        ERROR:

 File "/apps/pkg/yade-2017.01a/rhel7_u2-x86_64/gnu/bin/yade-2017.01a", line 182, in runScript
    execfile(script,globals())
File "uniax_0.5mm_jcfpm.py", line 86, in <module>
 concreteId=O.materials.append(JCFpmMat(type=1,young=young,frictionAngle=frictionAngle,poisson=poisson,density=2400,sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=epsCrackOnset,isoPrestress=isoPrestress,cohesion=1e6))
AttributeError: No such attribute: epsCrackOnset.

I am fairly a new user to this, can anyone help me understand and suggest the solution for this?

My second question is,
Is JCFpm be the appropriate method for modeling the concrete? I planned to use the Bonded particle model (Cundal, 2004) for the cohesion but here on this portal, Luc Scholtes suggested that JCFpm is actually better than BPM. Can anyone suggest me on the which method would be appropriate?

Thanks,
Anay

Question information

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

Hello Anay,

The error says it all: JCFpmMat does not have the attribute named epsCrackOnset. While we are looking at material attributes, JCFpmMat does not have relDuctility or isoPrestress. Further, the tensile strength attribute is assigned by tensileStrength, not sigmaT. Since JCFpm does not have these attributes, Yade tries to assign values to attributes that do not exist, and then Yade (Python really) throws the error. I know it is difficult to keep track of all the variously named attributes for all the different Yade materials, and therefore I would encourage you to refer to the Yade class reference to find the available specific class attributes [1]. Hey, you might find some hidden attributes that will help you decide if the material is suitable for what you want to model!

To fix this error, you should remove these attributes from the list:

concreteId=O.materials.append(JCFpmMat(type=1,young=young,frictionAngle=frictionAngle,poisson=poisson,density=2400,cohesion=1e6))

>Is JCFpm be the appropriate method for modeling the concrete? I planned to use the Bonded particle >model (Cundal, 2004) for the cohesion but here on this portal, Luc Scholtes suggested that JCFpm is >actually better than BPM. Can anyone suggest me on the which method would be appropriate?

Well, JCFpm is simply a modified version of BPM IINM. I guess I will just answer your question with a question: Should your concrete model rely on an interparticle frictional mohr coulomb model to determine the shear strength of the particle bonds? If so, JCFpm is great for you.

And for completeness: Yade has a specific concrete model named "CpmMat" which is designed specifically for concrete [2].

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.JCFpmMat
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.CpmMat

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

Hello Anay,

I don't remember saying that the jcfpm is "better" than the bonded particle model of Potyondy and Cundall for modelling concrete... The thing is that the bonded particle model of Potyondy and Cundall is not available in YADE since it is a model available in PFC so that's probably why I suggested you to use the jcfpm. From my experience, the jcfpm works pretty well for modelling brittle materials since it enables to simulate high ratios of compressive to tensile strengths and non linear failure envelopes (is that what you are looking for?). Actually, the jcfpm is very similar to the contact bond model of PFC, with the "extra" possibility to define near neighbor interactions.

Now, as mentioned by Robert, you need to have a look a the doc in order to defined correctly the attributes of JCFPM:

https://yade-dem.org/doc/yade.wrapper.html?highlight=jcfpm#yade.wrapper.JCFpmMat

It seems that you copy pasted something from a cpm example script in the following line

concreteId=O.materials.append(JCFpmMat(type=1,young=young,frictionAngle=frictionAngle,poisson=poisson,density=2400,sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=epsCrackOnset,isoPrestress=isoPrestress,cohesion=1e6))

and, of course, it does not work since all these attributes are not defined in the jcfpm.

Luc

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

Hi Robert,
I appreciate the response I receive on this portal. It is very informative and appropriate to the questions I ask. Thanks for the links you have provided for me to know my model.

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

Hi Luc,

"It seems that you copy pasted something from a cpm example script "
Actually, yes! Since I am just starting to learn the Yade software, I am collecting things from different scripts I am able to access. Thanks a lot for suggesting the reference to look at.

I do have some additional questions regarding the display in yade.
I am simulating my model on the supercomputing servers and so when the simulation is complete, I receive a ".bz2" and a ".gnu" files as the output. My question is, how do I see the iterative animation of the simulation which has been completed. Also, is there any way to see the streamlines of the particle movement (I see that you have some images of streamlines in your paper)? Could you suggest me how to do that along with other capabilities of the "Display module in yade"?

I would really appreciate your kind help.

Thanks,
Anay

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#5

Dear Anay, please try to keep each launchpad thread focused on one single question.
It is too demanding to ask so many things in your last paragraph. The documentation has some content on this that you better check first. Then if specific question remains come back here and a open a _new_ question.
Regards
Bruno

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#6

(and please remember to mark questions "answered" when they are :) )

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

Hi Bruno,
My sincere apologies. I will keep this in mind from the next time.

Thanks,
Anay

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

Hi Anay,

Did you actually try to run the script that I gave you in #12 of the following thread:

https://answers.launchpad.net/yade/+question/661250

?

If not, I strongly suggest that you do so and I copy paste it here once again (please read the entire message since I add some comments for you after the script):

--- BEGINNING OF SCRIPT ---

# -*- 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
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)

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

#### manage interaction detection factor during the first timestep and then set default interaction range
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)

--- END OF SCRIPT ---

This script corresponds to a uniaxial test on a cylinder (which is what you want to achieve if I understood well). At the end of the simulation, you will obtain a text file "compressionTest_JCFPM" containing the simulation data (stress, strain, number of cracks, ...) that you can plot with the second script I gave you in (https://answers.launchpad.net/yade/+question/661250) and some vtu/vtk files which you can then use to visualize your results with Paraview (you will have access to the particles, the cracks and the interaction network). The "streamlines" you mention are, I guess, the displacement of the particles. For that, there is a procedure in Paraview which consists in comparing 2 vtu files (basically, you have to compute the displacement by substracting the positions at t2 and t1). As mentioned by Bruno, this is a different question.

Luc

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

Hi Luc,
First of all, thank you very much for providing the script to run with yade
and helping with the display of simulation question. I really appreciate
the help you provide.

Secondly,I tried to run the script you have provided here, but it gave me
an error. I am posting the error here, can you help me with it?

Error:
Welcome to Yade 1.20.0
TCP python prompt on localhost:9000, auth cookie `dcsuek'
XMLRPC info provider on http://localhost:21000
Running script JCFpm_luc_ref.py
Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
    execfile(script,globals())
  File "JCFpm_luc_ref.py", line 94
    print "nblinks=", numSSlinks, " | nbCohesivelinks=", numCohesivelinks, "
                                                                           ^
SyntaxError: EOL while scanning string literal

Thanks,
Anay

On Wed, Feb 21, 2018 at 4:22 AM, Luc Scholtès <
<email address hidden>> wrote:

> Your question #664499 on Yade changed:
> https://answers.launchpad.net/yade/+question/664499
>
> Luc Scholtès posted a new comment:
> Hi Anay,
>
> Did you actually try to run the script that I gave you in #12 of the
> following thread:
>
> https://answers.launchpad.net/yade/+question/661250
>
> ?
>
> If not, I strongly suggest that you do so and I copy paste it here once
> again (please read the entire message since I add some comments for you
> after the script):
>
> --- BEGINNING OF SCRIPT ---
>
> # -*- 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
> 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)
>
> ################# PREPROCESSING
>
> #### manage interaction detection factor during the first timestep and
> then set default interaction range
> 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)
>
> --- END OF SCRIPT ---
>
> This script corresponds to a uniaxial test on a cylinder (which is what
> you want to achieve if I understood well). At the end of the simulation,
> you will obtain a text file "compressionTest_JCFPM" containing the
> simulation data (stress, strain, number of cracks, ...) that you can
> plot with the second script I gave you in
> (https://answers.launchpad.net/yade/+question/661250) and some vtu/vtk
> files which you can then use to visualize your results with Paraview
> (you will have access to the particles, the cracks and the interaction
> network). The "streamlines" you mention are, I guess, the displacement
> of the particles. For that, there is a procedure in Paraview which
> consists in comparing 2 vtu files (basically, you have to compute the
> displacement by substracting the positions at t2 and t1). As mentioned
> by Bruno, this is a different question.
>
> Luc
>
> --
> You received this question notification because you asked the question.
>

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

Hi Anay,

I am sorry but I am not able to reproduce the error on my side.

I verified it once again: I copied the lines contained between --- BEGINNING OF SCRIPT --- and --- END OF SCRIPT --- and pasted them into a blank file which I then saved with the extension .py. Launching the resulting script with yade by typing yade nameOfScript.py, I have the simulation running without any problem.

My guess is that you did not copy pasted the lines correctly (the error is a Python related error if I am not misleading).

Sorry, I cannot really help more than that.

Luc

Revision history for this message
Jérôme Duriez (jduriez) said :
#11

Hi Anay,

Copying / pasting Luc's script, you splitted into two the following line

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

Quite basic Python knowledge (regarding string manipulation and print Python function) tells us your incomplete line is then bound to throw an error (the " " string delimiters are unbalanced)

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

Hi Luc,
I'll try again and let you know if I am able to get the script running.

Thanks,
Anay

On 22 Feb 2018 5:53 am, "Luc Scholtès" <email address hidden>
wrote:

> Your question #664499 on Yade changed:
> https://answers.launchpad.net/yade/+question/664499
>
> Luc Scholtès posted a new comment:
> Hi Anay,
>
> I am sorry but I am not able to reproduce the error on my side.
>
> I verified it once again: I copied the lines contained between ---
> BEGINNING OF SCRIPT --- and --- END OF SCRIPT --- and pasted them into a
> blank file which I then saved with the extension .py. Launching the
> resulting script with yade by typing yade nameOfScript.py, I have the
> simulation running without any problem.
>
> My guess is that you did not copy pasted the lines correctly (the error
> is a Python related error if I am not misleading).
>
> Sorry, I cannot really help more than that.
>
> Luc
>
> --
> You received this question notification because you asked the question.
>

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

Hi Jerome,
Thanks for pointing out the possible error cause. I was wondering if you
could suggest the corrective measure?

Thanks,
Anay

On 22 Feb 2018 6:53 am, "Jérôme Duriez" <
<email address hidden>> wrote:

> Your question #664499 on Yade changed:
> https://answers.launchpad.net/yade/+question/664499
>
> Jérôme Duriez posted a new comment:
> Hi Anay,
>
> Copying / pasting Luc's script, you splitted into two the following line
>
> "print "nblinks=", numSSlinks, " | nbCohesivelinks=", numCohesivelinks,
> " || Kcohesive=", 2.0*numCohesivelinks/nbSpheres"
>
> Quite basic Python knowledge (regarding string manipulation and print
> Python function) tells us your incomplete line is then bound to throw an
> error (the " " string delimiters are unbalanced)
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
Jérôme Duriez (jduriez) said :
#14

Since the error cause was breaking the above-mentioned (in #11) unique command line into two (incomplete) lines, maybe re-binding these two lines into one would help ? ;-)

Since it is just about messages output, you may also remove these two lines without affecting your simulation

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

Hi Jerome,
Thanks for the solution. I will try that and let you know. I really
appreciate this.

Thanks,
Anay

On 23 Feb 2018 4:13 am, "Jérôme Duriez" <
<email address hidden>> wrote:

> Your question #664499 on Yade changed:
> https://answers.launchpad.net/yade/+question/664499
>
> Jérôme Duriez posted a new comment:
> Since the error cause was breaking the above-mentioned (in #11) unique
> command line into two (incomplete) lines, maybe re-binding these two
> lines into one would help ? ;-)
>
> Since it is just about messages output, you may also remove these two
> lines without affecting your simulation
>
> --
> You received this question notification because you asked the question.
>

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

Hi Luc,
After making a few basic python changes to the code, I got it working.
Thanks a lot for such an extensive script to help me with.

Thanks,
Anay

On Fri, Feb 23, 2018 at 7:13 AM, Anay Joshi <
<email address hidden>> wrote:

> Your question #664499 on Yade changed:
> https://answers.launchpad.net/yade/+question/664499
>
> Anay Joshi posted a new comment:
> Hi Jerome,
> Thanks for the solution. I will try that and let you know. I really
> appreciate this.
>
>
>
> Thanks,
> Anay
>
> On 23 Feb 2018 4:13 am, "Jérôme Duriez" <
> <email address hidden>> wrote:
>
> > Your question #664499 on Yade changed:
> > https://answers.launchpad.net/yade/+question/664499
> >
> > Jérôme Duriez posted a new comment:
> > Since the error cause was breaking the above-mentioned (in #11) unique
> > command line into two (incomplete) lines, maybe re-binding these two
> > lines into one would help ? ;-)
> >
> > Since it is just about messages output, you may also remove these two
> > lines without affecting your simulation
> >
> > --
> > You received this question notification because you asked the question.
> >
>
> --
> You received this question notification because you asked the question.
>