Exemple #1
0
def initTest():
    global mode
    print("init")
    if O.iter>0:
        O.wait();
        O.loadTmp('initial')
        print("Reversing plot data"); plot.reverseData()
    maxStrainRate=Vector3(1,1,1);
    goal=Vector3(1,1,1);
    if not biaxial: # uniaxial
        maxStrainRate[axis]=abs(strainRateTension) if mode=='tension' else abs(strainRateCompression)
        maxStrainRate[ax1]=maxStrainRate[ax2]=1000*maxStrainRate[axis]
        goal[axis]=1 if mode=='tension' else -1;
    else:
        maxStrainRate[axis]=abs(strainRateTension) if mode=='tension' else abs(strainRateCompression)
        maxStrainRate[ax1]=maxStrainRate[axis]
        maxStrainRate[ax2]=1000*maxStrainRate[axis]
        goal[axis]=1 if mode=='tension' else -1;
        goal[ax1]=goal[axis]
    strainer.maxStrainRate=maxStrainRate
    strainer.goal=goal
    try:
        from woo import qt
        renderer=qt.Renderer()
        renderer.scaleDisplacements=True
        renderer.displacementScale=(1000,1000,1000) if mode=='tension' else (100,100,100)
    except ImportError: pass
    print("init done, will now run.")
    O.step(); O.step(); # to create initial contacts
    # now reset the interaction radius and go ahead
    ss2d3dg.distFactor=-1.
    is2aabb.aabbEnlargeFactor=-1.
    O.run()
Exemple #2
0
def initTest():
    global mode
    print "init"
    if O.iter > 0:
        O.wait()
        O.loadTmp('initial')
        print "Reversing plot data"
        plot.reverseData()
    else:
        plot.plot()
    strainer.strainRate = abs(
        strainRateTension
    ) if mode == 'tension' else -abs(strainRateCompression)
    try:
        from woo import qt
        renderer = qt.Renderer()
        renderer.dispScale = (1000, 1000,
                              1000) if mode == 'tension' else (100, 100, 100)
    except ImportError:
        pass
    print "init done, will now run."
    O.step()
    # to create initial contacts
    # now reset the interaction radius and go ahead
    if not scGeom: ss2d3dg.distFactor = -1.
    else: ss2sc.interactionDetectionFactor = 1.
    is2aabb.aabbEnlargeFactor = -1.

    O.run()
Exemple #3
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()