mpacts.particles. sphere

In order to be able to use this module import it like this:

import mpacts.particles
#or assign it to a shorter name
import mpacts.particles as prt

Sphere Layout

Particle of type Sphere:

  • x (Point)
  • v (Vector)
  • F (Vector)
  • w (Vector)
  • q (Quaternion)
  • M (Vector)
  • m (Scalar)
  • I (Scalar)
  • r (Scalar)
  • GeometryTag = GeometryTag_Sphere

Sphere Example creation

Creating a particle container consisting of ‘Spheres’ can be done like this:

import mpacts.particles as prt
from mpacts.particles.Sphere import Sphere

Spherepc = prt.ParticleContainer("Spherepc", Sphere, mysim) #mysim is optional
particle = Spherepc.add_particle()

particle.x = (1.0, 0.0, 1.0)
#or
mypc[0].x = (1.0, 0.0, 1.0)

#or to make a lot of particles
positions = [ (1.0, 0.0, 0.0), (1.0, 1.0, 1.0), (0.0, 1.0, 1.0) ]
Spherepc.add_and_set_particles( x = positions ) #any number of other arrays may be set at the same time (r, v, ...)
                                            #and they can either have the same length as positions or length 1

Supported Commands

On the particle container following list of commands can be invoked.

Note

the pc keyword argument is passed automatically, as well as the parent if the pc is created with a parent.

