← Back to team overview

yade-users team mailing list archive

Re: [Question #707311]: How to add rotation on the Boxfactory?

 

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

Mu Wh posted a new comment:
Hi :
  I’m sorry to trouble you because my code was still having problems a week after I tried to fix it.  When I run the code the terminal shows 'BoxFactory' object has no attribute 'id'. I think Boxfactory might not be able to rotate. The code and error are shown below.

  CODE:
from yade import pack,  geom

#material
steelID= O.materials.append(FrictMat(density=7800,young=2.2e9,poisson=.3,frictionAngle=math.atan(.62),label="316lsteel"))

#geometry
CylinderID=O.bodies.append(geom.facetCylinder((0,0,10), radius=10, height=20, orientation=Quaternion((1, 0, 0), 0), wire=True,segmentsNumber=60, dynamic=False, wallMask=6, angleRange=None, closeGap=False, radiusBottomInner=-1,material='316lsteel'))

#Engine
O.engines=[
       ForceResetter(),
       InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Cylinder_Aabb()]),
       InteractionLoop(
               [Ig2_Facet_Sphere_ScGeom(),Ig2_Sphere_Sphere_ScGeom()],
               [Ip2_FrictMat_FrictMat_MindlinPhys(en=0.636, es=0.636,frictAngle=math.atan(.62))],
               [Law2_ScGeom_MindlinPhys_Mindlin()]
        ),
         
           Factory:=BoxFactory(
                maxParticles=2000,
                extents=(3, 3, 3),
                center=(3, 3, 10),
                rMin=0.28,
                rMax=0.29,
                vMin=10,
                vMax=10,
                vAngle=0,
                massFlowRate=10000.,
                normal=(0, 0, -1),
                label='factory',
               materialId=steelID
               
        ),

        RotationEngine(rotationAxis=(0, 0, 1), angularVelocity=0.1, rotateAroundZero=True, zeroPoint=(0, 0, 10),ids=[Factory.id]),# factory motion
        NewtonIntegrator(gravity=(0,0,-9.81))
]

O.dt=.5e-4*utils.PWaveTimeStep()
O.saveTmp()
O.run()

Error
Welcome to Yade 20230716-7372~493b53a~focal1 
Using python version: 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0]
TCP python prompt on localhost:9000, auth cookie `aekdsy'
XMLRPC info provider on http://localhost:21000
Running script movingfactory.py
Traceback (most recent call last):
  File "/usr/bin/yadedaily", line 343, in runScript
    execfile(script,globals())
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 87, in execfile
    exec_(code, myglobals, mylocals)
  File "movingfactory.py", line 34, in <module>
    RotationEngine(rotationAxis=(0, 0, 1), angularVelocity=0.1, rotateAroundZero=True, zeroPoint=(0, 0, 10),ids=[Factory.id]),# factory motion
AttributeError: 'BoxFactory' object has no attribute 'id'
[[ ^L clears screen, ^U kills line. F12 controller, F11 3D view (press "h" in 3D view for help), F10 both, F9 generator, F8 plot. ]]

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