← Back to team overview

yade-users team mailing list archive

Re: [Question #251218]: Modifying the Cohesive Frictional Contact Law

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Behzad,

quite nice example of this is CohFrictPhys itself. You can see all the way
from IPhys [1], NormPhys [2], NormShearPhys [3], FrictPhys [4] and
CohFrictPhys [5]. In every new class there are some new attributes
added(sometimes just one) and attributes from base classes are not
declared, but inherited.

So FrictPhys has parameters kn and ks (and others) without explicitly
declaring them in FrictPhys itself.

cheers
Jan

[1]
http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/view/head:/core/IPhys.hpp#L16
[2]
http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/view/head:/pkg/common/NormShearPhys.hpp#L9
[3]
http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/view/head:/pkg/common/NormShearPhys.hpp#L19
[4]
http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/view/head:/pkg/dem/FrictPhys.hpp#L15
[5]
http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/view/head:/pkg/dem/CohesiveFrictionalContactLaw.hpp#L46


2014-10-08 20:26 GMT+02:00 behzad
<question251218@xxxxxxxxxxxxxxxxxxxxx>:

> Question #251218 on Yade changed:
> https://answers.launchpad.net/yade/+question/251218
>
>     Status: Answered => Open
>
> behzad is still having a problem:
> Hi,
>
> So, just to wrap up I ask the last question.
> How do you inherit a new class from a parent class without duplicating the
> parameters. Let's say we want the new class to have only one new parameter.
> How do we do this? If I learn this I can apply it to all changes I need to
> make for material, Phys, Law and etc. I appreciate if you can show this
> with an example like CohBurgersPhys and CohFrictPhys. Let's say
> CohBurgersPhys will have only one new parameter or properties.
>
> Thank you
>
> --
> 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     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.