pp.getForce() NRotSphere() terminates the simulation

Asked by Jiadun Liu on 2017-12-03

Dear All,

When I use getForec for the NRotSphere I have the following problem.

gle$ mpirun.mpich -np 2 esysparticle bingle.py
0 -4.999 4.999 -4.999
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 6915 RUNNING AT bwjliu-HP-ZBook-15
= EXIT CODE: 139
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestion

The following is the simple bingle.py code where close to the end of the simulation I have added a while loop.
#bingle.py: A simple two-particle collision simulation using
# ESyS-Particle
# Author: D. Weatherley
# Date: 15 May 2007
# Organisation: ESSCC, University of Queensland
# (C) All rights reserved, 2007.
#
#
#import the appropriate ESyS-Particle modules:
from esys.lsm import *
from esys.lsm.util import Vec3, BoundingBox

#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 the number of timesteps and timestep increment:
sim.setNumTimeSteps(10000)
sim.setTimeStepSize(0.001)
#specify the spatial domain for the simulation:
domain = BoundingBox(Vec3(-20,-20,-20), Vec3(20,20,20))
sim.setSpatialDomain(domain)

#add the first particle to the domain:
particle=NRotSphere(id=0, posn=Vec3(-5,5,-5), radius=1.0, mass=1.0)
particle.setLinearVelocity(Vec3(1.0,-1.0,1.0))
sim.createParticle(particle)

#add the second particle to the domain:
particle=NRotSphere(id=1, posn=Vec3(5,5,5), radius=1.5, mass=2.0)
particle.setLinearVelocity(Vec3(-1.0,-1.0,-1.0))
sim.createParticle(particle)

#specify the type of interactions between colliding particles:
sim.createInteractionGroup(
   NRotElasticPrms(
      name = "elastic_repulsion",
      normalK = 10000.0,
      scaling = True
   )
)

#Execute the simulation:
i = 0
while (i <=10):
 sim.runTimeStep()
 ParticleList = sim.getParticleList()
 for pp in ParticleList:
  print pp.getId(),pp.getPosition(),pp.getForce()
 i += 1
sim.exit()

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Dion Weatherley
Solved:
2017-12-04
Last query:
2017-12-04
Last reply:
2017-12-04
Best Dion Weatherley (d-weatherley) said : #1

Hi Jiadun,

Thanks for bringing this to our attention. I've reproduced the bug using your supplied bingle.py script and found the source of the problem. It has been fixed in rev. 1186 of the ESyS-Particle trunk. Upgrading to the latest development release should fix the problem.

Cheers,

Dion

Jiadun Liu (liujiadun) said : #2

Thanks Dion Weatherley, that solved my question.