yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #16924
[Question #665507]: The connection between grid nodes disappear
New question #665507 on Yade:
https://answers.launchpad.net/yade/+question/665507
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()
--
You received this question notification because your team yade-users is
an answer contact for Yade.