Package esys :: Package lsm :: Module LsmPy :: Class LsmMpi
[hide private]
[frames] | no frames]

Class LsmMpi

 object --+    
          |    
??.instance --+
              |
             LsmMpi

Lattice Solid Model (parallelised using Message Passing Interface) container class for defining particle simulations.

Instance Methods [hide private]
 
__init__(...)
Sets up MPI worker processes for use in a cartesian grid decomposition of the particle domain.
 
__reduce__(...)
helper for pickle
 
addPostTimeStepRunnable(...)
Like the addPreTimeStepRunnable method, except the run method of runnable gets called at the end of a time-step.
 
addPreTimeStepRunnable(...)
Adds a Runnable object to the list of runnables.
 
addScalarTriangleSaveField(...)
Add a scalar triangle field saver to the simulation
 
addVectorTriangleSaveField(...)
Add a vector triangle field saver to the simulation
 
applyForceToWall(...)
A wall is displaced in the normal direction so that the total force applied to the wall attains a specified value.
 
createBuoyancy(...)
Creates a buoyancy body force within the model.
 
createCheckPointer(...)
Causes simulation to periodically save the entire model state to file for post-processing / visualisation.
 
createCheckPointerWriteThroughMaster(...)
Causes simulation to periodically save the entire model state to file in a way neccessary to restart the simulation.
 
createConnections(...)
Method for establishing bonds between particles.
 
createDamping(...)
Creates viscosity within the model.
 
createExclusion(...)
Creates an interaction exclusion.
 
createFieldSaver(...)
Causes specified data to be saved periodically to file.
 
createGravity(...)
Creates a gravitational body force within the model.
 
createInteractionGroup(...)
Creates a group of interactions with specified properties, or a model-wall which is described by an infinite plane.
 
createInteractionGroupTagged(...)
Creates a tagged interaction group between particles with the specified tags
 
createParticle(...)
Creates a discrete-element particle within the model.
 
createParticles(...)
Creates discrete-element particles within the model.
 
createRestartCheckPointer(...)
Causes simulation to periodically save the entire model state to file in a way neccessary to restart the simulation.
 
createSphereBody(...)
Creates a sphere body -- a rigid, non-inertial sphere similar to a planar wall.
 
createTriMesh(...)
Creates a 3D triangulated surface mesh within the model.
 
createWall(...)
Creates a model wall, an infinite plane specified as point-on-plane and normal-to-plane.
 
exit(...)
Exits the simulation after running a series of singlesteps of the time-integration method.
int
findClosestParticle(...)
Returns the Id of the particle closest to a specified point.
 
force2dComputations(...)
Ensures particles only move in the x-y plane and that rotations only occur about the z-axis.
 
getCurMinMaxPt(...)
Provides the current minimum and maximum extents of all the particles.
 
getInitMinMaxPt(...)
Provides the initial minimum and maximum extents of all the particles read in from a geometry file.
string
getLsmVersion(...)
Returns ESyS-Particle version string.
int
getNumParticles(...)
Returns the current number of particles in the model.
int
getNumTimeSteps(...)
Returns the maximum number of time-steps which will be executed by the run method.
int
getNumWorkerProcesses(...)
Returns: Number of spawned MPI worker processes.
list
getParticleList(...)
Returns a copy of particles with specified id's.
Vec3
getParticlePosn(...)
Returns the location of a particle with a specified Id.
string
getParticleType(...)
Returns: A string indicating the type of discrete-element particles in the model.
 
getSphereBodyForce(...)
Get force acting on named sphere body.
 
getSphereBodyPosition(...)
Get position of named sphere body.
int
getTimeStep(...)
Returns the current time-step number (number of time-steps executed so far).
float
getTimeStepSize(...)
Returns the current time-step size.
 
getWallForce(...)
Get force acting on named wall.
 
getWallPosition(...)
Get position of named wall.
 
initNeighborSearch(...)
Initialises simulation data structures.
 
initNeighbourSearch(...)
Initialises simulation data structures.
 
initVerletModel(...)
Initialises simulation data structures.
 
loadCheckPoint(...)
Load stored model state from a checkpoint file
 
moveParticleTo(...)
Sets the absolute position of a particle.
 
