problem with povray

Asked by Robert Sarracino

I'm running a simulation using the povray Runnable in the tutorial. However, it won't generate an image beyond a certain number of time steps. I've installed a 'print count' inside the Runnable and it's being called, and 'count' is printing to the screen (up to the number of time steps divided by interval), but the images aren't being generated.

For instance, in my main code I set the time steps & time step size as

sim.setNumTimeSteps(1000000)
sim.setTimeStepSize(0.001)

when I set the interval to 10000, there are no povray images generated -- however, as mentioned above, the Runnable is being called at each step.

povcam = POVsnaps(sim=sim, interval=10000)
povcam.configure(lookAt=Vec3(0,0,0), camPosn=Vec3(14,0,14))
sim.addPostTimeStepRunnable(povcam)

On the other hand, when I set interval=1, reducing the total number of time steps (I tried this to debug the program) the program generated 8 images and no more.

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Sarracino
Solved:
Last query:
Last reply:
Revision history for this message
Robert Sarracino (robert-sarracino) said :
#1

I should add that the simulation in the tutorial ran without a problem -- all 100 images were generated.

Revision history for this message
Vince Boros (v-boros) said :
#2

Hello Robert:

Send me your scripts. I will try to replicate the problem on my machine. I cannot think of anything obvious that may be preventing the PNG files from being written.

Regards,

Vince

Revision history for this message
Robert Sarracino (robert-sarracino) said :
#3

I should add that the simulation in the tutorial ran without a problem -- all 100 images were generated.

Revision history for this message
Robert Sarracino (robert-sarracino) said :
#4

Hi Vince,

Please excuse my delay -- I've been sick for the past five days.

Here's my script. It's pretty simple at the moment. When I set numIceParticles to 1 I get all the POVray images. When I set numIceParticles to 2 or more, however, no images are generated.

# ice_rubble2D1: Ice impacting a beach or structure
# Author: R. Sarracino
# Date: February 5, 2014
# Organisation: Centre for Artic Resource Development (CARD), part of C-Core
# (C) All rights reserved, 2014.
#
#
# This is a 2D simulation with 1 m diameter ice particles (single layer),
# and non-rotational, unbonded particles.
#
#
#import the appropriate ESyS-Particle modules:
from esys.lsm import *
from esys.lsm.util import *
from esys.lsm.geometry import *
from POVsnaps import POVsnaps
from WallLoader import WallLoaderRunnable

# instantiate a simulation object
# and initialise the neighbour search algorithm:
sim = LsmMpi(numWorkerProcesses=1, mpiDimList=[1,1,1])
sim.initNeighbourSearch(particleType="NRotSphere",gridSpacing=2.5,verletDist=0.5)

# specify 2D
#sim.force2dComputations (True)

#set the number of timesteps and timestep increment:
# step size = .2*radius*sqrt(rho/E). Here I've reduced E from 9 GPa to 9 MPa
#sim.setNumTimeSteps(1000000)
#sim.setTimeStepSize(0.001)
sim.setNumTimeSteps(10000)
sim.setTimeStepSize(0.001)

#specify the spatial domain for the simulation:
#domain = BoundingBox(Vec3(-300,-5, 0), Vec3(30,25,0))
domain = BoundingBox(Vec3(-300,-10,0), Vec3(50,30,0))
sim.setSpatialDomain(domain)

# set values of simulation variables
numIceParticles = 2
particleRad = 0.5
particleMass = 706.5
normalStiffness = 9000000.0 # reduced by a factor of 1000 to increase timestep
poisRatio = 0.25
kinFriction = 0.4
statFriction = 0.6

# add the particles to the domain:
# there will be a line of 300 particles, radius 0.5 m, density 900
for count in range(numIceParticles):
# print "count = ", count
   xDist = -1.0*count
   particle=NRotSphere(id=0, posn=Vec3(xDist, 0, 0), radius=particleRad, mass=particleMass)
   sim.createParticle(particle)

# set stiffnesses & friction parameters (particles aren't bonded)
sim.createInteractionGroup (FrictionPrms(name="friction", youngsModulus = normalStiffness, poissonsRatio = poisRatio, dynamicMu = kinFriction, staticMu = statFriction))

#add a horizontal wall to act as a floor on which to bounce particles:
#sim.createWall(name="floor",posn=Vec3(0,4.5,0),normal=Vec3(0,1,0))

#add an angled wall to act as the ramp up which the ice moves:
sim.createWall(name="ramp",posn=Vec3(.6,0,0),normal=Vec3(-.5,0.866,0))

#specify the type of interactions between wall and particles:
#sim.createInteractionGroup(NRotElasticWallPrms(name = "elasticWall", wallName = "floor", normalK = normalStiffness))

