← Back to team overview

yade-users team mailing list archive

Re: [Question #269315]: swap failure in InteractionLoop

 

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

    Status: Open => Answered

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

please provide also a Python script (even if we can't run it). Do you use
more particle shapes?

See also the source code (InteractionLoop.cpp, line 116). If you use
different shapes, the interaction may be swapped (ok and intended
behavior). Then if you use also different materials, the interaction might
want to swap again, which results in this error.

This happens only in unlucky situation, I used spheres-CpmMat,
facets-FrictMat combination. But (by luck) the definition of Ig2 is
Facet-Sphere and Ip2 is FrictMat-CpmMat (the same order)

The code is unchanged since 2010, but probably nobody needed this
combination (different shapes AND different materials AND different order
in definitions) :-)

I see some possible solutions:
1) define both Ip2_Mat1_Mat2 and Ip2_Mat2_Mat1 (to save code, one of them
calling the other).
2) change InteractionLoop slightly (replace this assert with some other
code, probably would need general discussion among devs)
3) change InteractionLoop completely (nobody would want to do that :-)

In my point of view, 1) is ok, 2) maybe.. So for now you can go 1)
direction :-)

cheers
Jan



2015-07-17 21:11 GMT+02:00 behzad <question269315@xxxxxxxxxxxxxxxxxxxxx>:

> Question #269315 on Yade changed:
> https://answers.launchpad.net/yade/+question/269315
>
>     Status: Answered => Open
>
> behzad is still having a problem:
> Hi Anton,
>
> Can you please clarify the approach you're proposing?
>
> CohFrictMat* mat_fm=dynamic_cast<CohFrictMat*>(b1->get());
> if (mat_fm) {.....
>
>
> And I don't get what's wrong with my code? It's checking the index of
> bodies material and and that of CohBurgersMat and then compares them.
>
> --
> 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.