Integrators¶
Integrators are used to advance particle coordinates and velocities in time according to forces acting on them.
Summary¶
Integrator () |
Base integration class |
Minimize () |
Energy minimization integrator. |
Oscillate () |
Move particles with the periodically changing velocity \(\mathbf{u}(t) = \cos(2 \pi \, t / T) \mathbf{u}_0\) |
RigidVelocityVerlet () |
Integrate the position and rotation (in terms of quaternions) of the rigid bodies as per Velocity-Verlet scheme. |
Rotate () |
Rotate particles around the specified point in space with a constant angular velocity \(\mathbf{\Omega}\) |
SubStep () |
Takes advantage of separation of time scales between “fast” internal forces and other “slow” forces on an object vector. |
SubStepShardlowSweep () |
Takes advantage of separation of time scales between “fast” internal forces and other “slow” forces on a membrane vector. |
Translate () |
Translate particles with a constant velocity \(\mathbf{u}\) regardless forces acting on them. |
VelocityVerlet () |
Classical Velocity-Verlet integrator with fused steps for coordinates and velocities. |
VelocityVerlet_withConstForce () |
Same as regular VelocityVerlet , but the forces on all the particles are modified with the constant pressure term: |
VelocityVerlet_withPeriodicForce () |
Same as regular Velocity-Verlet, but the forces on all the particles are modified with periodic Poiseuille term. |
Details¶
-
class
Integrator
¶ Bases:
object
Base integration class
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
Minimize
¶ Bases:
mmirheo.Integrators.Integrator
Energy minimization integrator. Updates particle positions according to a gradient-descent policy with respect to the energy potential (force). Does not read or modify particle velocities.
\[\begin{split}\mathbf{a}^{n} &= \frac{1}{m} \mathbf{F}(\mathbf{x}^{n}, \mathbf{v}^{n-1/2}) \\ \mathbf{x}^{n+1} &= \mathbf{x}^{n} + \frac{\Delta t^2}{m} \mathbf{a}^n\end{split}\]-
__init__
(name: str, max_displacement: float) → None¶ Parameters: - name – name of the integrator
- max_displacement – maximum displacement per time step
-
-
class
Oscillate
¶ Bases:
mmirheo.Integrators.Integrator
Move particles with the periodically changing velocity \(\mathbf{u}(t) = \cos(2 \pi \, t / T) \mathbf{u}_0\)
-
__init__
(name: str, velocity: real3, period: float) → None¶ Parameters: - name – name of the integrator
- velocity – \(\mathbf{u}_0\)
- period – oscillation period \(T\)
-
-
class
RigidVelocityVerlet
¶ Bases:
mmirheo.Integrators.Integrator
Integrate the position and rotation (in terms of quaternions) of the rigid bodies as per Velocity-Verlet scheme. Can only applied to
RigidObjectVector
orRigidEllipsoidVector
.-
__init__
(name: str) → None¶ Parameters: name – name of the integrator
-
-
class
Rotate
¶ Bases:
mmirheo.Integrators.Integrator
Rotate particles around the specified point in space with a constant angular velocity \(\mathbf{\Omega}\)
-
__init__
(name: str, center: real3, omega: real3) → None¶ Parameters: - name – name of the integrator
- center – point around which to rotate
- omega – angular velocity \(\mathbf{\Omega}\)
-
-
class
SubStep
¶ Bases:
mmirheo.Integrators.Integrator
Takes advantage of separation of time scales between “fast” internal forces and other “slow” forces on an object vector. This integrator advances the object vector with constant slow forces for ‘substeps’ sub time steps. The fast forces are updated after each sub step. Positions and velocity are updated using an internal velocity verlet integrator.
-
__init__
(name: str, substeps: int, fastForces: List[Interactions.Interaction]) → None¶ Parameters: - name – name of the integrator
- substeps – number of sub steps
- fastForces – a list of fast interactions. Only accepts
MembraneForces
orRodForces
Warning
The interaction will be set to the required object vector when setting this integrator to the object vector. Hence the interaction needs not to be set explicitely to the OV.
-
-
class
SubStepShardlowSweep
¶ Bases:
mmirheo.Integrators.Integrator
Takes advantage of separation of time scales between “fast” internal forces and other “slow” forces on a membrane vector. This integrator advances the object vector with constant slow forces for ‘substeps’ sub time steps. The fast forces are updated after each sub step using the Shardlow method for viscous forces with multiple seeps.
-
__init__
(name: str, substeps: int, fastForces: Interactions.MembraneForces, gammaC: float, kBT: float, nsweeps: int) → None¶ Parameters: - name – Name of the integrator.
- substeps – Number of sub steps.
- fastForces – Membrane interactions. Only accepts
MembraneForces
. Must have zero gammaC and zero kBT. - gammaC – Membrane viscous coefficient.
- kBT – temperature, in energy units. Set to zero to disable membrane fluctuations.
- nsweeps – Number of sweeps for the semi implicit step. Must be strictly more than 0.
Warning
The interaction will be set to the required object vector when setting this integrator to the object vector. Hence the interaction needs not to be set explicitely to the OV.
-
-
class
Translate
¶ Bases:
mmirheo.Integrators.Integrator
Translate particles with a constant velocity \(\mathbf{u}\) regardless forces acting on them.
-
__init__
(name: str, velocity: real3) → None¶ Parameters: - name – name of the integrator
- velocity – translational velocity \(\mathbf{\Omega}\)
-
-
class
VelocityVerlet
¶ Bases:
mmirheo.Integrators.Integrator
Classical Velocity-Verlet integrator with fused steps for coordinates and velocities. The velocities are shifted with respect to the coordinates by one half of the time-step
\[\begin{split}\mathbf{a}^{n} &= \frac{1}{m} \mathbf{F}(\mathbf{x}^{n}, \mathbf{v}^{n-1/2}) \\ \mathbf{v}^{n+1/2} &= \mathbf{v}^{n-1/2} + \mathbf{a}^n \Delta t \\ \mathbf{x}^{n+1} &= \mathbf{x}^{n} + \mathbf{v}^{n+1/2} \Delta t\end{split}\]where bold symbol means a vector, \(m\) is a particle mass, and superscripts denote the time: \(\mathbf{x}^{k} = \mathbf{x}(k \, \Delta t)\)
-
__init__
(name: str) → None¶ Parameters: name – name of the integrator
-
-
class
VelocityVerlet_withConstForce
¶ Bases:
mmirheo.Integrators.Integrator
Same as regular
VelocityVerlet
, but the forces on all the particles are modified with the constant pressure term:\[\begin{split}\mathbf{a}^{n} &= \frac{1}{m} \left( \mathbf{F}(\mathbf{x}^{n}, \mathbf{v}^{n-1/2}) + \mathbf{F}_{extra} \right) \\\end{split}\]-
__init__
(name: str, force: real3) → None¶ Parameters: - name – name of the integrator
- force – \(\mathbf{F}_{extra}\)
-
-
class
VelocityVerlet_withPeriodicForce
¶ Bases:
mmirheo.Integrators.Integrator
Same as regular Velocity-Verlet, but the forces on all the particles are modified with periodic Poiseuille term. This means that all the particles in half domain along certain axis (Ox, Oy or Oz) are pushed with force \(F_{Poiseuille}\) parallel to Oy, Oz or Ox correspondingly, and the particles in another half of the domain are pushed in the same direction with force \(-F_{Poiseuille}\)
-
__init__
(name: str, force: float, direction: str) → None¶ Parameters: - name – name of the integrator
- force – force magnitude, \(F_{Poiseuille}\)
- direction – Valid values: “x”, “y”, “z”. Defines the direction of the pushing force if direction is “x”, the sign changes along “y”. if direction is “y”, the sign changes along “z”. if direction is “z”, the sign changes along “x”.
-