esys :: lsm :: sim :: WavePropagation :: WavePropagation :: Class WavePropagation
[hide private]
[frames] | no frames]

Class WavePropagation

WavePropagationPy.WavePropagation --+
                                    |
                                   WavePropagation

Wave propagation model, extends the esys.lsm.sim.WavePropagationPy.WavePropagation by providing convenient methods for saving data, creating partices/bonds and creating seismographs.

Instance Methods [hide private]
 
__init__(self, domainBox, numWorkerProcesses=2, mpiDimList=[0,0,0], do2d=False, timeStepSize=0.05, dampingViscosity=0.0)
Initialise a wave propagation model.
 
createParticles(self, particles)
Creates model particles.
 
createBonds(self, connections, tagBondPrmDict)
Creates elastic bonds between particles.
 
addSource(self, source)
Add a source disturbance to the model.
 
createSource(self, prm)
Creates a propagation source (a WaveSource object) within the model.
float
getTime(self)
Returns simulation time value (simply number of time steps multiplied by the time step size).
 
createSources(self, sourcesPrms)
Creates multiple propagation sources.
 
createSeismographGroup(self, posnIteratable, fileNamePrefix, sourcePosn)
Creates a group of seismographs (a SeismographGroup obect) from a specified sequence of spatial locations.
 
saveSeismoData(self)
Appends seismograph data to file for the current time step.
 
writeReorderedRecordSectionData(self)
Reads time-ordered record-section data from file and writes a distance-from-source ordered file.
 
getParticleDataFileName(self, idx, fileNamePrefix)
Returns the name of the file where particle data is saved for the specifed index.
 
writeParticleDataOrig(self, idList, index, fileNamePrefix="particle_")
Pure python-implemented version of saving particle displacement data, the C++ implementation provided by esys.lsm.sim.WavePropagation.WavePropagation class is faster.
 
writeParticleData(self, index, fileNamePrefix="particle_")
Writes particle displacement and velocity data to file.
Method Details [hide private]

__init__(self, domainBox, numWorkerProcesses=2, mpiDimList=[0,0,0], do2d=False, timeStepSize=0.05, dampingViscosity=0.0)
(Constructor)

 

Initialise a wave propagation model.

Parameters:
  • domainBox (BoundingBox) - a BoundingBox which specifies the model particle domain.
  • numWorkerProcesses (int) - the number of MPI worker processes used in model computations.
  • mpiDimList (list) - sequence of 3 int elements specifying the domain decomposition used for the MPI worker processes.
  • do2d (bool) - if True, forces the model to perform 2d calculations (particles move only in the x-y plane).
  • timeStepSize (float) - size of the time-step in the explicit integration scheme.
  • dampingViscosity (float) - if > 0 a damping viscosity is applied to particles.

createParticles(self, particles)

 

Creates model particles.

Parameters:
  • particles (sequence) - A sequence of esys.lsm.geometry.SimpleSphere objects.

createBonds(self, connections, tagBondPrmDict)

 

Creates elastic bonds between particles.

Parameters:
  • connections (sequence of esys.lsm.geometry.GeometryPy.TaggedIdConnection) - create a bond for each connection which has a tag key in the tagBondPrmDict dictionary.
  • tagBondPrmDict (dict of tag:float) - a dictionary of (connectionTag:normalK) pairs. Connections with tag connectionTag will have a corresponding linear elastic bond created with spring constant normalK.

addSource(self, source)

 

Add a source disturbance to the model.

Parameters:

createSource(self, prm)

 

Creates a propagation source (a WaveSource object) within the model.

Parameters:
  • prm (SourcePrms) - parameters for creating a WaveSource object.

getTime(self)

 

Returns simulation time value (simply number of time steps multiplied by the time step size).

Returns: float
Simulation time.

createSources(self, sourcesPrms)

 

Creates multiple propagation sources.

Parameters:
  • sourcesPrms (sequence of SourcePrms objects) - A WaveSource is created for each object in this sequence.

createSeismographGroup(self, posnIteratable, fileNamePrefix, sourcePosn)

 

Creates a group of seismographs (a SeismographGroup obect) from a specified sequence of spatial locations.

Parameters:
  • posnIteratable (sequence of Vec3) - a sequence of coordinates which indicate the locations of seismographs. A Seismograph object is created for each point in posnIteratable.
  • fileNamePrefix (string) - Seismograph data is saved to files with this file name prefix.
  • sourcePosn (Vec3) - location of the point-source disturbance.

getParticleDataFileName(self, idx, fileNamePrefix)

 

Returns the name of the file where particle data is saved for the specifed index.

Parameters:
  • idx (int) - The snap-shot/frame number
  • fileNamePrefix (string) - The returned file name is a concatenation of this prefix with a suffix formed using the index argument.

writeParticleDataOrig(self, idList, index, fileNamePrefix="particle_")

 

Pure python-implemented version of saving particle displacement data, the C++ implementation provided by esys.lsm.sim.WavePropagation.WavePropagation class is faster. Writes particle displacement and velocity data to file. Each line of the file is 'px py pz dx dy dz vx vy vz' where p=(px,py,pz) is the particle position, d=(dx,dy,dz) is the current particle displacement (ie position relative to initial position) and (vx,vy,vz) is the particle velocity.

Parameters:
  • idList (sequence of int) - list of particle id's for which data will be saved.
  • index (int) - integer used to generate file name.
  • fileNamePrefix (string) - prefix of file where displacement data is saved.

writeParticleData(self, index, fileNamePrefix="particle_")

 

Writes particle displacement and velocity data to file. Each line of the file is 'px py pz dx dy dz vx vy vz' where p=(px,py,pz) is the particle position, d=(dx,dy,dz) is the current particle displacement (ie position relative to initial position) and (vx,vy,vz) is the particle velocity. Particle data is saved for all particles with an id in the list returned by the self.getParticleDataIdList.

Parameters:
  • index (int) - integer used to generate file name.
  • fileNamePrefix (string) - prefix of file where displacement data is saved.