mypc.AABBGeneratorCmd()
Command that generates a list of bounding boxes for known geometries.
Default location: ‘loop_cmds/pre_contact_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • margin (default value = 0) — Adds an additional (fixed size) margin to the bounding box. Useful to give planes a third dimension, or to provide margin, so the contacts don’t need to be detected every timestep
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.AppliedForceCmd()
Applied user-specified force on a given particle or - if not given - on every particle in an ArrayManager
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • force (kg . m . s^-2) — Applied force vector
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • index (default value = -1) — Index of particle to which the force should be applied. If not given, force will be applied to all particles (possibly selected by the predicate)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.BrownianForceCmd()
Force generating Brownian motion due to the particles being suspended in a liquid. DEPRECATED - check ThermalForceCommand!
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
    • temperature — Temperature of the medium in which the particles are submerged.
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • viscosity (kg . m^-1 . s^-1) (default value = -1) — viscosity of the medium in which the particles are submerged. Will be calculated from the temperature if not given.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.BuoyancyForceCmd()
Command to compute the ‘upward’ Archimedes force for a triangulated shape that is - partially - submerged in a liquid with given density.The water-air interface is represented by a given position and surface normal vector. Arrays for submerged volume and submerged center of mass must be present (NOTE: this is the modular replacement for ‘ArchimedesForceTriangleCommand’)
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • g — Gravitational acceleration
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • density_fluid (default value = 999.97199999999998) — Density of the fluid in which the rigid body is to be immersed. If not specified, we use water at standard conditions.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.CSVWriterCmd()
Writer for CSV files for an arraymanager. The writer acts on the data member given in the constructor, which has to be an arraymanager. By default all arrays are written out, except those who have a disable_CSV_write child.
Default location: ‘loop_cmds/output_cmds’
  • Required keywords:
    • data — The manager of which the data will be written (CSV writer is not recursive!)
    • filename — The base filename of the files that will be written. A number will be appended to differentiate between different timesteps.
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • write_header (default value = 1) — Decides if a header is added or not.
    • write_index (default value = 0) — The current sequential number of the output file.
    • write_time (default value = 0) — Decides if a comment is added on the first line with the current time on it. (Paraview does not like this!).
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.CentralGravityCmd()
A force is exerted on all particles in a given particle container with magnitude F = GMm/r**2 where m is the mass of the particle in the container, and GM is an input parameter representing the gravitational constant, multiplied with the mass of the ‘large’ central pulling body
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • GM (m^3 . s^-2) — The multiplicaton of the gravitational constant G and the mass of the central mass M
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • center (m) (default value = 0 0 0) — The location of the central mass
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.CentralPullCmd()
CentralPullCommand where a force is exerted on all particles in a given particle container equal to Force in the direction of the center point given.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • force (kg . m . s^-2) — The (constant) force that pulls the particles to the center point.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • center (m) (default value = 0 0 0) — The center location towards particles are pulled
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.CentrifugationalForceCmd()
Centrifugation Force command. Computes the centrifugational force in the body frame of the centrifuge, that rotates with a given angular velocity, and which is located by an axis and a location.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • Omega (s^-1) — Angular velocity of centrifuge
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • Axis (1) (default value = 0 0 1) — Axis of rotation
    • Position_axis (m) (default value = 0 0 0) — Position of centrifuge
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.ComputeKineticEnergyCmd()
Command which computes the rotational and translational kinetic energy of a body. If no rotational arrays are present only translational energy is calculated. Requires an ‘E’ array to be present.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • energy_array (default value = None) — Array to store the energy, if not given a default array ‘E’ will be assumed which must be present
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.DecayCmd()
Particles in ‘pc’ are randomly killed at a specified rate ‘k’
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • k (s^-1) — Decay rate of the particles (In fraction killed / second )
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.DiffusionCmd()
Particles in ‘pc’ move according to given Diffusivity in the medium ‘D_medium’. DEPRECATED - check ThermalForceCommand!
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • D_medium (m^2 . s^-1) — Diffusivity of the medium
    • pc — Particle container on which the command is applied
    • temperature (K) — Temperature
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.DirectedForceCmd()
Force with fixed magnitude in a direction given by the user-given array ‘direction’
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • direction — Array with a direction vector
    • magnitude (kg . m . s^-2) — Magnitude of the applied force
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • normalize (default value = 0) — If ‘True’, the direction vector will first be normalized
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • use_contact_area (default value = 0) — If ‘True’, the contact area array will be used to weight the obtained directed force
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.DragForceCmd()
Drag force command: drag force is proportional to the velocity squared and in the opposite direction of the velocity. For example to be used for approximated air drag forces
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • c (kg . m^-1) — Drag coefficient c of the particle. Drag force: F = -c v^2
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.Fixed1DSpringsCmd()
For each particle, a spring is constructed in a given ‘dimension’ with reference position at given array ‘x0’ and a linear force with stiffness ‘k’
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • dimension (1) — dimension in which the fixed springs act
    • k (kg . s^-2) — spring stiffness
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • x0 (default value = None) — Array with initial positions. Will be set to x at initialization if not given (make sure that x is completely set and never changes when adding this command without setting x0 explicitely!).
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.FixedSpringsCmd()
For each particle, a spring is constructed with with reference position at given array ‘x0’ and a linear force with stiffness ‘k’
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • k (kg . s^-2) — spring stiffness
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • x0 (default value = None) — Array with initial positions. Will be set to x at initialization if not given (make sure that x is completely set and never changes when adding this command without setting x0 explicitely!).
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.GravityCmd()
Gravitation command. Computes a force F=m*g, with ‘m’ a mass array and ‘g’ the gravitational acceleration vector. Note that this command implicitly assumes that the center of gravity is (0,0,0) in body frame coordinates, and therefore does not apply a gravitational moment.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • g (m . s^-2) (default value = 0 -9.81 0) — The gravitational vector
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.LinearDampingForceCmd()
Linear damping force command: damping force is proportional to and in the opposite direction of the velocity ‘v’.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • c (kg . s^-1) — Linear damping coefficient. Damping force: F = -c v
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.PCStatisticsCmd()
PCStatistics command
Default location: ‘loop_cmds/pre_contact_cmds/Periodic_BC_CopyToGhost_PeriodicBoundary1D’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.RandomForceCmd()
Force in a fully random direction drawn from uniform distribution over unit sphere surface with a magnitude following a normal distribution with given standard deviation sigma. Note: It is not equivalent to the Brownian motion.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
    • sigma — Standard deviation of the Random force magnitude; if sigma<0, we keep a unit-vector.
  • Optional keywords:
    • array_name (default value = F) — Name of the array to operate on (default: ‘F’). Note: this option is kept for legacy reasons. Please use pass property ‘force_array’ instead
    • direction (1) (default value = 0 0 0) — If given, this axis (plus and minus) will be used for the random force, with only its magnitude randomized.
    • force_array (default value = None) — Array to which the force should be added. If not given, array with name ‘array_name’ will be used.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • restrict_to_plane (1) (default value = 0 0 0) — If a plane normal is given, the command will project its direction in the plane.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.SetContactMatrixDiagonalCmd()
