Ejemplo n.º 1
0
simulation.insertIntegrator(osi)
simulation.insertNonSmoothProblem(osnspb)

# simulation initialization
bouncingBox.initialize(simulation)

# Get the values to be plotted
# ->saved in a matrix dataPlot

N = (T - t0) / h
dataPlot = zeros((N + 1, 4))

#
# numpy pointers on dense Siconos vectors
#
q = body.q()
v = body.velocity()

#
# initial data
#
dataPlot[0, 0] = t0
dataPlot[0, 1] = q[2]
dataPlot[0, 2] = v[2]

k = 1

# time loop
while (simulation.hasNextEvent()):

    broadphase.buildInteractions(bouncingBox.currentTime())
Ejemplo n.º 2
0
# simulation initialization

bouncingBox.setSimulation(simulation)
bouncingBox.initialize()

# Get the values to be plotted
# ->saved in a matrix dataPlot

N = (T - t0) / h
dataPlot = zeros((N+1, 4))

#
# numpy pointers on dense Siconos vectors
#
q = body.q()
v = body.velocity()

#
# initial data
#
dataPlot[0, 0] = t0
dataPlot[0, 1] = q[2]
dataPlot[0, 2] = v[2]

k = 1

# time loop
while(simulation.hasNextEvent()):

    broadphase.buildInteractions(bouncingBox.currentTime())