← 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,

it is and is not what we mean :-) syntax is ok, but the content is not (see
below)

the best approach would really be to try your model without any bother with
inheritance and when it works, you can reimplement it. I have a feeling
that the example you gave is just copy-paste CohFrictPhys with a little
class rename..

One of the purposes of inheritance is to reduce duplication, so in your
case, when all of defined attributes are already present in CohFrictPhys
(result of copy-paste?), you should not declare them again in the derived
class. As a result, you would not create this class at all and use
CohFrictPhys directly, but it would certainly not work for Burger's model,
as you should store some internal variables (of the dampers)..

please try to implement and test the model first, and when it works, we can
proceed to the other step of nice and long-term maintainable code. When you
have a working implementation, it would also be very easy to indentify
proper inheritance as it would be clear which variables are common with
base classes etc.

cheers
Jan



2014-10-07 21:11 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:
>
> CohBurgersPhys from CohFrictPhys:
>
>
> class CohBurgersPhys : public CohFrictPhys
> {
>         public :
>                 virtual ~CohBurgersPhys();
>                 void SetBreakingState();
>
>         YADE_CLASS_BASE_DOC_ATTRS_CTOR(CohBurgersPhys,CohFrictPhys,"",
>                 ((bool,cohesionDisablesFriction,false))
>                 ((bool,cohesionBroken,true))
>                 ((bool,fragile,true,,"do cohesion disapear when contact
> strength is exceeded?"))
>                 ((Real,normalAdhesion,0,,"tensile strength"))
>                 ((Real,shearAdhesion,0))
>                 ((Real,unp,0,,"plastic normal displacement, only used for
> tensile behaviour and if :yref:`CohFrictPhys::fragile` =false."))
>                 ((Real,unpMax,0,,"maximum value of plastic normal
> displacement, after that the interaction breaks even if
> :yref:`CohFrictPhys::fragile` =false. The default value (0) means no
> maximum."))
>                 ((bool,momentRotationLaw,false,,"use bending/twisting
> moment at contacts"))
>                 ((bool,initCohesion,false,,"Initialize the cohesive
> behaviour with current state as equilibrium state"))
>                 ((Real,creep_viscosity,-1,,"creep viscosity [Pa.s/m]."))
>                 // internal attributes
>                 ,
>                 createIndex();
>         );
> /// Indexable
>         REGISTER_CLASS_INDEX(CohBurgersPhys,CohFrictPhys);
>
> };
>
> REGISTER_SERIALIZABLE(CohBurgersPhys);
>
> --
> 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.