Noimplementederror: run method needs to be implemented in derived class
Dear all,
when i run example shearcell.py in windows using vs2010,
an error happened as "Notimplemented
and no results are outputted.
this is what happened in the vs command prompt:
-------
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>f:
F:\>cd F:\Simluations\
F:\Simluations\
exe shearcell.py
No SPAWN: CSubLatticeCont
No SPAWN: slave started at local/global rank 1639951114 / 1
[inf] circular x-size incompatible with range, adjusting...
[inf] New range=2.5
constructing fieldmaster for field e_kin
constructing fieldmaster for field postion
constructing fieldmaster for field force
Traceback(most recent call last):
file 'shearcell.py',line 198, in (module)
sim.run()
Notimplementede
-------
the following is the input file, shearcell.py
#shearcell.py: An annular shear cell simulation using ESyS-Particle
# Author: D. Weatherley
# Date: 24 April 2011
# Organisation: ESSCC, The University of Queensland, Brisbane, AUSTRALIA
# (C) All rights reserved, 2011.
#
#
#import the appropriate ESyS-Particle modules:
#from esys.lsm import *
#from esys.lsm.util import *
#from esys.lsm.geometry import *
from FoundationPy import Vec3, BoundingBox
from LsmPy import *
from GeometryPy import *
from WallLoader import WallLoaderRunnable
from ServoWallLoader import ServoWallLoader
#create a simulation container object:
# N.B. there must be at least two sub-divisions
# in the X-direction for periodic boundaries
sim = LsmMpi (numWorkerProce
sim.initNeighbo
particleType = "NRotSphere",
gridSpacing = 2.5,
verletDist = 0.5
)
#specify the number of timesteps and timestep increment:
sim.setNumTimeS
sim.setTimeStep
#enforce two-dimensional computations:
sim.force2dComp
#specify the spatial domain and direction of periodic boundaries:
domain = BoundingBox ( Vec3 (0,0,0), Vec3 (10,10,0) )
sim.setSpatialD
bBox = domain,
circDimList = [True, False, False]
)
#construct a rectangle of unbonded particles:
packer = RandomBoxPacker (
minRadius = 0.1,
maxRadius = 0.5,
cubicPackRadius = 2.2,
maxInsertFails = 1000,
bBox = BoundingBox(
Vec3(0.0, 0.0,0.0),
Vec3(10.0, 10.0, 0.0)
),
circDimList = [True, False, False],
tolerance = 1.0e-5
)
packer.generate()
particleList = packer.
#tag particles along base and top of rectangle
#then add the particles to the simulation object:
for pp in particleList:
centre = pp.getPosn()
radius = pp.getRadius()
Y = centre[1]
if (Y < 1.0): # particle is near the base (tag=2)
pp.setTag (2)
elif (Y > 9.0): # particle is near the top (tag=3)
pp.setTag (3)
else: # particle is inside the shear cell (tag=1)
pp.setTag (1)
sim.createPart
#set the density of all particles:
sim.setParticle
tag = 1,
mask = -1,
Density = 100.0
)
sim.setParticle
tag = 2,
mask = -1,
Density = 100.0
)
sim.setParticle
tag = 3,
mask = -1,
Density = 100.0
)
#add driving walls above and below the particle assembly:
sim.createWall (
name = "bottom_wall",
posn = Vec3 (0,0,0),
normal = Vec3 (0,1,0)
)
sim.createWall (
name = "top_wall",
posn = Vec3 (0,10,0),
normal = Vec3 (0,-1,0)
)
#unbonded particle-pairs undergo frictional interactions:
sim.createInter
NRotFrictionPrms (
name = "pp_friction",
normalK = 1000.0,
dynamicMu = 0.6,
shearK = 100.0
)
)
#particles near the base (tag=2) are bonded to the bottom wall:
sim.createInter
NRotBondedWallPrms (
name = "bwall_bonds",
wallName = "bottom_wall",
normalK = 1000.0,
particleTag = 2
)
)
#particles near the base (tag=3) are bonded to the top wall:
sim.createInter
NRotBondedWallPrms (
name = "twall_bonds",
wallName = "top_wall",
normalK = 1000.0,
particleTag = 3
)
)
#add local damping to avoid accumulating kinetic energy:
sim.createInter
LinDampingPrms (
name = "damping",
viscosity = 1.0,
maxIterations = 100
)
)
#add ServoWallLoader
servo_loader1 = ServoWallLoader
LsmMpi = sim,
interactionName = "twall_bonds",
force = Vec3 (0.0, -1000.0, 0.0),
startTime = 0,
rampTime = 5000
)
sim.addPreTimeS
wall_loader1 = WallLoaderRunnable(
LsmMpi = sim,
wallName = "bottom_wall",
vPlate = Vec3 (0.125, 0.0, 0.0),
startTime = 30000,
rampTime = 10000
)
sim.addPreTimeS
#add a FieldSaver to store total kinetic energy:
sim.createField
ParticleScalar
fieldName=
fileName=
fileFormat="SUM",
beginTimeStep=0,
endTimeStep=
timeStepIncr=1
)
)
#add FieldSavers to store wall forces and positions:
posn_saver = WallVectorField
wallName=
fieldName=
fileName=
fileFormat=
beginTimeStep=0,
endTimeStep=
timeStepIncr=1
)
sim.createField
force_saver = WallVectorField
wallName=
fieldName="Force",
fileName=
fileFormat=
beginTimeStep=0,
endTimeStep=
timeStepIncr=1
)
sim.createField
#add a CheckPointer to store simulation data:
sim.createCheck
CheckPointPrms (
fileNamePrefix = "snapshot",
beginTimeStep = 0,
endTimeStep = 100000,
timeStepIncr = 5000
)
)
#sim.createChec
# CheckPointPrms (
# fileNamePrefix = "bingle_data",
# beginTimeStep = 0,shearcell
# endTimeStep = 10000,
# timeStepIncr = 100
# )
#)
#execute the simulation:
sim.run()
#sim.exit()
can anyone help me fix this, many thanks.
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask guo for more information if necessary.