Ejemplo n.º 1
0
        [Law2_Dem3DofGeom_FrictPhys_CundallStrack()],
    ),
    ## Apply gravity
    GravityEngine(gravity=[0, -9.81, 0]),

    ## NOTE: Non zero Cundall damping affected a dynamic simulation!
    NewtonIntegrator(damping=0.3),

    ## Apply kinematics to walls
    ## angularVelocity = 0.73 rad/sec = 7 rpm
    RotationEngine(subscribedBodies=walls,
                   rotationAxis=[0, 0, 1],
                   rotateAroundZero=True,
                   angularVelocity=0.73)
]

for b in o.bodies:
    if isinstance(b.shape, Sphere):
        b.state.blockedDOFs = 'z'  # blocked movement along Z

o.dt = 0.02 * utils.PWaveTimeStep()

o.saveTmp('init')

from woo import qt
renderer = qt.Renderer()
renderer.wire = True
#qt.Controller()
qt.View()
O.run()
Ejemplo n.º 2
0
qt.Controller()
qt.View()


O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_Dem3DofGeom(),Ig2_Facet_Sphere_Dem3DofGeom(),Ig2_Wall_Sphere_Dem3DofGeom()],
        [Ip2_FrictMat_FrictMat_FrictPhys()],
        [Law2_Dem3DofGeom_FrictPhys_CundallStrack()],
    ),
    GravityEngine(gravity=[1e2,1e2,1e2]),
    NewtonIntegrator(damping=0.01),
    ]

O.dt=utils.PWaveTimeStep()
O.save('/tmp/a.xml')
O.saveTmp()

from woo import log
log.setLevel('Ig2_Wall_Sphere_Dem3DofGeom',log.TRACE)

O.run()
#O.bodies.append([
#    utils.facet([[-1,-1,0],[1,-1,0],[0,1,0]],dynamic=False,color=[1,0,0],young=1e3),
#    utils.facet([[1,-1,0],[0,1,0,],[1,.5,.5]],dynamic=False,young=1e3)
#])
#import random

Ejemplo n.º 3
0
#!/usr/local/bin/woo-trunk -x
# -*- coding: utf-8 -*-

o = Omega()
o.engines = [
    ForceResetter(),
    InsertionSortCollider([
        Bo1_Sphere_Aabb(),
    ]),
    IGeomDispatcher([Ig2_Sphere_Sphere_Dem3DofGeom()]),
    IPhysDispatcher([Ip2_2xFrictMat_CSPhys()]),
    LawDispatcher([Law2_Dem3Dof_CSPhys_CundallStrack()]),
    GravityEngine(gravity=[0, 0, -9.81]),
    NewtonIntegrator(damping=0.01)
]

from woo import utils

o.bodies.append(utils.sphere([0, 0, 6], 1, dynamic=True, color=[0, 1, 0]))
o.bodies.append(utils.sphere([0, 0, 0], 1, dynamic=False, color=[0, 0, 1]))
o.dt = .2 * utils.PWaveTimeStep()

from woo import qt
qt.Controller()
qt.View()
Ejemplo n.º 4
0
           isoPrestress=isoPrestress))
sphDict = pickle.load(open(packingFile))
from woo import pack
sp = pack.SpherePack()
sp.fromList(sphDict['spheres'])
sp.cellSize = sphDict['cell']

import numpy
avgRadius = numpy.average([r for c, r in sp])
O.bodies.append([utils.sphere(c, r, color=utils.randomColor()) for c, r in sp])
O.periodic = True
O.cell.refSize = sp.cellSize
axis = 2
ax1 = (axis + 1) % 3
ax2 = (axis + 2) % 3
O.dt = dtSafety * utils.PWaveTimeStep()

import woo.log
#woo.log.setLevel('PeriTriaxController',woo.log.TRACE)
import woo.plot as yp

O.engines = [
    ForceResetter(),
    InsertionSortCollider([
        Bo1_Sphere_Aabb(aabbEnlargeFactor=intRadius, label='is2aabb'),
    ],
                          sweepLength=.05 * avgRadius,
                          nBins=5,
                          binCoeff=5),
    InteractionLoop(
        [Ig2_Sphere_Sphere_Dem3DofGeom(distFactor=intRadius, label='ss2d3dg')],
Ejemplo n.º 5
0
        pack.regularHexa(pack.inEllipsoid(
            (xyz[0] * (sizeBox + gapBetweenBoxes), xyz[1] *
             (sizeBox + gapBetweenBoxes) + sizeBox * 0.5, xyz[2] *
             (sizeBox + gapBetweenBoxes) - radiusKnife + sizeBox * 0.6),
            (sizeBox / 2, sizeBox / 2, sizeBox / 2)),
                         radius=radiusSph,
                         gap=0,
                         color=colorSph))
    if (colorSph == colorsph1):
        colorSph = colorsph2
    else:
        colorSph = colorsph1

from woo import qt

O.dt = 2 * utils.PWaveTimeStep()  # We do not need now a high accuracy
O.engines = [
    ForceResetter(),
    InsertionSortCollider([
        Bo1_Sphere_Aabb(),
        Bo1_Facet_Aabb(),
    ]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_L3Geom(),
         Ig2_Facet_Sphere_L3Geom()],
        [Ip2_FrictMat_FrictMat_FrictPhys()],
        [Law2_L3Geom_FrictPhys_ElPerfPl()],
    ),
    GravityEngine(gravity=(0, 0, -9.8)),
    TranslationEngine(translationAxis=[1, 0, 0], velocity=5,
                      ids=KnifeIDs),  # Buldozer motion
Ejemplo n.º 6
0
O.bodies.append(
    pack.regularOrtho(pack.inAlignedBox((3, 3, 3), (7, 7, 4)),
                      radius=.05,
                      gap=0))
O.engines = [
    ForceResetter(),
    FlatGridCollider(step=.2,
                     aabbMin=(0, 0, 0),
                     aabbMax=(10, 10, 5),
                     verletDist=0.005),
    # InsertionSortCollider([Bo1_Sphere_Aabb()],sweepLength=0.005),
    InteractionLoop(
        [Ig2_Sphere_Sphere_Dem3DofGeom()],
        [Ip2_FrictMat_FrictMat_FrictPhys()],
        [Law2_Dem3DofGeom_FrictPhys_CundallStrack()],
    ),
    GravityEngine(gravity=[0, 0, -10]),
    NewtonIntegrator(damping=0.4),
]
O.dt = .6 * utils.PWaveTimeStep()
O.saveTmp()
#O.step()
#while True:
#    O.step()
#    if len(O.interactions)>0 or O.bodies[1].state.pos[2]<.97: break
O.timingEnabled = True
O.run(5000, True)
timing.stats()
import sys
#sys.exit(0)