← Back to team overview

yade-users team mailing list archive

Re: [Question #295301]: calculate external work in Uniaxial Strainer

 

Question #295301 on Yade changed:
https://answers.launchpad.net/yade/+question/295301

Yor1 posted a new comment:
Hi Jan,

I compute the elastic energy in the recorder (in the script) with these
lines:

for i in O.interactions:
      if not i.isReal : continue
      E+=0.5*(i.phys.normalForce.squaredNorm()/i.phys.kn + i.phys.shearForce.squaredNorm()/i.phys.ks)

With these lines i guarantee that i calculate the elastic energy in all
contacts (contact between spheres, contact between sphere and wall, etc
...)

For the external work i try to compute it in the sources in
https://github.com/yade/trunk/blob/master/pkg/dem/UniaxialStrainer.cpp#L106

if(asymmetry==0){
dAX*=.5;displacement=2*dAX;externalWork+=displacement(sumPosForces+sumNegForces)/2;externalWork+=externalWork;}

Best regards.
Jabrane.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.