Sets an array with a single value. Used for instance to zero forces and moments every timestep. Properties are ‘value’, and an ‘array’ that needs to be set.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • array — The array that will be set using the given value.
    • value — The value that will be used to set the array.
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decided whether or not the command is executed for a specific particle index (if omitted, the command is executed for all particle indices)
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.SetMeanToOriginCmd()
Centers the positions of particles in a particle container to a user specified ‘center’.
Default location: ‘loop_cmds/integration_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • center (default value = 0 0 0) — Position at which the x array should be centered
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • omit_axis (default value = -1) — This axis will not be used to center the positions
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • x_centered (default value = None) — Array where the centered positions will be stored. If not provided, the same array as the property ‘x’ will be used
    • x (default value = None) — Array with positions
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.StokesDragForceCmd()
Command to compute, given an already computed ‘ContactMatrixDiagonal’ with friction constants (see e.g. ‘LiquidFrictionCommand’), a linear Stokes drag force. velocity can either be the particle’s own velocity (sign should be ‘-1’) or an external ‘driving’ velocity field that is interpolated to the position of the particle (‘sign’ should be 1).
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gamma (default value = None) — Array containing the friction matrices. If not provided first tries to find ‘ContactMatrixDiagonal’ then tries to find ‘gamma’ array.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • sign (1) (default value = -1) — Sign of the force (-1 or 1) in F=sign*gamma*v. If v is the particle’s own velocity, use -1 (default). If v is an external field, you typically want to use 1. Only 1 and -1 are accepted as valid arguments.
    • v (default value = None) — Array containing the velocity, which is either the particle’s own velocity, or the local interpolation of some external field. If not given, pc[‘v’] will be searched.
    • vorticity (default value = None) — Array with local fluid ‘vorticity’ (vector with angular velocities). If given, a correction force will be added based on the timestep to prevent ‘overshooting’ a flow-line due to discrete time-stepping. Only applicable in case an explicit and non-trivial fluid-field is provided, e.g. from a CFD-computation.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.StokesDragForceFluidFeedbackCmd()
Command to compute the feedback force that should be exerted on the fluid for particles moving inside of it, i.e, F = gamma * (v_particle - v_fluid). Note that this is NOT a true body force since the own ‘F’ array will not be touched by this command.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • F_fluid (default value = None) — Array containing forces that should be exerted on the fluid
    • gamma (default value = None) — Array containing the friction matrices. If not provided first tries to find ‘ContactMatrixDiagonal’ then tries to find ‘gamma’ array.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • v_fluid (default value = None) — Array containing fluid velocity
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.SurfaceElementDragForceCmd()
Drag force command: drag force is proportional to the velocity squared, in the opposite direction of the velocity and proportional to the (polygon’s) area.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • c (1) — Dimensionless drag coefficient. Dependent on general geometry and Reynolds number.
    • density (kg . m^-3) — Density of the fluid
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • area (default value = None) — Array with area values for the polygons. If not given, the array ‘area’ will be looked up
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • v0_array (default value = None) — If given, specifies the velocity of the ‘medium’ for each triangle in which the particles experience the drag force. If given, this array takes precedence over the v0 value.
    • v0 (default value = 0 0 0) — If given, specifies the velocity of the ‘medium’ in which the particles experience the drag force.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.ThermalForceCmd()
