← Back to team overview

yade-users team mailing list archive

[Question #663143]: Grid connections error/bug?

 

New question #663143 on Yade:
https://answers.launchpad.net/yade/+question/663143

Why, in my code, do half of the nodes/grid connections just disappear once the fixed BC is turned of?

I notice the same thing with CohesiveCylinderSphere.py (gridConnections) in the examples/grid folder [*].

In the for loop:
for i in linspace(0,L,nL):
  nodesIds.append( O.bodies.append(
    gridNode([i,0,0],rCyl,wire=False,fixed=False,material='gridNodeMat') ) )

If you change the axis as such:
for i in linspace(0,L,nL):
  nodesIds.append( O.bodies.append(
    gridNode([0,i,0],rCyl,wire=False,fixed=False,material='gridNodeMat') ) )

or:
for i in linspace(0,L,nL):
  nodesIds.append( O.bodies.append(
    gridNode([0,0,i],rCyl,wire=False,fixed=False,material='gridNodeMat') ) )

All middle nodes and the grid connection disappear once you hit play. Is this a bug?



My Complete Code:

from yade import qt
from yade.gridpfacet import *
import numpy as np

qt.View()

### Engines need to be defined first since the function gridConnection creates the interaction
O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_Sphere_Aabb(),
  Bo1_GridConnection_Aabb(),
 ]),
 InteractionLoop(
  # Geometric interactions
  [
          Ig2_GridNode_GridNode_GridNodeGeom6D(),
          Ig2_Sphere_GridConnection_ScGridCoGeom(),	# used for the cohesive sphere-cylinder interaction
        ],
  [
  # Interaction phusics
          Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
        ],
  # Interaction law
  [
          Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
          Law2_ScGridCoGeom_CohFrictPhys_CundallStrack(),	# used for the cohesive sphere-cylinder interaction
        ]
 ),
 NewtonIntegrator(gravity=(0,-9.81,0),damping=0.3,label='newton'),
 PyRunner(command='main()',initRun=1000),
]

O.dt=5e-07

O.materials.append(CohFrictMat(young=8e5,poisson=0.3,density=4e3,frictionAngle=radians(30),normalCohesion=1e5,shearCohesion=1e5,momentRotationLaw=True,label='grass')) ## Properties Need to be corrected

blen = 0.21230 ## Length of Ball pit
bhei = .025 ## Height of Ball pit

#rCyl = (0.00635+0.003175)/4 ## Lump with of "grass" on back is 1/4 X 1/8 inch, Note 4 is due to radius times two average of the two.
rCyl = 0.0026 ## Grass was about 1.2 [mm] wide
nL = 4 ## No exact Number here, just trial and error
L = bhei ## Height of spheres

### Grass Creation
### Create all nodes first :
nodesIds=[]
idxc = -1
x_gap = 0.009 ## Between lumps is roughly 9 [mm]
z_gap = 0.01905 ## Between lines of backing is .75 inch apart
range_x = int(math.floor(blen/x_gap)) ## finding the range for x
range_z = int(math.floor(blen/z_gap)) ## finding the range for z
cen_z = -(range_z/2)*z_gap ## Allows the "box" of grass to be center in Z
#sys.exit()

for ii in range(0,range_z):
  cen_x = -(range_x/2)*x_gap # Allows the "box" of grass to be center in X
  for jj in range(0,range_x):
    for y in np.linspace(0,L,nL):
      nodesIds.append(O.bodies.append(gridNode([cen_x,y,cen_z],rCyl,wire=False,fixed=False,material='grass')))
    idxc += 1
    d = idxc*nL ## Start of grass fiber
    cen_x += x_gap
#### Now create connection between the nodes
    for k,j in zip(nodesIds[d:d+nL-1],nodesIds[d+1:nodesIds[-1]+1]):
      O.bodies.append(gridConnection(k,j,rCyl,material='grass'))
  cen_z += z_gap

for kk in range(0,len(nodesIds)): ## First Blocking all DOF's until balls fall around.
  O.bodies[nodesIds[kk]].state.blockedDOFs='xyzXYZ'

def main():
 print "Turning on Grass"
 for kk in range(0,len(nodesIds)):
   O.bodies[nodesIds[kk]].state.blockedDOFs='' ## Unblocking all DOF's
 for kk in range(0,len(nodesIds),nL):
   O.bodies[nodesIds[kk]].state.blockedDOFs='xyzXYZ' ## Blocking DOF's for Bottom nodes


[*]


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.