The connection between grid nodes disappear

Asked by Alina Irsainova

Hello,
I am trying to write a script to place a geogrid in soil packing. My script is based on the example :
trunk/examples/grids/Simple_Grid_Falling.py
The problem is in the combination of the script modelling soil packing and the script for geogrid. After combining them, the connections between the gridNodes disappear.
Anyone can help me to find the bugs in this script?

This is my script:

from yade import pack,geom,qt
from yade.gridpfacet import *

rad,gap=.25,.005

#Parameters, which will be passed into spheres and facets creators
kw={'material':0}
kwBoxes={'color':[1,0,0],'wire':False,'dynamic':True,'material':0}
kwMeshes={'color':[1,0,0],'wire':True,'dynamic':False,'material':0}

O.materials.append(FrictMat(young=10e9,poisson=.25,frictionAngle=0.5,density=1e3,label='sphere'))
O.materials.append(CohFrictMat(young=3e2,poisson=0.3,density=1e1,frictionAngle=10,normalCohesion=1e7,shearCohesion=1e7,momentRotationLaw=True,label='spheremat'))

O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_GridConnection_Aabb(),Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),
 ]),
 InteractionLoop(
  [Ig2_GridNode_GridNode_GridNodeGeom6D(),Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_GridNode_Sphere_GridNodeGeom6D(),Ig2_GridNode_Facet_GridNodeGeom6D(),],
  [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(gravity=(0,0,-1000),damping=0.3,label='newton')
]

### Parameters of a rectangular grid ###
L=11 #length [m]
l=11 #width [m]
nbL=11 #number of nodes for the length [#]
nbl=11 #number of nodes for the width [#]
r=L/100. #radius
color=[255./255.,102./255.,0./255.]
nodesIds=[]
#Create all nodes first :
for i in range(0,nbL):
 for j in range(0,nbl):
  nodesIds.append( O.bodies.append(gridNode([i*L/nbL-20,j*l/nbl,-2.7],r,wire=False,fixed=True,material='spheremat',color=color)) )

#Create connection between the nodes
for i in range(0,len(nodesIds)):
 for j in range(i+1,len(nodesIds)):
  dist=(O.bodies[i].state.pos - O.bodies[j].state.pos).norm()
  if(dist<=L/nbL*1.01):
   O.bodies.append( gridConnection(i,j,r,color=color) )

#Create packing
O.bodies.append(pack.regularHexa(pack.inParallelepiped((-10,0,-2.75),(-20,0,-2.75),(-10,10,-2.75),(-10,0,-7.75)),radius=rad,gap=rad/3.0,color=(0.5,0.5,0.1),material='sphere'))
O.bodies.append(pack.regularHexa(pack.inParallelepiped((-10,0,-2.5),(-20,0,-2.5),(-10,10,-2.5),(-10,0,2.25)),radius=rad,gap=rad/3.0,color=(0.5,0.5,0.1),material='sphere'))
O.bodies.append(geom.facetBox((-15,5,-5),(5,5,2.5),wallMask=15,**kwMeshes))
O.bodies.append(geom.facetBox((-15,5,0),(5,5,2.5),wallMask=15,**kwMeshes))
O.bodies.append(geom.facetBox((-15,5,-5),(5,5,2.5),wallMask=16,**kwBoxes))
O.bodies.append(geom.facetBox((-15,5,2.5),(5,5,0),wallMask=16,**kwBoxes))

#Set a fixed node
O.bodies[0].dynamic=False

O.dt=1e-05
O.saveTmp()
O.timingEnabled=True
O.run(10000,True)
from yade import timing
timing.stats()
qt.View()

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#1

Probably a missing functor for sphere-connexions interactions. I can't check the details now but you can check other examples where spheres and grids interact and see which functors are used therein.
I hope it helps
Bruno

Revision history for this message
Alina Irsainova (alina.irsainova) said :
#2

Dear Bruno Chareyre,

I tried viewing the model without running the iterations, and in this case grid connections appear. Does it indicate that no functor of sphere-conection interaction is missing? The problem appears when running the code, due to the soil particles' movement connections between grid nodes are lost.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

I am not sure what you mean, sorry.
Please check which functors are used in examples where grid and spheres interact. The problem is you started from a script without spheres and guessing what to had can be a bit challenging the first time.
Bruno

Revision history for this message
Alina Irsainova (alina.irsainova) said :
#4

Dear Bruno Chareyre,

I made modifications in functors of grid-sphere interaction, and this solved my problem.

Many thanks,
Alina

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#5

Could you please tell what you changed?
B

Revision history for this message
Alina Irsainova (alina.irsainova) said :
#6

Dear Bruno,
The modifications are:
O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_GridConnection_Aabb(),
 ]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_GridNode_GridNode_GridNodeGeom6D(),Ig2_Sphere_GridConnection_ScGridCoGeom(),Ig2_GridConnection_GridConnection_GridCoGridCoGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False)],
  [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),Law2_ScGridCoGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(gravity=(0,0,0),damping=0.3,label='newton')
  ]

After this, the model worked properly.
Best regards,
Alina