← Back to team overview

yade-users team mailing list archive

Re: [Question #693479]: How to initialize the angular velocity of a box made of pfacets

 

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

Rohit John posted a new comment:
Hello,

I found a work around to this problem. I used the rotationEngine to
initialise the angular velocity. It is active for the first few
iterations and then it will be turned off using a pyrunner command.

Kind regards,
RKJ

# -------------------------------------------------------------------------------------------------------------------------------------------------- script
O.engines += [
            RotationEngine(
                rotateAroundZero = True,
                zeroPoint        = (0,0,0),
                rotationAxis     = axis,
                angularVelocity  = -15,
                ids              = target.ids,
                label            = 'rotEngine'
            ),
            PyRunner(command = "switch_of_rot()", iterPeriod = 10, label = "rot_switch"),
]

def switch_of_rot():
    rotEngine.dead = True
    print("engine off")
    rot_switch.iterPeriod = 100000000
# --------------------------------------------------------------------------------------------------------------------------------------------------

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