esys :: lsm :: examples :: waveprop :: WaveSim :: WaveSim :: Class WaveSim
[hide private]
[frames] | no frames]

Class WaveSim

Wrapper class for 2D and 3D wave propagation simulation.

Instance Methods [hide private]
 
__init__(self, options=None)
Initialises simulation parameters.
 
is3d(self)
Returns True if this is a 3D simulation (ie whether (self.particlesPerDim[2] > 1).
 
is2d(self)
Returns True if this is a 3D simulation (ie (not self.is3d()).
 
createParticleBlock(self)
Creates a cubic close-packing of particles.
 
getParticleBlock(self)
Returns the collection/sequence of particles which represent an elastic block.
BoundingBox
getParticleBBox(self)
Returns bounding box of the elastic block of particles.
 
tagBoundaryParticles(self)
Tags outer boundary particles so they can be bonded to fixed walls.
 
createLsmWaveSim(self)
Create the uninitialised wave propagation model ie the WavePropagation object.
 
getLsmWaveSim(self)
 
createParticles(self)
Create initial configuration of particles in the model
 
createBonds(self)
Creates linear elastic bonds between particles.
 
createSource(self)
Create the source disturbance which generates the wave.
 
createBoundaryWalls(self)
Create the walls and the elastic bonds between walls and the tagged particles, leave the maximum y side as a free surface (no elastic wall).
 
createLineOfSeismos(self, pt1, pt2, srcPt, numSeismos, fileNamePrefix)
Create a line of seismographs through the particle block, between two specified points.
 
createSeismographs(self)
Creates lines of seismographs through the particle block
list of particle ids
getOutputParticleIdList(self)
Returns a list of particle ids, particles with id in this list have their position and displacement data written to file.
 
runTimeSteps(self)
Runs the model for self.maxNumTimeSteps time steps.
 
runSim(self)
Sets up wave propagation model and executes simulation.
Method Details [hide private]

__init__(self, options=None)
(Constructor)

 

Initialises simulation parameters.

The options argument, is an object with the following attributes:

  • radius - Particle radius (float)
  • sourceDepth - Relative depth of source disturbance (float in [0,1]).
  • sourceFrequency - Frequency of sinusoidal source disturbance (float)
  • sourceMaxDisplacement - Maximum relative displacement of source disturbance (list of 3 floats)
  • upperSpringK - Spring constant for upper elastic medium
  • lowerSpringK - Spring constant for lower elastic medium
  • upperMediumDepth - Depth of upper elastic medium (float in [0,1])
  • particlesPerDim - Size of particle block (list of 3 ints)
  • particleDataIncr - Particle data is saved every particleDataIncr time steps (int)
  • seismoDataIncr - Seismograph data is saved every seismoDataIncr time steps (int)
  • numWorkerProcesses - Number of MPI worker processes (int)
  • mpiDimList - Spatial division of domain amongst MPI workers (list of 3 ints)
  • timeStepSize - Time step size for explicit integration (float)
  • maxNumTimeSteps - Number of time steps to run the simulation (float)
  • verbosity - If True output lots of LSM debugging info (bool)
Parameters:
  • options (object) - An object with attributes as specified above.

is3d(self)

 

Returns True if this is a 3D simulation (ie whether (self.particlesPerDim[2] > 1).

Returns:
True if this is a 3D simulation, False if it is 2D.

is2d(self)

 

Returns True if this is a 3D simulation (ie (not self.is3d()).

Returns:
True if this is a 2D simulation, False if it is 3D.

createParticleBlock(self)

 

Creates a cubic close-packing of particles.

Returns:
Collection of SimpleSphere objects.

getParticleBlock(self)

 

Returns the collection/sequence of particles which represent an elastic block.

Returns:
Collection of SimpleSphere objects.

getParticleBBox(self)

 

Returns bounding box of the elastic block of particles.

Returns: BoundingBox
Axis aligned bounding box.

createBonds(self)

 

Creates linear elastic bonds between particles. Two regions of bonds created with different elastic constants.

createSource(self)

 

Create the source disturbance which generates the wave. A single particle is displaced over a small distance. The source is created centred in the x and z coords, at a specified y coord depth.

createLineOfSeismos(self, pt1, pt2, srcPt, numSeismos, fileNamePrefix)

 

Create a line of seismographs through the particle block, between two specified points.

Parameters:
  • pt1 (Vec3) - End point of line
  • pt2 (Vec3) - other end-point of line
  • srcPt (Vec3) - location of source point-disturbance.

getOutputParticleIdList(self)

 

Returns a list of particle ids, particles with id in this list have their position and displacement data written to file.

Returns: list of particle ids
List of particle ids.