calculate the overall energy in JCFpmMat

Asked by Xavier Thurman

Hi,

https://answers.launchpad.net/yade/+question/632448, in this thread, totalShearCracksE was introduced.
I add this into my simulation, but got an error:

AttributeError: No such attribute: totalShearCracksE

My code segment is as follows:

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.0),Bo1_Box_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.0),Ig2_Box_Sphere_ScGeom()],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,totalShearCracksE=0.,totalTensCracksE=0.)]
 ),
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
 NewtonIntegrator(damping=0.6,gravity=(0,0,-9.8)),
 PyRunner(command='addPlotData()',iterPeriod=100),

]
O.trackEnergy=True
O.step()

def addPlotData():
     Dis = -wall.state.displ()[2]
    shearE = totalShearCracksE
    tensileE = totalTensCracksE
    plot.addData(Dis=Dis,sE=shearE,tE=tensileE)
plot.plots={'Dis':('shearE','tensileE')}
plot.plot()

I am a new user of Yade, thus this question may be a very easy one, but it beyonds my capability.

Thanks for your help,
Xavier

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 Xavier,

Are you using the basic yade package or yadedaily. I am not sure that this functionality is yet in yadedaily, but it is more likely to be in yadedaily [1] than the basic yade considering how new it is.

I am sure, however, that you can access this functionality by compiling from sources [2].

Best,

Robert

[1]https://yade-dem.org/doc/installation.html#packages
[2]https://yade-dem.org/doc/installation.html#source-code

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

Hi Xavier,

In addition to Robert's comment I must say that you need to call the functionality correctly.

Yade does not "know" what is totalShearCracksE if you don't mention that it is coming from the law functor.

You have to:

1) define a label for the law functor:

Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True, label='lawFunctor')

2) call it using:

lawFunctor.totalShearCracksE

I thought I uploaded a working script to illustrate this when I commited this functionality but it does not appear in the /examples/jointedFrictionalPM directory... I'll try another time.

Luc

Revision history for this message
Xavier Thurman (xavierthurman) said :
#3

Thanks Luc Scholtès, that solved my question.