# Problems encountered in using FrictMat for polyhedron.

Dear all,

I want to use polyhedra and spheres to make concrete,see[1].When I create a loose packing with spheres and polyhedrons with FrictMat and then compress them,I found that when I use Ig2_Polyhedra_Polyhedra_ScGeom()、Ip2_FrictMat_FrictMat_FrictPhys()、Law2_ScGeom_FrictPhys_CundallStrack(),when polyhedron contact with polyhedron,it will fly out or directly through the bottom.Here is a MWE,see[2].I think it might be ig2_ Polyhedra_ Polyhedra_ Scgeom() is not working properly.

Jie

[2]MWE:
####################
import numpy as np

###material
O.materials.append(m)
####Bottom
meanSize = 0.05
wallThickness = 0.5*meanSize
length = 0.150
height=0.6
v1=((-0.5*length,0.5*wallThickness,0.5*length),(0.5*length,0.5*wallThickness,0.5*length),(0.5*length,0.5*wallThickness,-0.5*length),(-0.5*length,0.5*wallThickness,-0.5*length),(-0.5*length,-0.5*wallThickness,0.5*length),(0.5*length,-0.5*wallThickness,0.5*length),(0.5*length,-0.5*wallThickness,-0.5*length),(-0.5*length,-0.5*wallThickness,-0.5*length))
color=[0,0.5,1]
b1 = polyhedra_utils.polyhedra(material=m,v=v1,fixed=True,color=color) # you can set wire at
b1.state.pos = [0,0,0]
O.bodies.append(b1)
###makeCloud
sp=pack.SpherePack()
mn,mx=Vector3(-0.5*(length-1*wallThickness),0.5*meanSize,-0.5*(length-1*wallThickness)),Vector3(0.5*(length-1*wallThickness),0.95*height,0.5*(length-1*wallThickness))
###Generate polyhedron
sp.makeCloud(mn,mx,psdSizes=[0.01,0.01,0.04,0.04],psdCumm=(0,0.9,0.9,1),num=-1,distributeMass=False)
t=polyhedra_utils.polyhedra(material=m,size=(0.02,0.02,0.02),color=(0.2,0.3,0.4))
t.state.pos = center # sets polyhedron position according to sphere position
O.bodies.append(t)

###engine
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Polyhedra_Aabb()]),
InteractionLoop(
[Ig2_Polyhedra_Polyhedra_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()],
),
NewtonIntegrator(gravity=(0,-9.81,0)),
]
O.dt=1e-5
v=qt.View()

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
 Revision history for this message Jan Stránský (honzik) said on 2021-05-17: #1

Hello,

yes, for this case Ig2_ Polyhedra_ Polyhedra_ ScGeom is not working correctly.
So it is correct only if the interaction is "concentric" - true contact point lies between centers of the particles.
The more excentric the interaction is (the more center-branches are "tirangular"), the bigger is the error.
true contact point ... i.geom.contactPoint is set between the centers, so using the value as it is now would not help much
Probably it is worth to create an issue on Yade gitlab pages.

You can:
- use something like Ig2_ Wall Polyhedra_ ScGeom (which you would have to implement)
- adjust Ig2_ Polyhedra_ Polyhedra_ ScGeom
both cases needs change of the source code :-(

Cheers
Jan

 Revision history for this message weijie (amandajoe) said on 2021-05-21: #2

Hi Jan, and thank you again.

I have an idea, I don't know whether it's feasible.In Ig2_ Polyhedra_ Polyhedra_ ScGeom,use contactPoint and equivalentPenetrationDepth from Ig2_Polyhedra_Polyhedra_PolyhedraGeom(see[1]).I don't know whether geom->radius1 and geom->radius2 are still needed in this case,if they are needed, is it appropriate to use the previous value(see[2]).

>use something like Ig2_ Wall Polyhedra_ ScGeom (which you would have to implement)

For Ig2_ Wall Polyhedra_ ScGeom,use contactPoint and equivalentPenetrationDepth from Ig2_Wall_Polyhedra_PolyhedraGeom(see[3]).But ,for ws->radius1 and ws->radius2(see [4]) is it necessary？If so,how to get it.

Best regards
Jie

 Revision history for this message Jan Stránský (honzik) said on 2021-05-21: #3

Thinking about it, I also had the idea to use Ig2_Polyhedra under the hood to compute Ig2_ScGeom.

I did not have time to think about all details (and will not in the near future..).
The main problem I see is the need of Interaction isntance and Interaction::geom to be something for the Ig2::go. Maybe you can just use the code/logic, or copy the code outside Ig2::go to some separate function and use it in both your Ig2..

Cheers
Jan