Force generating Brownian motion due to the particles being suspended in a medium.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • D_sqrt (default value = None) — Array that contains the square root of diffusion matrix divided by the mobility matrix ( chi^{-1} . sqrt(D) ). By default the array ‘D_sqrt’ is used.
    • F (default value = None) — Array where the thermal force will be contributed. By default ‘F’ is used.
    • div_D_F (default value = None) — Array that contains the force associated with divergence of the diffusion matrix ( F = chi^{-1} . div D, where chi is mobility). By default the array ‘div_D_F’ is used.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.TimeIntegration_ForwardEuler_Generic_Cmd()
Time integration for any arrays ‘x’ and ‘dx’ belonging to the same manager, vector or scalar.
Default location: ‘loop_cmds/integration_cmds’
  • Required keywords:
    • dx — The value ‘dx’ that gets integrated as x += dx*dt
    • pc — Particle container on which the command is applied
    • x — The value ‘x’ that needs to be integrated as x += dx*dt
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • timestep (default value = 0) — timestep used by this time integration command
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.TimeIntegration_ForwardEuler_Translation_Cmd()
Time integration
Default location: ‘loop_cmds/integration_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • timestep (default value = 0) — timestep used by this time integration command
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.TimeIntegration_ForwardEuler_UncoupledOverdampedMatrix_Cmd()
Time integration which sets the velocity based on a prescribed mobility matrix and uses Forward Euler integration to increment the positions
Default location: ‘loop_cmds/integration_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • chi (default value = None) — Array with mobility matrices. By default the array ‘chi’ is taken.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • timestep (default value = 0) — timestep used by this time integration command
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.TimeIntegration_ForwardEuler_UncoupledOverdamped_Cmd()
Time integration which sets the velocity based on a prescribed damping coefficient and uses Forward Euler integration to increment the positions
Default location: ‘loop_cmds/integration_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gamma_array (default value = None) — Array with damping symmetric matrices. If given, parameter ‘gamma’ will be ignored
    • gamma (default value = -1) — Scalar damping coefficient
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • set_v_array (default value = 1) — If ‘false’, the positions will be directly set without updating a velocity array
    • timestep (default value = 0) — timestep used by this time integration command
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.TimeIntegration_LeapFrog_Rotation_Cmd()
Time integration
Default location: ‘loop_cmds/integration_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • timestep (default value = 0) — timestep used by this time integration command
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.TimeIntegration_LeapFrog_Translation_Cmd()
Time integration
Default location: ‘loop_cmds/integration_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • timestep (default value = 0) — timestep used by this time integration command
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.
mypc.VTKWriterCmd()
Writer of VTK (.vtp/vtu) files. The writer acts on the data member given in the constructor. By default all child array managers are written, but without their additional data arrays (such as for instance ‘r’, ‘v’, ...) this can be changed by invoking the ‘select_all’ member function.
Also individual arrays can be selected by adding a ‘enable_VTK_write’ child (‘ r.add_child( BaseObject(‘enable_VTK_write’)’), or they can be unselected by adding a ‘disable_VTK_write’ child.
Conforming to what ParaView expects, symmetric tensors are written as diagonal values, then upper triangle:
0 3 4
x 1 5
x x 2.
If you write a full matrix, however, the order is as in our c++ code, i.e.:
0 1 2
3 4 5
6 7 8.
Has no default location.
  • Required keywords:
    • data — The root of which the data will be written
    • filename — The base filename of the files that will be written. A number will be appended to differentiate between different timesteps.
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • select_all (default value = 0) — Determines whether the writer tries to write as much as possible or not (by default false). Note: for legacy reasons there is also a named function for this.
    • start_index (default value = 0) — Index of the next file that will be written. The index of each subsequent file will be incremented by one. Default is zero.
  • additional parameters (to quickly choose a gate to be applied):
    • executeOnce: If True, will set the ExecuteOnce gate
    • executeEvery: If given, will execute every “executeEvery” time-steps.
    • executeInterval: If given, will execute every interval seconds (approximate simulation time)
    • executeTimes: If given, will execute at times specified in the list provided (approximated to the nearest discrete time step!)
    • executeEveryPCSizeChange If given, will execute every time a specified particle container changes size.
  • parent: Can be set to ‘False’ or ‘0’ to explicitely prevent the command to be added to the (simulation) commandlist.