← Back to team overview

yade-users team mailing list archive

Re: [Question #268691]: Apply force only once

 

Hi Laura

I mean something like this:

#########################################
O.load('/path/spheresurface.yade')

MatBal=O.materials.append(FrictMat(...))


### green sphere
greenSphere = sphere((0.108,0.2289647116,0.7175),0.0199647116,color=(0,1,0),material='mat1')
# no need of utils.sphere
greenSphereId = O.bodies.append(greenSphere)




def guardar():
        ...

O.engines=[
        ForceResetter(),
        InsertionSortCollider(
                [Bo1_Sphere_Aabb(),
                        Bo1_Facet_Aabb(),
                        Bo1_Box_Aabb(),
                        Bo1_Wall_Aabb()]),
        InteractionLoop(
                [Ig2_Sphere_Sphere_ScGeom(),
                        Ig2_Facet_Sphere_ScGeom(),
                        Ig2_Wall_Sphere_ScGeom(),
                        Ig2_Box_Sphere_ScGeom()],
                [Ip2_FrictMat_FrictMat_FrictPhys()],
                [Law2_ScGeom_FrictPhys_CundallStrack()]
        ),
        # PyRunner(command='force()',
        #        iterPeriod=1,initRun=True,label='checker'), # this
PyRunner will not be used
        PyRunner(command='guardar()',
                iterPeriod=1,initRun=True,label='checker'),
        NewtonIntegrator(damping=0.5,gravity=(0,-9.81,0),label='newton'),
        yade.qt.SnapshotEngine(fileBase='3d-',iterPeriod=
1000,label='snapshot')
]
O.dt=utils.PWaveTimeStep()

greenSphere.state.vel = (1,0,0) # this :-)
#################################################3

cheers
Jan



2015-06-30 15:31 GMT+02:00 rayolau <question268691@xxxxxxxxxxxxxxxxxxxxx>:

> Question #268691 on Yade changed:
> https://answers.launchpad.net/yade/+question/268691
>
> rayolau posted a new comment:
> Hi Jan, thanks again!
>
> I don't understand what do you say about put the b.state.vel at the
> begin of the simulation without use PyRunner.  What type of function
> should I write in the script for identify the green sphere and then
> apply the vector velocity in this sphere? Sorry for question, could be a
> own mistake in my way of do the script.
>
> cheers,
>
> Laura
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References