← Back to team overview

yade-users team mailing list archive

Re: [Question #197661]: on modify interactionLoop

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

a full script would be really helpful in finding a mistake :-) as now we do
not know exactly what some details are..


       # here we modify the material and interaction physics
>         for i_body in O.bodies:
>                if i_body.id < 6 :
>                        i_body.material = O.materials[3]
>                else:
>                        i_body.material = O.materials[2]
>         for i_interactions in O.interactions:
>                if i_interactions.id1 > 5 and i_interactions.id2 > 5:
>                        i_interactions.Eta = eyta  # only interaction
> between particles are changed to eyta > 0
>
> Does these interactions exists at all? anyway, you should assign Eta to
i_interaction.phys, not i_interaction itself..
i_interaction.phys.Eta = eyta # [1]


>
>        #here we move to modify the interaction loop
>        Interaction = O.engines[2]
>        Interaction =  InteractionLoop(
>                [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
>                [Ip2_MomentMat_MomentMat_MomentPhys(Knormal=knormal,Alpha =
> alpha,Beta=beta,useAlphaBeta=True,userInputStiffness=True)],
>                [Law2_SCG_MomentPhys_CohesionlessMomentRotation()]
>        )
>
> actually this modifies nothing at all.. The fist line (Interaction =
O.engines[2]) creates temporary variable Interaction, which is on the next
line (Interaction = ..) overwritten with newly created InteractionLoop,
which is not used (according to the part of the script) anywhere


>         # here we redifine the triaxial engine
>        triax=O.engines[4] #redifine 3d triaxial engine
>        ##We move to deviatoric loading, let us turn internal compaction
> off to keep particles sizes constant
>        triax.internalCompaction=False
>
>        ## Change contact friction (remember that decreasing it would
> generate instantaneous instabilities)
>        triax.setContactProperties(fricFinal)
>
>
>   this  statement "i_interactions.Eta = eyta" doesn't change eta in
> interaction physics, but I think it should change.
>

explained above [1]..


>     Here we have parameters in this function below, doesn't this function
> change kn, ks beta in interaction physics?
>
>             [Ip2_MomentMat_MomentMat_MomentPhys(Knormal=knormal,Alpha =
> alpha,Beta=beta,useAlphaBeta=True,userInputStiffness=True)],
>
> no, the InteractionLoop is not used enywhere.. if you want to redefined
O.engines, you must reassigned it, see [2]. Example:

newIntLoop = InteractionLoop(...)
newEngines = [
   ..., # no change from previous steps
   newIntLoop, # only this engine is new
   ..., # no changes
]
O.engines = newEngines # to make new engines work, they *must* be
explicitely assigned like here, see [2]

Jan

[2] https://www.yade-dem.org/doc/user.html#base-engines

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