moveSingleMeshNodeBy(...)
Moves an individual mesh node/vertex.
 
moveSphereBodyBy(...)
Moves a sphere body by a specified displacement.
 
moveTaggedParticlesBy(...)
Translates the position of a particle by a specified displacment.
 
moveWallBy(...)
Moves a model wall by a specified displacement.
 
readGeometry(...)
Reads particle-model setup from file.
 
readMesh(...)
Creates a 3D triangulated surface mesh within the model which is loaded from file.
 
readMesh2D(...)
Creates a 2D linear surface mesh within the model which is loaded from file.
 
removeInteractionGroup(...)
Removes the interaction group with the specified name
 
run(...)
Runs multiple steps of the time-integration method.
 
runTimeStep(...)
Runs a single step of the time-integration method.
 
setConsoleBuffered(...)
Set console buffer mode and size for Master and Workers
 
setConsoleFilename(...)
Set console output file name for Master and Workers
 
setNumTimeSteps(...)
Sets the maximum number of time-steps for the run method to execute.
 
setParticleAngularVelocity(...)
Set the angular velocity of a rotational particle
 
setParticleDensity(...)
Set the density of a group of tagged particles
 
setParticleNonDynamic(...)
Make the particle non-dynamic, i.e.
 
setParticleNonRotational(...)
Set the particle with tag tag to be non-rotational, i.e.
 
setParticleNonTranslational(...)
Set the particle with tag tag to be non-translational, i.e.
 
setParticleVelocity(...)
Set the velocity of a particle
 
setSlaveTimingFileName(...)
Method to switch on the saving of timing information and set the filename prefix for the slaves.
 
setSpatialDomain(...)
Defines the rectangular particle domain for this model.
 
setTaggedParticleVelocity(...)
Set the velocity of a group of tagged particles
 
setTimeStepSize(...)
Sets the size of the time step used in the integration method.
 
setTimingFileName(...)
Method to switch on the saving of timing information and set the filename.
 
setVelocityOfWall(...)
Set the velocity of a wall with viscous drag.
 
setVerbosity(...)
Set verbosity for Master and Workers
 
setVerbosityLevel(...)
Set verbosity for Master and Workers
 
setWallNormal(...)
Sets a wall Normal to the supplied vector.
 
tagParticleNearestTo(...)
Finds the particle nearest a specified position and sets its tag to the value provided
 
translateMeshBy(...)
Rigidly translates a whole mesh
 
visitNodeRefs2d(...)
Method for visiting mesh node Id's.
 
visitParticlesWithId(...)
Method for visiting particle data.
 
visitRefStressPairs2d(...)
Method for visiting mesh (element-Id, stress) pairs.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __instance_size__ = 40
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

Sets up MPI worker processes for use in a cartesian grid decomposition of the particle domain.

Parameters:
  • numWorkerProcesses (int) - The number of MPI worker processes.
  • mpiDimList (list of 3 ints) - List of 3 elements specifying the decomposition of the simulation domain among worker processes. For example, [3,2,4] indicates a rectangular grid where the x-axis of the domain is divided into 3, the y-axis is divided in 2 and the z-axis is divided into 4. A zero value in the list indicates that dimension discretization is chosen according to the numWorkerProcesses argument, for example, (numWorkerProcesses=16, mpiDimList=[2,2,0]) implies that the z-axis of the will be divided into 4 parts (ie four two-by-two cells). Particles in each domain cell are handled by a MPI worker process.
Overrides: object.__init__

__reduce__(...)

 

helper for pickle

Overrides: object.__reduce__
(inherited documentation)

addPostTimeStepRunnable(...)

 

Like the addPreTimeStepRunnable method, except the run method of runnable gets called at the end of a time-step.

Parameters:
  • runnable (Runnable) - An object which has a run method which takes no arguments.

addPreTimeStepRunnable(...)

 

Adds a Runnable object to the list of runnables. The Runnable.run method is called before the execution of a time-step. This method can be used to introduce a loading mechanism (apply force to walls, move walls, etc).

Parameters:
  • runnable (Runnable) - An object which has a run method which takes no arguments.

addScalarTriangleSaveField(...)

 

Add a scalar triangle field saver to the simulation

Parameters:

addVectorTriangleSaveField(...)

 

