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

Hi,

I try to clump gridnode and pfacet together and test how it can interact with 
spheres, sample can be generated without O.engine code, once I add O.engine to 
the script it would go wrong. The error says:

Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
    execfile(script,globals())
  File "1-29-2.py", line 44, in <module>
    
pfacet(nodes[0],nodes[1],nodes[2],wire=True,material='pFacetMat',color=color),\
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/gridpfacet.py", line 211, in 
pfacet
    GridC1=O.bodies[O.interactions[id1,id2].geom.connectionBody.id]
AttributeError: 'ScGeom' object has no attribute 'connectionBody'

 I use ubuntu 18.04 and my yade version is 2018.02b.

################################################
from yade.gridpfacet import *
from yade import pack, plot
#from random import random as r
import numpy as np
from numpy import *
import math
from yade import utils, qt
import random
from yade import polyhedra_utils, qt


#### Parameter ####
young=4.0e6
poisson=3
density=1e3
stabilityThreshold=0.01
mi,ma = (-100e-3,-100e-3,-200e-3),(100e-3,100e-3,200e-3)
color=[0.,1.,1.]

#=============================meterials========================================
O.materials.append(FrictMat(young=4.0e6,poisson=.3,frictionAngle=30,density=2630e0,label='sphereMat'))#for
 sphere
O.materials.append( CohFrictMat( 
young=3e6,poisson=0.15,density=910e0,frictionAngle=20,normalCohesion=3e100,shearCohesion=3e100,momentRotationLaw=True,label='gridNodeMat'
 ) )#for gridNodes
O.materials.append(FrictMat(young=4e6,poisson=0.3,density=1000,frictionAngle=20,label='pFacetMat'))
 #for pfacet

RNode=0.00002
nodes=[]
#up 0123
aa= nodes.append(O.bodies.append( gridNode([-110e-3, 
110e-3,-200e-3],RNode,wire=True,fixed=True,material='gridNodeMat') ))
bb= nodes.append(O.bodies.append( gridNode([ 110e-3, 
110e-3,-200e-3],RNode,wire=True,fixed=True,material='gridNodeMat') ))
cc= nodes.append(O.bodies.append( gridNode([ 
110e-3,-110e-3,-200e-3],RNode,wire=True,fixed=True,material='gridNodeMat') ))
dd= nodes.append(O.bodies.append( 
gridNode([-110e-3,-110e-3,-200e-3],RNode,wire=True,fixed=True,material='gridNodeMat')
 ))


clump1=O.bodies.appendClumped([\
gridNode([-110e-3, 
110e-3,-200e-3],RNode,wire=True,fixed=True,material='gridNodeMat'),\
gridNode([ 110e-3, 
110e-3,-200e-3],RNode,wire=True,fixed=True,material='gridNodeMat'),\
gridNode([ 
110e-3,-110e-3,-200e-3],RNode,wire=True,fixed=True,material='gridNodeMat'),\
gridNode([-110e-3,-110e-3,-200e-3],RNode,wire=True,fixed=True,material='gridNodeMat'),\
gridConnection(nodes[0],nodes[1],RNode,wire=True,material='gridNodeMat'),\
gridConnection(nodes[0],nodes[2],RNode,wire=True,material='gridNodeMat'),\
gridConnection(nodes[0],nodes[3],RNode,wire=True,material='gridNodeMat'),\
gridConnection(nodes[1],nodes[2],RNode,wire=True,material='gridNodeMat'),\
gridConnection(nodes[2],nodes[3],RNode,wire=True,material='gridNodeMat'),\
pfacet(nodes[0],nodes[1],nodes[2],wire=True,material='pFacetMat',color=color),\
pfacet(nodes[0],nodes[2],nodes[3],wire=True,material='pFacetMat',color=color)
])


O.bodies.append(utils.sphere([0,0,0.2],.1))

#==============================Engines=========================================
O.engines=[
        ForceResetter(),
        InsertionSortCollider([
                Bo1_Sphere_Aabb(),
                Bo1_GridConnection_Aabb(),
                Bo1_PFacet_Aabb(),
                Bo1_Box_Aabb(),
                Bo1_Wall_Aabb()
        ]),
        InteractionLoop([
                Ig2_Sphere_Sphere_ScGeom(),
                Ig2_Box_Sphere_ScGeom(),
                Ig2_GridNode_GridNode_GridNodeGeom6D(),
                Ig2_Sphere_GridConnection_ScGridCoGeom(),
                Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
                Ig2_GridConnection_PFacet_ScGeom(),
                Ig2_PFacet_PFacet_ScGeom(),
                Ig2_Sphere_PFacet_ScGridCoGeom(),
                Ig2_Wall_PFacet_ScGeom(),
                Ig2_Wall_Sphere_ScGeom()
        ],
        [
                
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
   # internal cylinder physics
                Ip2_FrictMat_FrictMat_FrictPhys(),      # physics for external 
interactions, i.e., cylinder-cylinder, sphere-sphere, cylinder-sphere

                Ip2_FrictMat_CpmMat_FrictPhys(),
        ],
        [
                #Law2_ScGeom_FrictPhys_CundallStrack(), # contact law for 
sphere-sphere
                Law2_ScGridCoGeom_FrictPhys_CundallStrack(),    # contact law 
for cylinder-sphere
                Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),    # contact law 
for "internal" cylinder forces
                Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),        # 
contact law for cylinder-cylinder interaction
                #Law2_GridCoGridCoGeom_CohFrictPhys_CundallStrack(),
                Law2_ScGeom_CpmPhys_Cpm(),
        ]
        ),
        GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.1,label='ts'), 
        #triax,
        NewtonIntegrator(gravity=(0,0,10),damping=0.5,label='newton'),
        ]
########################################################

Thanks for any help!!

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

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to