get python-access to energy information of Hertz-Mindlin contact model

Asked by Christian Jakob on 2013-04-10

Hi,

I want to investigate energy dissipation by damping and friction with Hertz-Mindlin model. I modified examples/simple-scene/simple-scene-energy-tracking.py a little bit:

...
O.trackEnergy=True
O.engines=[
 ...
  [Ip2_FrictMat_FrictMat_MindlinPhys(betan=0.9,betas=0.9,label='ContactModel')],
  [Law2_ScGeom_MindlinPhys_Mindlin(neverErase=False,label='Mindlin')]#,calcEnergy=True)]
 ),
 ...
]

...

Mindlin.calcEnergy=True
def myAddPlotData():
 normal_Work = Mindlin.normElastEnergy()
 shear_Work = Mindlin.shearEnergy()
 norm_damp_dissip = Mindlin.normDampDissip()
 shear_damp_dissip = Mindlin.shearDampDissip()
 fric_dissip = Mindlin.frictionDissipation()

...

Now I am facing a TypeError: 'float' object is not callable

Looking at the source code [1] gives me the hint, that these informations are not defined as usual ...

((OpenMPAccumulator<Real>,frictionDissipation,,Attr::noSave,"Energy dissipation due to sliding"))
((OpenMPAccumulator<Real>,shearEnergy,,Attr::noSave,"Shear elastic potential energy"))
((OpenMPAccumulator<Real>,normDampDissip,,Attr::noSave,"Energy dissipated by normal damping"))
((OpenMPAccumulator<Real>,shearDampDissip,,Attr::noSave,"Energy dissipated by tangential damping"))

[1] https://github.com/yade/trunk/blob/master/pkg/dem/HertzMindlin.hpp#L146

Regards,

christian

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Christian Jakob
Solved:
2013-04-10
Last query:
2013-04-10
Last reply:
2013-04-10
Anton Gladky (gladky-anton) said : #1

Does it work without brackets?

 norm_damp_dissip = Mindlin.normDampDissip
 shear_damp_dissip = Mindlin.shearDampDissip

Anton

2013/4/10 Christian Jakob <email address hidden>:
> New question #226370 on Yade:
> https://answers.launchpad.net/yade/+question/226370
>
> Hi,
>
> I want to investigate energy dissipation by damping and friction with Hertz-Mindlin model. I modified examples/simple-scene/simple-scene-energy-tracking.py a little bit:
>
> ...
> O.trackEnergy=True
> O.engines=[
> ...
> [Ip2_FrictMat_FrictMat_MindlinPhys(betan=0.9,betas=0.9,label='ContactModel')],
> [Law2_ScGeom_MindlinPhys_Mindlin(neverErase=False,label='Mindlin')]#,calcEnergy=True)]
> ),
> ...
> ]
>
> ...
>
> Mindlin.calcEnergy=True
> def myAddPlotData():
> normal_Work = Mindlin.normElastEnergy()
> shear_Work = Mindlin.shearEnergy()
> norm_damp_dissip = Mindlin.normDampDissip()
> shear_damp_dissip = Mindlin.shearDampDissip()
> fric_dissip = Mindlin.frictionDissipation()
>
> ...
>
> Now I am facing a TypeError: 'float' object is not callable
>
> Looking at the source code [1] gives me the hint, that these informations are not defined as usual ...
>
> ((OpenMPAccumulator<Real>,frictionDissipation,,Attr::noSave,"Energy dissipation due to sliding"))
> ((OpenMPAccumulator<Real>,shearEnergy,,Attr::noSave,"Shear elastic potential energy"))
> ((OpenMPAccumulator<Real>,normDampDissip,,Attr::noSave,"Energy dissipated by normal damping"))
> ((OpenMPAccumulator<Real>,shearDampDissip,,Attr::noSave,"Energy dissipated by tangential damping"))
>
> [1] https://github.com/yade/trunk/blob/master/pkg/dem/HertzMindlin.hpp#L146
>
> Regards,
>
> christian
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp

Christian Jakob (jakob-ifgt) said : #2

Yes, thanks anton.