← Back to team overview

yade-dev team mailing list archive

Re: [deprecated list] ContactLaw1

 

> So it is better if you simply modify CohesiveFrictionalContactLaw by
> adding:
>
> - a new bool veriable to control if 'inelastic behaviour in
>   compression' is used. 
>
> - Then put your inelastic code in there inside block:
>
>   if(inelastic behaviour in compression) // pick any name you want for this bool :)
>   {
>     //.... your law here !
>   }
>   
I disagree with this approach. The code that computes mutual rotation
etc. is geometry problem and should be coded once in
SpheresContactGeometry and not in cohesive frictional law. How about
someone needing a completely different law (my own Brefcom comes in
mind), not just a bool flag in existing one?

Constitutive law (normally) is a function that converts from strains to
streses (or displacements to forces) and I think it should do _just_ that.
> This already happened few times, when I was working with Bruno. And
> we had to fix the same calculation bug in several files (with law) - it
> is hard to remember about all those laws! The less the better: we are
> less likely to forgot that other file has the same bug.
>   
If the constitutive law is simple as

// loop over interactions etc
Fn=contactGeom->strainN()*crossSection*E;
Ft=contactGeom->strainT()*crossSection*G;
// apply forces here

the code for computing strain being elsewhere, then that code is still
in one place (and can be fixed at one place) and the constitutive law is
not a mess of flags.

V.



Follow ups

References