Interaction between Polyhedra and Facets

Asked by José Mercado

Hello everyone!

I want to make collide a Polyhedra with a facetbox, but when the polyhedra impact the facetbox i obtain the following error:

python: /tmp/buildd/yadedaily-1.14.0-57-77e7f1d~trusty/pkg/dem/FrictPhys.cpp:17: virtual void Ip2_FrictMat_FrictMat_FrictPhys::go(const boost::shared_ptr<Material>&, const boost::shared_ptr<Material>&, const boost::shared_ptr<Interaction>&): La declaración `dynamic_cast<GenericSpheresContact*>(interaction->geom.get())' no se cumple.
Abortado (`core' generado)

The script is:

from yade import polyhedra_utils
import random

polyMat = PolyhedraMat(density=3000,young=1e10,poisson=.5,frictionAngle=atan(0.8))
frictMat = FrictMat(density=8000,young=1e9,poisson=.5,frictionAngle=atan(0.8))

O.materials.append((polyMat,frictMat))

t=polyhedra_utils.polyhedra(polyMat,(2,2,2),v=[])
t.state.pos = (0,0,5)
O.bodies.append(t)

O.bodies.append(geom.facetBox((0,0,-2),(5,5,10)))

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Facet_Aabb()],verletDist=0.5),
   InteractionLoop(
      [Ig2_Facet_Polyhedra_PolyhedraGeom()],
      [Ip2_FrictMat_PolyhedraMat_FrictPhys()],
      [Law2_ScGeom_FrictPhys_CundallStrack()],
   ),
    NewtonIntegrator(damping=0.5,gravity=(0,0,-9.81))
]

O.dt=0.025*polyhedra_utils.PWaveTimeStep()

from yade import qt
v=qt.View()
v.axes=True

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hello,

The "IGeom" of the appearing Polyhedra - Facet(Box) interaction is of PolyhedraGeom type (see Ig2_Facet_Polyhedra_PolyhedraGeom() in your script)

However, for what concerns the "IPhys" of this interaction, execution of Ip2_FrictMat_PolyhedraMat_FrictPhys 's job triggers some execution of Ip2_FrictMat_FrictMat_FrictPhys [1].

This Ip2_FrictMat_FrictMat_FrictPhys::go is designed for interaction with "IGeom" of "GenericSpheresContact" (or derived) types [2]. And the PolyhedraGeom type is not one of those [3]

To be short: Yade is currently not designed to deal with the interaction you want.... Discussing code improvements or workarounds will require the answer of other users familiar with this code...

Jerome

[1] https://github.com/yade/trunk/blob/master/pkg/dem/Polyhedra.cpp#L414
[2] https://github.com/yade/trunk/blob/master/pkg/dem/FrictPhys.cpp#L17
[3] https://yade-dem.org/doc/yade.wrapper.html#igeom

PS: thank you for complying the in the air "MWE" question fashion !

Revision history for this message
Jan Stránský (honzik) said :
#2

Hi José,

O.engines=[
> ...

   InteractionLoop(
> [Ig2_Facet_Polyhedra_PolyhedraGeom()],
> [Ip2_FrictMat_PolyhedraMat_FrictPhys()],
> [Law2_ScGeom_FrictPhys_CundallStrack()],
> ),
> ...
> ]

The problem (as the error says) is here:
Ig2_Facet_Polyhrda_PolyhedraGeom -> PolyhedraGeom instance
Ip2_FrictMAt_PolyhedraMat_FrictPhys -> FrictPhyd
Law2_ScGeom_FrictPhys_CundallStrack -> combines ScGeom and FrictPhys, but
you have PolyhedraGeom and FrictPhys from previous pieces of code..

try Law2_ScGeom_FrictPhys_CundallStrack [1] instead

cheers
Jan

[1]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom_FrictPhys_CundallStrack

2015-07-21 22:36 GMT+02:00 Jérôme Duriez <
<email address hidden>>:

> Question #269513 on Yade changed:
> https://answers.launchpad.net/yade/+question/269513
>
> Status: Open => Answered
>
> Jérôme Duriez proposed the following answer:
> Hello,
>
> The "IGeom" of the appearing Polyhedra - Facet(Box) interaction is of
> PolyhedraGeom type (see Ig2_Facet_Polyhedra_PolyhedraGeom() in your
> script)
>
> However, for what concerns the "IPhys" of this interaction, execution of
> Ip2_FrictMat_PolyhedraMat_FrictPhys 's job triggers some execution of
> Ip2_FrictMat_FrictMat_FrictPhys [1].
>
> This Ip2_FrictMat_FrictMat_FrictPhys::go is designed for interaction
> with "IGeom" of "GenericSpheresContact" (or derived) types [2]. And the
> PolyhedraGeom type is not one of those [3]
>
>
> To be short: Yade is currently not designed to deal with the interaction
> you want.... Discussing code improvements or workarounds will require the
> answer of other users familiar with this code...
>
> Jerome
>
> [1] https://github.com/yade/trunk/blob/master/pkg/dem/Polyhedra.cpp#L414
> [2] https://github.com/yade/trunk/blob/master/pkg/dem/FrictPhys.cpp#L17
> [3] https://yade-dem.org/doc/yade.wrapper.html#igeom
>
>
> PS: thank you for complying the in the air "MWE" question fashion !
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Best Jan Stránský (honzik) said :
#3

Hi José,

sorry for my last confusing message.. The problem is that you do not have
consistent IGeom and IPhys types. Do you have any special reason, why the
facetBox has FrictMat? Could you use PolyhedraMat instead? you would then
have:

   InteractionLoop(
      [Ig2_Facet_Polyhedra_PolyhedraGeom()], # [1]
      [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()], # [2]
      [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric()], # [3]
   ),