#specify the type of interactions between wall and particles:
sim.createInteractionGroup(NRotElasticWallPrms(name = "elasticWall", wallName = "ramp", normalK = normalStiffness))

# add translational viscous damping
#sim.createInteractionGroup(LinDampingPrms(name="damping1", viscosity = 0.002, maxIterations = 50))

# add rotational viscous damping
#sim.createInteractionGroup(RotDampingPrms(name="damping2", viscosity = 0.002, maxIterations = 50))

# add a wall loader to move the ramp
wall_loader1 = WallLoaderRunnable (LsmMpi = sim, wallName = "ramp", vPlate = Vec3(-10.0, 0.0, 0.0), startTime = 0, rampTime = 50)
#sim.addPreTimeStepRunnable (wall_loader1)

#initialise gravity in the domain:
#sim.createInteractionGroup(GravityPrms(name="earth-gravity", acceleration=Vec3(0,-9.81,0)))

#add local viscosity to simulate air resistance:
#sim.createInteractionGroup(LinDampingPrms(name="linDamping",viscosity=0.1,maxIterations=100))

#sim.createCheckPointer(CheckPointPrms(fileNamePrefix = 'snapshot', beginTimeStep = 0, endTimeStep = 1000000, timeStepIncr = 5000))

#add a POVsnaps Runnable:
povcam = POVsnaps(sim=sim, interval=50)
povcam.configure(lookAt=Vec3(0,0,0), camPosn=Vec3(14,0,14))
sim.addPostTimeStepRunnable(povcam)

#execute the simulation
sim.run()

Revision history for this message
Robert Sarracino (robert-sarracino) said :
#5

I've rerun the simulation. I've created a single particle 2m above a wall, and have let it fall. I've then created 4 adjacent but unbonded particles 2m above the wall and have let them fall. After 220 time steps both simulations show identical distances of fall and velocities: this is the printout for the single particle

snapshot_t=220_1.txt
1
0 -0.2384811 0 0.5 0 -1 706.5 -0 0 0 -0 0 0 0 -2.1582 0 0 -6930.765 0 0 0 0
0
TMIG 0

and this is the printout for the four particles

snipshot_t=220_1.txt
4
-3 -0.2384811 0 0.5 0 -1 706.5 -3 0 0 -3 0 0 0 -2.1582 0 0 -6930.765 0 0 0 0
-1 -0.2384811 0 0.5 0 -1 706.5 -1 0 0 -1 0 0 0 -2.1582 0 0 -6930.765 0 0 0 0
-2 -0.2384811 0 0.5 0 -1 706.5 -2 0 0 -2 0 0 0 -2.1582 0 0 -6930.765 0 0 0 0
0 -0.2384811 0 0.5 0 -1 706.5 -0 0 0 -0 0 0 0 -2.1582 0 0 -6930.765 0 0 0 0
0
TMIG 0

However, 10 timesteps later something strange seems to happen. This is the printout for the single particle

snapshot_t=230_1.txt
1
0 -0.26060265 0 0.5 0 -1 706.5 -0 0 0 0 -0.25163631 0 0 -2.2563 0 0 -6930.765 0 0 0 0
0
TMIG 0

but the printout for the four particles shows that one has disappeared

snipshot_t=230_1.txt
4
-nan -nan 0 0.5 0 -1 706.5 -3 0 0 -3 -0.25163631 0 -nan -nan 0 0 -6930.765 0 0 0 0
-1 -0.26060265 0 0.5 0 -1 706.5 -1 0 0 -1 -0.25163631 0 0 -2.2563 0 0 -6930.765 0 0 0 0
-2 -0.26060265 0 0.5 0 -1 706.5 -2 0 0 -2 -0.25163631 0 0 -2.2563 0 0 -6930.765 0 0 0 0
0 -0.26060265 0 0.5 0 -1 706.5 -0 0 0 0 -0.25163631 0 0 -2.2563 0 0 -6930.765 0 0 0 0
0
TMIG 0

The only thing I can think of at the moment is that, the particles being in contact but not overlapping, there's an instability which has finally manifested itself -- one of the particles has been thrown out from the group. Eventually all the particles disappear.

Revision history for this message
Vince Boros (v-boros) said :
#6

Hi Robert.

In the loop for creating particles, the "id" parameter has an argument of "0" for all particles. Change the argument to "count" and all the PNG files should now be generated.

Also, I think that FrictionPrms is for rotational particles. I'm unsure if it is safe to use it with nonrotational. Either change the interaction to NRotFrictionPrms, or the particles to RotSphere.

I hope this helps you.

Regards,

Vince

Revision history for this message
Robert Sarracino (robert-sarracino) said :
#7

Yes, thanks, Vince -- that was the problem. It now works.