← Back to team overview

yade-dev team mailing list archive

Re: ContactLaw1

 

Václav S(milauer said:     (by the date of Sat, 27 Sep 2008 12:31:56 +0200)

> 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.

Yes, this solution is much better. Care to split the laws into such
parts? This would make all those laws a lot simpler.

I was telling him the solution which is currently being used. bool
flags (and an evergrowing law file) is a little better than 200 lines of
code (with possible bugs) duplicated in several places.

But of course splitting the laws into several independent files
is *A LOT* better.



> >   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.

och. I didn't tknow that he is doing something that belongs to SpheresContactGeometry (I didn't look at this code, to be honest, sorry).

If you say that his "extra" changes from my law should be done in SpheresContactGeometry - then move them there of course :)


> How about
> someone needing a completely different law (my own Brefcom comes in
> mind), not just a bool flag in existing one?

then of course it must be a new law :) Lattice is another example :>

-- 
Janek Kozicki                                                         |



Follow ups

References