cheers
Jan

[1]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Ig2_Facet_Polyhedra_PolyhedraGeom
[2]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys
[3]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_PolyhedraGeom_PolyhedraPhys_Volumetric

2015-07-22 0:56 GMT+02:00 Jan Stránský <<email address hidden>
>:

> Question #269513 on Yade changed:
> https://answers.launchpad.net/yade/+question/269513
>
> Jan Stránský proposed the following answer:
> Hi José,
>
> O.engines=[
> > ...
>
> InteractionLoop(
> > [Ig2_Facet_Polyhedra_PolyhedraGeom()],
> > [Ip2_FrictMat_PolyhedraMat_FrictPhys()],
> > [Law2_ScGeom_FrictPhys_CundallStrack()],
> > ),
> > ...
> > ]
>
>
> The problem (as the error says) is here:
> Ig2_Facet_Polyhrda_PolyhedraGeom -> PolyhedraGeom instance
> Ip2_FrictMAt_PolyhedraMat_FrictPhys -> FrictPhyd
> Law2_ScGeom_FrictPhys_CundallStrack -> combines ScGeom and FrictPhys, but
> you have PolyhedraGeom and FrictPhys from previous pieces of code..
>
> try Law2_ScGeom_FrictPhys_CundallStrack [1] instead
>
> cheers
> Jan
>
> [1]
>
> https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom_FrictPhys_CundallStrack
>
>
> 2015-07-21 22:36 GMT+02:00 Jérôme Duriez <
> <email address hidden>>:
>
> > Question #269513 on Yade changed:
> > https://answers.launchpad.net/yade/+question/269513
> >
> > Status: Open => Answered
> >
> > Jérôme Duriez proposed the following answer:
> > Hello,
> >
> > The "IGeom" of the appearing Polyhedra - Facet(Box) interaction is of
> > PolyhedraGeom type (see Ig2_Facet_Polyhedra_PolyhedraGeom() in your
> > script)
> >
> > However, for what concerns the "IPhys" of this interaction, execution of
> > Ip2_FrictMat_PolyhedraMat_FrictPhys 's job triggers some execution of
> > Ip2_FrictMat_FrictMat_FrictPhys [1].
> >
> > This Ip2_FrictMat_FrictMat_FrictPhys::go is designed for interaction
> > with "IGeom" of "GenericSpheresContact" (or derived) types [2]. And the
> > PolyhedraGeom type is not one of those [3]
> >
> >
> > To be short: Yade is currently not designed to deal with the interaction
> > you want.... Discussing code improvements or workarounds will require the
> > answer of other users familiar with this code...
> >
> > Jerome
> >
> > [1] https://github.com/yade/trunk/blob/master/pkg/dem/Polyhedra.cpp#L414
> > [2] https://github.com/yade/trunk/blob/master/pkg/dem/FrictPhys.cpp#L17
> > [3] https://yade-dem.org/doc/yade.wrapper.html#igeom
> >
> >
> > PS: thank you for complying the in the air "MWE" question fashion !
> >
> > --
> > 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 : <email address hidden>
> > 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.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
José Mercado (josem-mercadoa) said :
#4

Thanks to both, It works Jan, but the PolyhedraPhys_Volumetric can include a frictionAngle?

Revision history for this message
José Mercado (josem-mercadoa) said :
#5

Thanks Jan Stránský, that solved my question.

Revision history for this message
Jan Stránský (honzik) said :
#6

Hi José,

friction angle is an attribute of PolyhedraMat [1]. However, I don't know
the implementation, but you can test it on simple 2 particle simulation :-)

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.PolyhedraMat

2015-07-22 20:31 GMT+02:00 José Mercado <
<email address hidden>>:

> Question #269513 on Yade changed:
> https://answers.launchpad.net/yade/+question/269513
>
> Status: Answered => Solved
>
> José Mercado confirmed that the question is solved:
> Thanks Jan Stránský, that solved my question.
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
José Mercado (josem-mercadoa) said :
#7

Thanks for the answer Jan.

Revision history for this message
Wenbin Fei (brian-fei) said :
#8

Hi Jose,

I am so interested in your work.

However, I tried to run your scripts, it still cannot work normally.

Ther scripts I ran is as follows:

##################################
from yade import polyhedra_utils
import random

polyMat = PolyhedraMat(density=3000,young=1e10,poisson=.5,frictionAngle=atan(0.8))
frictMat = FrictMat(density=8000,young=1e9,poisson=.5,frictionAngle=atan(0.8))

O.materials.append((polyMat,frictMat))

t=polyhedra_utils.polyhedra(polyMat,(2,2,2),v=[])
t.state.pos = (0,0,5)
O.bodies.append(t)

O.bodies.append(geom.facetBox((0,0,-2),(5,5,10)))

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Facet_Aabb()],verletDist=0.5),
   InteractionLoop(
      [Ig2_Facet_Polyhedra_PolyhedraGeom()], # [1]
      [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()], # [2]
      [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric()], # [3]
),
    NewtonIntegrator(damping=0.5,gravity=(0,0,-9.81))
]

O.dt=0.025*polyhedra_utils.PWaveTimeStep()

from yade import qt
v=qt.View()
v.axes=True

Revision history for this message
Jan Stránský (honzik) said :
#9

Hello,
there is the same problem as Jose had. If you delete the FrictMat, i.e.
###
...
polyMat = PolyhedraMat(density=3000,young=1e10,poisson=.5,frictionAngle=atan(0.8))
O.materials.append(polyMat)
...
###
it works
cheers
Jan