Error:Polyhedra_support
Greetings, Dear Users I'm sorry to bother you all. I have encountered an error while modeling with polyhedra, but I don't know how to solve it. Although I found the question in the forum, I don't quite understand it and would appreciate a detailed answer and solution.
Welcome to Yade 2023-10-23.git-2a038cc Using python version: 3.10.12 (main, Nov 20 2023, 15:14:05) \[GCC 11.4.0\] TCP python prompt on localhost:9000, auth cookie \`eyckds' XMLRPC info provider on [http://localhost:21000](http://localhost:21000) Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. Running script zhuang2.py \[\[ ^L clears screen, ^U kills line. F12 controller, F11 3D view (press "h" in 3D view for help), F10 both, F9 generator, F8 plot. \]\]
Polyhedra_support.cpp:234 bool yade::do_intersect(yade::Polyhedron, yade::Polyhedron, std::vector&): Unhandled switch case:0, function do_intersect(…). In \[1\]: Polyhedra_support.cpp:234 bool yade::do_intersect(yade::Polyhedron, yade::Polyhedron, std::vector&): Unhandled switch case:0, function do_intersect(…). Polyhedra_support.cpp:234 bool yade::do_intersect(yade::Polyhedron, yade::Polyhedron, std::vector&): Unhandled switch case:0, function do_intersect(…). In \[1\]: Polyhedra_support.cpp:234 bool yade::do_intersect(yade::Polyhedron, yade::Polyhedron, std::vector&): Unhandled switch case:0, function do_intersect(…).
from yade import pack
from pylab import rand
from yade import qt
from yade import plot, polyhedra_utils
from yade import ymport
mat = O.materials.append(FrictMat(density=2600, young=1E9, poisson=0.3, frictionAngle=0.6))
m = PolyhedraMat()
m.density = 2600 #kg/m^3
m.young = 1E6 #Pa
m.poisson = 20000 / 1E6
m.frictionAngle = 0.6
m.strength = 1e-2
m.strengthTau=3e-3
m.IsSplitable=True
m.sigmaCZ=5e5
m.sigmaCD=1e6
m.Wei_m=3
m.Wei_S0=8e5
m.Wei_V0=1e-9
m.Wei_P=0.6
#w1 = utils.wall((0,0,0), axis=2, sense=-1, material=mat)
#w2 = utils.wall((0,-2,0), axis=1, sense=-1, material=mat)
#w3 = utils.wall((0,2,0), axis=1, sense=-1, material=mat)
#w4 = utils.wall((-2,0,0), axis=0, sense=-1, material=mat)
#w5 = utils.wall((2,0,0), axis=0, sense=-1, material=mat)
#w1_id, w2_id, w3_id, w4_id, w5_id = O.bodies.append([w1, w2, w3, w4, w5])
fct1 = O.bodies.append(ymport.stl('he.stl', color=(0, 0, 2), material=mat))
psdS = [0.02,0.04,0.045,0.05,0.06,0.08,0.12]
psdC =[0.0,0.1,0.3,0.3,0.3,0.7,1.0]
sp = pack.SpherePack();
sp.makeCloud((0.0,0.0,0.0), (2.0,2.0,10.0), psdSizes=psdS, psdCumm=psdC, porosity=0.0001, num=200, seed=5)
O.bodies.append([utils.sphere(center,rad,material=mat) for center,rad in sp])
sp.toSimulation(material=mat)
z=0
for i in range(len(O.bodies)):
b = O.bodies[i]
if isinstance(b.shape, Sphere):
bidz=b.id
pos1,r = b.state.pos, b.shape.radius
b2=polyhedra_utils.polyhedra(m,size=(r,r,r),seed=5)
b2.state.pos=pos1
O.bodies.erase(bidz)
z+=1
bidz=O.bodies.append(b2)
fct = O.bodies.append(ymport.stl('zhuang1.stl', color=(0, 0, 1), material=mat))
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Facet_Aabb()], verletDist=0.05*0.02),
InteractionLoop(
[Ig2_Polyhedra_Polyhedra_PolyhedraGeom(), Ig2_Facet_Polyhedra_PolyhedraGeom()],
[Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()],
[Law2_PolyhedraGeom_PolyhedraPhys_Volumetric()],
),
NewtonIntegrator(damping=0.4,gravity=(0.0,0.0,-10.0)),
SplitPolyMohrCoulomb(iterPeriod=10, dead=False, label='Splitter'),
TranslationEngine(translationAxis=[0.0, 0.0, -1.0], velocity=-1, ids=fct, label='TT',dead=True),
PyRunner(iterPeriod=100,command='checkUnbalanced()', label='cha',dead=False),
]
def checkUnbalanced():
if unbalancedForce() < .05:
TT.dead=False
O.pause()
O.dt = 0.000000025
O.run(300000)
Edited by Su Huanyu