← Back to team overview

yade-users team mailing list archive

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

 

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

Klaus Thoeni posted a new comment:
Hi Bruno,

yes, regression and existing examples seem to be all fine. Below is the
MWE to reproduce the problem based on CohesiveCylinderSphere.py as
Justin mentioned. The script works for nL=1-4, but once you set it to 5
you get the indicated problem. I can't debug at the moment so not sure
what's going on but definitely smells like a bug to me. However, doesn't
seem to be related to the DOFs. I added a little printout file at the
end and the State of a GridNode shows some nan after the first step:

{'refOri': Quaternion((1,0,0),0), 'se3': (Vector3(nan,nan,nan),
Quaternion((nan,nan,nan),6.283185307179586)), 'isDamped': True,
'refPos': Vector3(0,0,0), 'blockedDOFs': 0, 'angMom': Vector3(0,0,0),
'mass': 0.016964600329384884, 'densityScaling': 1.0, 'vel':
Vector3(nan,nan,nan), 'inertia':
Vector3(2.442902447431423e-7,2.442902447431423e-7,2.442902447431423e-7),
'angVel': Vector3(nan,nan,nan)}

The same for the other/working direction:

{'refOri': Quaternion((1,0,0),0), 'se3':
(Vector3(1.727013593861354e-25,0,0), Quaternion((1,0,0),0)), 'isDamped':
True, 'refPos': Vector3(0,0,0), 'blockedDOFs': 0, 'angMom':
Vector3(0,0,0), 'mass': 0.016964600329384884, 'densityScaling': 1.0,
'vel': Vector3(3.4540271877227086e-19,0,0), 'inertia':
Vector3(2.442902447431423e-7,2.442902447431423e-7,2.442902447431423e-7),
'angVel': Vector3(0,0,0)}

That's how far I cam without properly debugging.

Klaus

MWE:
------------------------------------------------------------

from yade import qt
from yade.gridpfacet import *
from numpy import linspace

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
        ]
    ),from yade import qt
from yade.gridpfacet import *
from numpy import linspace

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,0,0),damping=0.3,label='newton'),
]

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='gridNodeMat'))

O.materials.append(CohFrictMat(young=8e5,poisson=0.3,density=4e3,frictionAngle=radians(30),normalCohesion=1e5,shearCohesion=1e5,momentRotationLaw=True,label='gridCoMat'))

rCyl=0.006
nL=5    # <- it seems to be working for 1-4
L=0.3

### Create all nodes first :
nodesIds=[]
for i in linspace(0,L,nL):
  nodesIds.append( O.bodies.append(
    #gridNode([i,0,0],rCyl,color=[1,1,0],wire=False,fixed=False,material='gridNodeMat') ) )    # this works
    gridNode([0,i,0],rCyl,color=[1,1,0],wire=False,fixed=False,material='gridNodeMat') ) )    # <- change of orientation gives problem

### Now create connection between the nodes
for i,j in zip( nodesIds[:-1], nodesIds[1:]):
  O.bodies.append( gridConnection(i,j,rCyl,color=[1,1,0],material='gridCoMat') )

### Set fixed nodes <- does not seem to influence the problem
#O.bodies[nodesIds[0]].state.blockedDOFs='xyzXYZ'
#O.bodies[nodesIds[-1]].state.blockedDOFs='xyzXYZ'

O.saveTmp()

    NewtonIntegrator(gravity=(0,0,0),damping=0.3,label='newton'),
]

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='gridNodeMat'))

O.materials.append(CohFrictMat(young=8e5,poisson=0.3,density=4e3,frictionAngle=radians(30),normalCohesion=1e5,shearCohesion=1e5,momentRotationLaw=True,label='gridCoMat'))

rCyl=0.006
nL=5    # <- it seems to be working for 1-4
L=0.3

### Create all nodes first :
nodesIds=[]
for i in linspace(0,L,nL):
  nodesIds.append( O.bodies.append(
    #gridNode([i,0,0],rCyl,color=[1,1,0],wire=False,fixed=False,material='gridNodeMat') ) )    # this works
    gridNode([0,i,0],rCyl,color=[1,1,0],wire=False,fixed=False,material='gridNodeMat') ) )    # <- change of orientation gives problem

### Now create connection between the nodes
for i,j in zip( nodesIds[:-1], nodesIds[1:]):
  O.bodies.append( gridConnection(i,j,rCyl,color=[1,1,0],material='gridCoMat') )

### Set fixed nodes
O.bodies[nodesIds[0]].state.blockedDOFs='xyzXYZ'
O.bodies[nodesIds[-1]].state.blockedDOFs='xyzXYZ'

O.saveTmp()

def getInfo():
	#fid = open( 'X_'+str(O.iter)+'.txt', 'w' )
	fid = open( 'Y_'+str(O.iter)+'.txt', 'w' )
	for b in O.bodies:
		fid.write(str(b.id)+"\n")
		fid.write(str(b.dict())+"\n")
		fid.write(str(b.shape.dict())+"\n")
		fid.write(str(b.state.dict())+"\n")
		fid.write("- - - - - - - - - - - - -\n")
	fid.close()

getInfo()

O.step()

getInfo()

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