Add a vector triangle field saver to the simulation

Parameters:

applyForceToWall(...)

 

A wall is displaced in the normal direction so that the total force applied to the wall attains a specified value.

Parameters:
  • interactionName (str) - Name of the interaction group governing interactions between the wall and particles.
  • force (Vec3) - Wall is displaced in the direction of the normal, so that net wall force is force.n.

createBuoyancy(...)

 

Creates a buoyancy body force within the model.

Parameters:
  • prms (BuoyancyPrms) - Parameters specifying buoyancy force.

createCheckPointer(...)

 

Causes simulation to periodically save the entire model state to file for post-processing / visualisation.

Parameters:
  • prms (CheckPointPrms) - Object describing when and where to save model state.

createCheckPointerWriteThroughMaster(...)

 

Causes simulation to periodically save the entire model state to file in a way neccessary to restart the simulation.

Parameters:
  • prms (CheckPointPrms) - Object describing when and where to save model state.

createConnections(...)

 

Method for establishing bonds between particles.

Parameters:
  • iterable (iterator) - An object supporting the iterator protocol (ie supports iter(iterable) which forms a sequence of esys.lsm.geometry.TaggedIdConnection objects, indicating an association between particles with the specified id's.

createDamping(...)

 

Creates viscosity within the model.

Parameters:
  • prms (DampingPrms) - Object describing the type of damping and the parameters associated with the damping.

Status: Deprecated, use createInteractionGroup(DampingPrms(...)).

createExclusion(...)

 

Creates an interaction exclusion. When a pair of particles come into contact, a decision is made as to the types of interactions to which the pair are subjected. An exclusion precludes a pair of particles from being subjected to the interaction interactionName2 if they are already subjected to interactionName1. This is necessary, for instance, in fracture models, where particles are initially elastically bonded, but after fracture occurs particles are subjected to a frictional type of interaction.

Parameters:
  • interactionName1 (string) - Name of an existing interaction.
  • interactionName2 (string) - Name of an existing interaction.

createFieldSaver(...)

 

Causes specified data to be saved periodically to file.

Parameters:
  • prms (FieldSaverPrms) - An object specifing where, when and what data are to be saved.

createGravity(...)

 

Creates a gravitational body force within the model.

Parameters:
  • prms (GravityPrms) - Parameters specifying gravitational acceleration.

createInteractionGroup(...)

 

Creates a group of interactions with specified properties, or a model-wall which is described by an infinite plane.

Parameters:
  • prms (esys.lsm.InteractionPrms) - An object describing the type of interaction and any parameters associated with that interaction, or parameters describing the planar wall geometry and the interactions to which particles are subjected when they encounter the wall. For non-rotational soft bonded walls, elastic coefficients are direction dependent.

createInteractionGroupTagged(...)

 

Creates a tagged interaction group between particles with the specified tags

Parameters:
  • prms (NRotFrictionPrms, NRotElasticPrms, LinearDashpotPrms, RotElasticPrms etc.) - Parameters defining type of interaction to create
  • tag1 (int) - tag of first group of particles involved in interaction
  • mask1 (int) - mask of first group of particles involved in interaction
  • tag2 (int) - tag of second group of particles involved in interaction
  • mask2 (int) - mask of second group of particles involved in interaction

    Creates an elastic interaction group between particles with the specified tag and a wall

  • prms (NRotFrictionPrms, NRotElasticPrms, LinearDashpotPrms, RotElasticPrms etc.) - Parameters defining interaction to create
  • tag (int) - tag of particles involved in interaction
  • mask (int) - mask for tags of particles involved in interaction

createParticle(...)

 

Creates a discrete-element particle within the model.

Parameters:
  • particle (object) - An object from which a particle can be constructed.

createParticles(...)

 

Creates discrete-element particles within the model.

Parameters:
  • iterable (iterator) - An object supporting the iterator protocol (ie supports iter(iterable) which forms a sequence of esys.lsm.geometry.SimpleSphere objects. A model particle is created for each element object in the sequence.

createRestartCheckPointer(...)

 

Causes simulation to periodically save the entire model state to file in a way neccessary to restart the simulation.

Parameters:
  • prms (CheckPointPrms) - Object describing when and where to save model state.

createSphereBody(...)

 

Creates a sphere body -- a rigid, non-inertial sphere similar to a planar wall.

Parameters:
  • name (str) - Name assigned to the sphere body, used to reference this sphere body in other sphere body-related methods.
  • posn (esys.lsm.util.Vec3) - The initial centre point of the sphere body.
  • radius (double) - The radius of the sphere body.

createTriMesh(...)

 

Creates a 3D triangulated surface mesh within the model.

Parameters:
  • meshName (string) - Name assigned to the created mesh.
  • nodeSequence (indexable) - Indexable sequence of node data, each element is a tuple (nodeId,coordinate,optionalNodeTag).
  • faceSequence (indexable) - Indexable sequence of triangle data, each element is a tuple (faceId,(nodeId0,nodeId1,nodeId2),optionalFaceTag).

createWall(...)

 

Creates a model wall, an infinite plane specified as point-on-plane and normal-to-plane.

Parameters:
  • name (str) - Name assigned to the wall. This name can be used toto reference this wall in other wall-related methods.
  • posn (esys.lsm.util.Vec3) - A point on the plane which describes the position of the wall.
  • normal (esys.lsm.util.Vec3) - The normal to the plane describing the orientation of the wall.

findClosestParticle(...)

 

Returns the Id of the particle closest to a specified point.

Parameters:
  • posn (Vec3) - Finds particle closest to this point.
Returns: int
Id of particle closest to posn.

getCurMinMaxPt(...)

 

Provides the current minimum and maximum extents of all the particles.

Parameters:
  • curMinPt (Vec3) - Placeholder for the current minimum extent of all the particles.
  • curMaxPt (Vec3) - Placeholder for the current maximum extent of all the particles.

getInitMinMaxPt(...)

 

Provides the initial minimum and maximum extents of all the particles read in from a geometry file.

Parameters:
  • initMinPt (Vec3) - Placeholder for the initial minimum extent of all the particles.
  • initMaxPt (Vec3) - Placeholder for the initial maximum extent of all the particles.

getLsmVersion(...)

 

Returns ESyS-Particle version string.

Returns: string
ESyS-Particle version.

getNumParticles(...)

 

Returns the current number of particles in the model.

Returns: int
Number of particles.

getNumTimeSteps(...)

 

Returns the maximum number of time-steps which will be executed by the run method.

Returns: int
Returns the maximum number of time-steps to execute.

getNumWorkerProcesses(...)

 
Returns: int
Number of spawned MPI worker processes.

getParticleList(...)

 

Returns a copy of particles with specified id's. If the idList argument is not specified (or is empty) then all particles are returned in the list.

Parameters:
  • idList (list) - Optional list of particle-id values specifying which particles are to be returned.
Returns: list
Python list containing particles with specified id. If idList is empty, then all particles are returned in the list.

getParticlePosn(...)

 

Returns the location of a particle with a specified Id.

Parameters:
  • id (int) - Particle Id.
Returns: Vec3
Position of particle.

getParticleType(...)

 
Returns: string
A string indicating the type of discrete-element particles in the model.

getSphereBodyForce(...)

 

Get force acting on named sphere body. Returns (0,0,0) for unknown bodies.

Parameters:
  • name (str) - Name of the sphere body.

getSphereBodyPosition(...)

 

Get position of named sphere body. Returns (0,0,0) for unknown bodies.

Parameters:
  • name (str) - Name of the sphere body.

getTimeStep(...)

 

Returns the current time-step number (number of time-steps executed so far).

Returns: int
Number of time-steps executed.

getTimeStepSize(...)

 

Returns the current time-step size.

Returns: float
time step size for the current time-step.

getWallForce(...)

 

Get force acting on named wall. Returns (0,0,0) for unknown walls.

Parameters:
  • name (str) - Name of the wall.

getWallPosition(...)

 

Get position of named wall. Returns (0,0,0) for unknown walls.

Parameters:
  • name (str) - Name of the wall.

initNeighborSearch(...)

 

Initialises simulation data structures.

Parameters:
  • particleType (string) - Specifies the type discrete-element particles.
  • gridSpacing (float) - The size of the grid-spacing used by the contact detection algorithm. For spherical particles, gridSpacing must be greater than double the maximum particle radius.
  • verletDist (float) - When the magnitude of a particle-displacement exceeds this amount, the neighbour lists (used in the contact detection) are updated.

initNeighbourSearch(...)

 

Initialises simulation data structures.

Parameters:
  • particleType (string) - Specifies the type discrete-element particles.
  • gridSpacing (float) - The size of the grid-spacing used by the contact detection algorithm. For spherical particles, gridSpacing must be greater than double the maximum particle radius.
  • verletDist (float) - When the magnitude of a particle-displacement exceeds this amount, the neighbour lists (used in the contact detection) are updated.

initVerletModel(...)

 

Initialises simulation data structures.

Parameters:
  • particleType (string) - Specifies the type discrete-element particles.
  • gridSpacing (float) - The size of the grid-spacing used by the contact detection algorithm. For spherical particles, gridSpacing must be greater than double the maximum particle radius.
  • verletDist (float) - When the magnitude of a particle-displacement exceeds this amount, the neighbour lists (used in the contact detection) are updated.

loadCheckPoint(...)

 

Load stored model state from a checkpoint file

Parameters:
  • prms (string) - name of the checkpoint file.

moveParticleTo(...)

 

Sets the absolute position of a particle.

Parameters:
  • id (int) - Id of the particle to be moved.
  • posn (Vec3) - New position of particle.

moveSingleMeshNodeBy(...)

 

Moves an individual mesh node/vertex.

Parameters:
  • meshName (string) - Name which identifies an existing mesh.
  • nodeId (int) - The identifier of the node which is to be moved.
  • delta (Vec3) - The node is moved by this amount.

moveSphereBodyBy(...)

 

Moves a sphere body by a specified displacement.

Parameters:
  • sphereName (str) - Name of the sphere body which is to be moved.
  • d (Vec3) - The displacement vector by which the sphere body is displaced.

moveTaggedParticlesBy(...)

 

Translates the position of a particle by a specified displacment.

Parameters:
  • tag (int) - Tag of all particles which are to be moved.
  • displacement (Vec3) - Amount by which particle positions are translated.

moveWallBy(...)

 

Moves a model wall by a specified displacement.

Parameters:
  • wallName (str) - Name of the wall which is to be moved.
  • d (Vec3) - The displacement vector by which the wall is displaced.

readGeometry(...)

 

Reads particle-model setup from file.

Parameters:
  • fileName (string) - A file containing domain, particle and connection data.

readMesh(...)

 

Creates a 3D triangulated surface mesh within the model which is loaded from file.

Parameters:
  • fileName (string) - Name of file from which surface-mesh is read.
  • meshName (string) - Name assigned to the created mesh.
  • tag (int) - Only elements with tag tag are created in the model (optional).

readMesh2D(...)

 

Creates a 2D linear surface mesh within the model which is loaded from file.

Parameters:
  • fileName (string) - Name of file from which surface-mesh is read.
  • meshName (string) - Name assigned to the created mesh.
  • tag (int) - Only elements with tag tag are created in the model.

removeInteractionGroup(...)

 

Removes the interaction group with the specified name

Parameters:
  • name (string) - name of interaction group to remove

setConsoleBuffered(...)

 

Set console buffer mode and size for Master and Workers

Parameters:
  • bsize (int) - set the size of the console buffer A larger buffer may improve performance but risks losing output in case of program termination

setConsoleFilename(...)

 

Set console output file name for Master and Workers

Parameters:
  • filename (string) - set basic file name of the console output The full filename for each process will be filename.rank

setNumTimeSteps(...)

 

Sets the maximum number of time-steps for the run method to execute.

Parameters:
  • numTimeSteps (int) - The number of time-steps to execute in the run method.

setParticleAngularVelocity(...)

 

Set the angular velocity of a rotational particle

Parameters:
  • id (int) - the ID of the particle
  • angularVelocity (Vec3) - The angular velocity of the particle.

setParticleDensity(...)

 

Set the density of a group of tagged particles

Parameters:
  • tag (int) - the tag of the particles
  • mask (int) - the tag mask
  • Density (float) - The density of the particle.

setParticleNonDynamic(...)

 

Make the particle non-dynamic, i.e. the particle still interacts with other particles the usual way but doesn't move in response to forces applied to it. Useful if the particle is moved in order to create a deformation source.

Parameters:
  • tag (int) - the tag of the particle.

setParticleNonRotational(...)

 

Set the particle with tag tag to be non-rotational, i.e. it still participates in rotational (RotFriction, RotBonded, etc) interactions but doesn't rotate in response to applied torque. Only applicable if the particle type is rotational.

Parameters:
  • tag (int) - the tag of the particle.

setParticleNonTranslational(...)

 

Set the particle with tag tag to be non-translational, i.e. it still has rotational degrees of freedom but doesn't translate in response to forces. Only applicable if the particle type is rotational.

Parameters:
  • tag (int) - the tag of the particle.

setParticleVelocity(...)

 

Set the velocity of a particle

Parameters:
  • id (int) - the ID of the particle
  • Velocity (Vec3) - The velocity of the particle.

setSlaveTimingFileName(...)

 

Method to switch on the saving of timing information and set the filename prefix for the slaves.

Parameters:
  • fileName (string) - the prefix of the file name to which the timing data is saved

setSpatialDomain(...)

 

Defines the rectangular particle domain for this model.

Parameters:
  • bBox (BoundingBox) - Defines rectangular domain.
  • circDimList (list of 3 bool) - List of 3 boolean elements indicating in which dimension the circular boundary occurs. For example, [True,False,False] indicates a circular boundary at the x=bBox.getMinPt()[0] and x=bBox.getMaxPt()[0] planes of the rectangular domain specified by bBox.

setTaggedParticleVelocity(...)

 

Set the velocity of a group of tagged particles

Parameters:
  • tag (int) - the tag of the particles
  • Velocity (Vec3) - The velocity of the particle.

setTimeStepSize(...)

 

Sets the size of the time step used in the integration method.

Parameters:
  • dt (float) - time step size used in explicit time-stepping scheme.

setTimingFileName(...)

 

Method to switch on the saving of timing information and set the filename.

Parameters:
  • fileName (string) - the name of the file to which the timing data is saved

setVelocityOfWall(...)

 

Set the velocity of a wall with viscous drag. This does not influence the position of the wall, only the viscous drag applied to particles interacting with the wall. Therefore it is meaningless for walls without viscous drag.

Parameters:
  • name (str) - the name of the wall
  • velocity (Vec3) - The velocity of the wall.

setVerbosity(...)

 

Set verbosity for Master and Workers

Parameters:
  • verbose (bool) - set the amount of debug info written to file false->nothing, true->all For a more fine grained control use setVerbosityLevelPy which takes an int argument (0-7)

setVerbosityLevel(...)

 

Set verbosity for Master and Workers

Parameters:
  • verbose (int) - set the amount of debug info written to file 0->nothing, 7->all

setWallNormal(...)

 

Sets a wall Normal to the supplied vector.

Parameters:
  • wallName (str) - Name of the wall whose normal is to be changed.
  • d (Vec3) - The new normal vector of the wall.

tagParticleNearestTo(...)

 

Finds the particle nearest a specified position and sets its tag to the value provided

Parameters:
  • tag (int) - the tag to assign to the particle
  • mask (int) - the tag mask to apply when tagging the particle
  • Position (vec3) - the position nearest the particle to tag

translateMeshBy(...)

 

Rigidly translates a whole mesh

Parameters:
  • meshName (string) - Name which identifies an existing mesh.
  • translation (Vec3) - The mesh is translated by this vector.

visitNodeRefs2d(...)

 

Method for visiting mesh node Id's.

Parameters:
  • meshName (string) - name of the mesh whose nodes will be visited.
  • nodeRefVisitor (object) - object which has a method named visitNodeRef which takes a single integer argument.

visitParticlesWithId(...)

 

Method for visiting particle data.

Parameters:
  • idList (list) - List of particle-id values specifying which particles are to be visited.
  • particleVisitor (object) - object which has a method named visitParticle which accepts a single particle argument.

visitRefStressPairs2d(...)

 

Method for visiting mesh (element-Id, stress) pairs.

Parameters:
  • meshName (string) - name of the mesh whose elements will be visited.
  • refStressVisitor (object) - object which has a method named visitRefStressPair which two arguments, an integer element-id argument and a Vec3 stress argument.