← Back to team overview

yade-users team mailing list archive

[Question #675879]: Polyhedron interaction with sphere

 

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

Hello,

I was understanding how polyhedron interacts with sphere in yade and encountered a problem with the dictionary of the interaction.

I created a system with one sphere and a box (made by polyhedron). The box touches the sphere from the bottom and has a velocity. I look at the interaction between the box and sphere after a time step. Below is the MWE:

#--------------------

from yade import pack,polyhedra_utils
import shutil, sys, imp
import numpy as np

#------------------- System definition ----------------------
rad_p = 0.1
Xl = 0.
Yl = 0.
Xr = 1.
Yr = 1.
Zl = rad_p
Zr = 1.
eps_pos = 1e-5
#--------------------------
O.bodies.append([sphere((0.5*(Xl+Xr)+eps_pos,0.5*(Yl+Yr),0.0),rad_p, fixed = True) ]) # Sphere object

O.bodies.append(polyhedron([(Xl,Yl,Zl),(Xr,Yl,Zl),(Xl,Yr,Zl),(Xr,Yr,Zl),(Xl,Yl,Zr),(Xr,Yl,Zr),(Xl,Yr,Zr),(Xr,Yr,Zr)],wire=False,dynamic=True)) # polyhedron which compresses the sphere
#------------------------------------

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(), Bo1_Box_Aabb(), Bo1_Wall_Aabb(), Bo1_Polyhedra_Aabb()],allowBiggerThanPeriod=True),
 InteractionLoop(
 [Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom(), Ig2_Wall_Sphere_ScGeom(), Ig2_Sphere_Polyhedra_ScGeom()],
 [Ip2_FrictMat_FrictMat_MindlinPhys()],
 [Law2_ScGeom_MindlinPhys_Mindlin()]
 ),
 PyRunner(command = 'load()', iterPeriod = 1, label = "checker"),
 NewtonIntegrator(gravity=(0,0,0.0),damping = 0.0)
]

def load():
 O.bodies[1].state.vel = Vector3(0,0,-1e-5)

 if ( O.iter > 3):
  O.pause()

#---------------------------
O.dt=.5e-0*PWaveTimeStep()
O.stopAtIter= int(1e6)
O.step()

#-------------------
Case I: If the sphere is positioned not at the center of box bottom face (non-zero eps_pos in the code above), O.interactions[0,1].phys.dict() gives correct interaction parameters.

Case II: When the sphere is located just at the center of the box (eps_pos = 0), there is an interaction between the two objects, but without any dictionary.

#Yade [1]: O.interactions[0,1].phys.dict()
#---------------------------------------------------------------------------
#AttributeError Traceback (most recent call last)
#/home/nishantkumar/Desktop/Yade201802b/build/bins/yade-2018.02b in <module>()
#----> 1 O.interactions[0,1].phys.dict()

#AttributeError: 'NoneType' object has no attribute 'dict'

Any reason for this?

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