Plugins

Plugins are used to add specific data processing or to modify the regular pipeline in certain way. However, the functionality they provide is not considered essential.

If the simulation is started without postprocess part (see Overview), most of the plugins are disabled.

Summary

Classes

AddForce This plugin will add constant force \(\mathbf{F}_{extra}\) to each particle of a specific PV every time-step.
AddTorque This plugin will add constant torque \(\mathbf{T}_{extra}\) to each object of a specific OV every time-step.
AnchorParticles This plugin will set a given particle at a given position and velocity.
AnchorParticlesStats Postprocessing side of AnchorParticles responsible to dump the data.
Average3D This plugin will project certain quantities of the particle vectors on the grid (by simple binning), perform time-averaging of the grid and dump it in XDMF (LINK) format with HDF5 (LINK) backend.
AverageRelative3D This plugin acts just like the regular flow dumper, with one difference.
DensityControlPlugin This plugin applies forces to a set of particle vectors in order to get a constant density.
DensityOutletPlugin This plugin removes particles from a set of ParticleVector in a given region if the number density is larger than a given target.
ExchangePVSFluxPlane This plugin exchanges particles from a particle vector crossing a given plane to another particle vector.
ForceSaver This plugin creates an extra channel per particle inside the given particle vector named ‘forces’.
ImposeProfile This plugin will set the velocity of each particle inside a given domain to a target velocity with an additive term drawn from Maxwell distribution of the given temperature.
ImposeVelocity This plugin will add velocity to all the particles of the target PV in the specified area (rectangle) such that the average velocity equals to desired.
MagneticOrientation This plugin gives a magnetic moment \(\mathbf{M}\) to every rigid objects in a given RigidObjectVector.
MembraneExtraForce This plugin adds a given external force to a given membrane.
MeshDumper Postprocess side plugin of MeshPlugin.
MeshPlugin This plugin will write the meshes of all the object of the specified Object Vector in a PLY format (LINK).
ObjStats This plugin will write the coordinates of the centers of mass of the objects of the specified Object Vector.
ObjStatsDumper Postprocess side plugin of ObjStats.
ObjectPortalDestination This plugin receives object vector content from another Mirheo instance.
ObjectPortalSource This plugin sends object vector content to another Mirheo instance.
ObjectToParticlesPlugin This plugin transforms objects to particles when they cross a given plane.
ParticleChannelSaver This plugin creates an extra channel per particle inside the given particle vector with a given name.
ParticleChecker This plugin will check the positions and velocities of all particles in the simulation every given time steps.
ParticleDisplacementPlugin This plugin computes and save the displacement of the particles within a given particle vector.
ParticleDrag This plugin will add drag force \(\mathbf{f} = - C_d \mathbf{u}\) to each particle of a specific PV every time-step.
ParticleDumperPlugin Postprocess side plugin of ParticleSenderPlugin.
ParticlePortalDestination This plugin receives particle vector content from another Mirheo instance.
ParticlePortalSource This plugin sends particle vector content to another Mirheo instance.
ParticleSenderPlugin This plugin will dump positions, velocities and optional attached data of all the particles of the specified Particle Vector.
ParticleSenderWithRodDataPlugin Extension of ParticleSenderPlugin to support bisegment data.
ParticleWithMeshDumperPlugin Postprocess side plugin of ParticleWithMeshSenderPlugin.
ParticleWithMeshSenderPlugin This plugin will dump positions, velocities and optional attached data of all the particles of the specified Object Vector, as well as connectivity information.
PinObject This plugin will impose given velocity as the center of mass velocity (by axis) of all the objects of the specified Object Vector.
PinRodExtremity This plugin adds a force on a given segment of all the rods in a RodVector.
PlaneOutletPlugin This plugin removes all particles from a set of ParticleVector that are on the non-negative side of a given plane.
PostprocessDensityControl Dumps info from DensityControlPlugin.
PostprocessPlugin Base postprocess plugin class
PostprocessRadialVelocityControl Postprocess side plugin of RadialVelocityControl.
PostprocessStats Postprocess side plugin of SimulationStats.
PostprocessVelocityControl Postprocess side plugin of VelocityControl.
RadialVelocityControl This plugin applies a radial force (decreasing as \(r^3\)) to all the particles of the target PVS.
RateOutletPlugin This plugin removes particles from a set of ParticleVector in a given region at a given mass rate.
ReportPinObject Postprocess side plugin of PinObject.
SimulationPlugin Base simulation plugin class
SimulationStats This plugin will report aggregate quantities of all the particles in the simulation: total number of particles in the simulation, average temperature and momentum, maximum velocity magnutide of a particle and also the mean real time per step in milliseconds.
Temperaturize This plugin changes the velocity of each particles from a given ParticleVector.
UniformCartesianDumper Postprocess side plugin of Average3D or AverageRelative3D.
VelocityControl This plugin applies a uniform force to all the particles of the target PVS in the specified area (rectangle).
VelocityInlet This plugin inserts particles in a given ParticleVector.
VirialPressure This plugin compute the virial pressure from a given ParticleVector.
VirialPressureDumper Postprocess side plugin of VirialPressure.
WallForceCollector This plugin collects and average the total force exerted on a given wall.
WallForceDumper Postprocess side plugin of WallForceCollector.
WallRepulsion This plugin will add force on all the particles that are nearby a specified wall.
XYZDumper Postprocess side plugin of XYZPlugin.
XYZPlugin This plugin will dump positions of all the particles of the specified Particle Vector in the XYZ format.

Creation functions

createAddForce(state, name, pv, force) Create AddForce plugin
createAddTorque(state, name, ov, torque) Create AddTorque plugin
createAnchorParticles(state, name, pv, …) Create AnchorParticles plugin
createDensityControl(state, name, file_name, …) Create DensityControlPlugin
createDensityOutlet(state, name, pvs, …) Create DensityOutletPlugin
createDumpAverage(state, name, pvs, …) Create Average3D plugin
createDumpAverageRelative(state, name, pvs, …) Create AverageRelative3D plugin
createDumpMesh(state, name, ov, dump_every, path) Create MeshPlugin plugin
createDumpObjectStats(state, name, ov, …) Create ObjStats plugin
createDumpParticles(state, name, pv, …) Create ParticleSenderPlugin plugin
createDumpParticlesWithMesh(state, name, ov, …) Create ParticleWithMeshSenderPlugin plugin
createDumpParticlesWithRodData(state, name, …) Create ParticleSenderWithRodDataPlugin plugin The interface is the same as createDumpParticles
createDumpXYZ(state, name, pv, dump_every, path) Create XYZPlugin plugin
createExchangePVSFluxPlane(state, name, pv1, …) Create ExchangePVSFluxPlane plugin
createForceSaver(state, name, pv) Create ForceSaver plugin
createImposeProfile(state, name, pv, low, …) Create ImposeProfile plugin
createImposeVelocity(state, name, pvs, …) Create ImposeVelocity plugin
createMagneticOrientation(state, name, rov, …) Create MagneticOrientation plugin
createMembraneExtraForce(state, name, pv, forces) Create MembraneExtraForce plugin
createObjectPortalDestination(state, name, …) Create ObjectPortalDestination plugin
createObjectPortalSource(state, name, ov, …) Create ObjectPortalSource plugin
createObjectToParticlesPlugin(state, name, …) Create ObjectPortalSource plugin
createParticleChannelSaver(state, name, pv, …) Create ParticleChannelSaver plugin
createParticleChecker(state, name, check_every) Create ParticleChecker plugin
createParticleDisplacement(state, name, pv, …) Create ParticleDisplacementPlugin
createParticleDrag(state, name, pv, drag) Create ParticleDrag plugin
createParticlePortalDestination(state, name, …) Create ParticlePortalDestination plugin
createParticlePortalSource(state, name, ov, …) Create ParticlePortalSource plugin
createPinObject(state, name, ov, dump_every, …) Create PinObject plugin
createPinRodExtremity(state, name, rv, …) Create PinRodExtremity plugin
createPlaneOutlet(state, name, pvs, plane) Create PlaneOutletPlugin
createRadialVelocityControl(state, name, …) Create VelocityControl plugin
createRateOutlet(state, name, pvs, …) Create RateOutletPlugin
createStats(state, name, filename, every) Create SimulationStats plugin
createTemperaturize(state, name, pv, kBT, …) Create Temperaturize plugin
createVelocityControl(state, name, filename, …) Create VelocityControl plugin
createVelocityInlet(state, name, pv, …) Create VelocityInlet plugin
createVirialPressurePlugin(state, name, pv, …) Create VirialPressure plugin
createWallForceCollector(state, name, wall, …) Create WallForceCollector plugin
createWallRepulsion(state, name, pv, wall, …) Create WallRepulsion plugin

Details

class AddForce

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will add constant force \(\mathbf{F}_{extra}\) to each particle of a specific PV every time-step. Is is advised to only use it with rigid objects, since Velocity-Verlet integrator with constant pressure can do the same without any performance penalty.

class AddTorque

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will add constant torque \(\mathbf{T}_{extra}\) to each object of a specific OV every time-step.

class AnchorParticles

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will set a given particle at a given position and velocity.

class AnchorParticlesStats

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocessing side of AnchorParticles responsible to dump the data.

class Average3D

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will project certain quantities of the particle vectors on the grid (by simple binning), perform time-averaging of the grid and dump it in XDMF (LINK) format with HDF5 (LINK) backend. The quantities of interest are represented as channels associated with particles vectors. Some interactions, integrators, etc. and more notable plug-ins can add to the Particle Vectors per-particles arrays to hold different values. These arrays are called channels. Any such channel may be used in this plug-in, however, user must explicitely specify the type of values that the channel holds. Particle number density is used to correctly average the values, so it will be sampled and written in any case.

Note

This plugin is inactive if postprocess is disabled

class AverageRelative3D

Bases: _mirheo.Plugins.SimulationPlugin

This plugin acts just like the regular flow dumper, with one difference. It will assume a coordinate system attached to the center of mass of a specific object. In other words, velocities and coordinates sampled correspond to the object reference frame.

Note

Note that this plugin needs to allocate memory for the grid in the full domain, not only in the corresponding MPI subdomain. Therefore large domains will lead to running out of memory

Note

This plugin is inactive if postprocess is disabled

class DensityControlPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin applies forces to a set of particle vectors in order to get a constant density.

class DensityOutletPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin removes particles from a set of ParticleVector in a given region if the number density is larger than a given target.

class ExchangePVSFluxPlane

Bases: _mirheo.Plugins.SimulationPlugin

This plugin exchanges particles from a particle vector crossing a given plane to another particle vector. A particle with position x, y, z has crossed the plane if ax + by + cz + d >= 0, where a, b, c and d are the coefficient stored in the ‘plane’ variable

class ForceSaver

Bases: _mirheo.Plugins.SimulationPlugin

This plugin creates an extra channel per particle inside the given particle vector named ‘forces’. It copies the total forces at each time step and make it accessible by other plugins. The forces are stored in an array of float3.

class ImposeProfile

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will set the velocity of each particle inside a given domain to a target velocity with an additive term drawn from Maxwell distribution of the given temperature.

class ImposeVelocity

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will add velocity to all the particles of the target PV in the specified area (rectangle) such that the average velocity equals to desired.

set_target_velocity(arg0: float3) → None
class MagneticOrientation

Bases: _mirheo.Plugins.SimulationPlugin

This plugin gives a magnetic moment \(\mathbf{M}\) to every rigid objects in a given RigidObjectVector. It also models a uniform magnetic field \(\mathbf{B}\) (varying in time) and adds the induced torque to the objects according to:

\[\mathbf{T} = \mathbf{M} \times \mathbf{B}\]

The magnetic field is passed as a function from python. The function must take a float (time) as input and output a tuple of three floats (magnetic field).

class MembraneExtraForce

Bases: _mirheo.Plugins.SimulationPlugin

This plugin adds a given external force to a given membrane. The force is defined vertex wise and does not depend on position. It is the same for all membranes belonging to the same particle vector.

class MeshDumper

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of MeshPlugin. Responsible for performing the data reductions and I/O.

class MeshPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will write the meshes of all the object of the specified Object Vector in a PLY format (LINK).

Note

This plugin is inactive if postprocess is disabled

class ObjStats

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will write the coordinates of the centers of mass of the objects of the specified Object Vector. Instantaneous quantities (COM velocity, angular velocity, force, torque) are also written. If the objects are rigid bodies, also will be written the quaternion describing the rotation.

The file format is the following:

<object id> <simulation time> <COM>x3 [<quaternion>x4] <velocity>x3 <angular velocity>x3 <force>x3 <torque>x3

Note

Note that all the written values are instantaneous

Note

This plugin is inactive if postprocess is disabled

class ObjStatsDumper

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of ObjStats. Responsible for performing the I/O.

class ObjectPortalDestination

Bases: _mirheo.Plugins.SimulationPlugin

This plugin receives object vector content from another Mirheo instance. Currently works only for single rank simulations.

class ObjectPortalSource

Bases: _mirheo.Plugins.SimulationPlugin

This plugin sends object vector content to another Mirheo instance. Currently works only for single rank simulations.

Sends to destination all objects that touch the portal box. The destination tracks portal-assigned IDs to differentiate between objects that have already arrived and that are new to the destination side. To treat objects as new when they cross the periodic boundary, a marker plane must be given. Objects are considered then new as soon as their center of mass crosses the plane.

class ObjectToParticlesPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin transforms objects to particles when they cross a given plane.

class ParticleChannelSaver

Bases: _mirheo.Plugins.SimulationPlugin

This plugin creates an extra channel per particle inside the given particle vector with a given name. It copies the content of an extra channel of pv at each time step and make it accessible by other plugins.

class ParticleChecker

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will check the positions and velocities of all particles in the simulation every given time steps. To be used for debugging purpose.

class ParticleDisplacementPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin computes and save the displacement of the particles within a given particle vector. The result is stored inside the extra channel “displacements” as an array of float3.

class ParticleDrag

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will add drag force \(\mathbf{f} = - C_d \mathbf{u}\) to each particle of a specific PV every time-step.

class ParticleDumperPlugin

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of ParticleSenderPlugin. Responsible for performing the I/O.

class ParticlePortalDestination

Bases: _mirheo.Plugins.SimulationPlugin

This plugin receives particle vector content from another Mirheo instance. Currently works only for single rank simulations.

class ParticlePortalSource

Bases: _mirheo.Plugins.SimulationPlugin

This plugin sends particle vector content to another Mirheo instance. Currently works only for single rank simulations.

class ParticleSenderPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will dump positions, velocities and optional attached data of all the particles of the specified Particle Vector. The data is dumped into hdf5 format. An additional xdfm file is dumped to describe the data and make it readable by visualization tools.

class ParticleSenderWithRodDataPlugin

Bases: _mirheo.Plugins.SimulationPlugin

Extension of ParticleSenderPlugin to support bisegment data. If a field of optional data is per bisegment data (for a rod) this plugin will first scatter this data to particles.

class ParticleWithMeshDumperPlugin

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of ParticleWithMeshSenderPlugin. Responsible for performing the I/O.

class ParticleWithMeshSenderPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will dump positions, velocities and optional attached data of all the particles of the specified Object Vector, as well as connectivity information. The data is dumped into hdf5 format. An additional xdfm file is dumped to describe the data and make it readable by visualization tools.

class PinObject

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will impose given velocity as the center of mass velocity (by axis) of all the objects of the specified Object Vector. If the objects are rigid bodies, rotatation may be restricted with this plugin as well. The time-averaged force and/or torque required to impose the velocities and rotations are reported.

Note

This plugin is inactive if postprocess is disabled

class PinRodExtremity

Bases: _mirheo.Plugins.SimulationPlugin

This plugin adds a force on a given segment of all the rods in a RodVector. The force has the form deriving from the potential

\[E = k \left( 1 - \cos \theta \right),\]

where \(\theta\) is the angle between the material frame and a given direction (projected on the concerned segment). Note that the force is applied only on the material frame and not on the center line.

class PlaneOutletPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin removes all particles from a set of ParticleVector that are on the non-negative side of a given plane.

class PostprocessDensityControl

Bases: _mirheo.Plugins.PostprocessPlugin

Dumps info from DensityControlPlugin.

class PostprocessPlugin

Bases: object

Base postprocess plugin class

class PostprocessRadialVelocityControl

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of RadialVelocityControl. Responsible for performing the I/O.

class PostprocessStats

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of SimulationStats. Responsible for performing the data reductions and I/O.

class PostprocessVelocityControl

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of VelocityControl. Responsible for performing the I/O.

class RadialVelocityControl

Bases: _mirheo.Plugins.SimulationPlugin

This plugin applies a radial force (decreasing as \(r^3\)) to all the particles of the target PVS. The force is adapted via a PID controller such that the average of the velocity times radial position of the particles matches a target value.

class RateOutletPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin removes particles from a set of ParticleVector in a given region at a given mass rate.

class ReportPinObject

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of PinObject. Responsible for performing the I/O.

class SimulationPlugin

Bases: object

Base simulation plugin class

class SimulationStats

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will report aggregate quantities of all the particles in the simulation: total number of particles in the simulation, average temperature and momentum, maximum velocity magnutide of a particle and also the mean real time per step in milliseconds.

Note

This plugin is inactive if postprocess is disabled

class Temperaturize

Bases: _mirheo.Plugins.SimulationPlugin

This plugin changes the velocity of each particles from a given ParticleVector. It can operate under two modes: keepVelocity = True, in which case it adds a term drawn from a Maxwell distribution to the current velocity; keepVelocity = False, in which case it sets the velocity to a term drawn from a Maxwell distribution.

class UniformCartesianDumper

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of Average3D or AverageRelative3D. Responsible for performing the I/O.

get_channel_view(arg0: str) → array
class VelocityControl

Bases: _mirheo.Plugins.SimulationPlugin

This plugin applies a uniform force to all the particles of the target PVS in the specified area (rectangle). The force is adapted bvia a PID controller such that the velocity average of the particles matches the target average velocity.

class VelocityInlet

Bases: _mirheo.Plugins.SimulationPlugin

This plugin inserts particles in a given ParticleVector. The particles are inserted on a given surface with given velocity inlet. The rate of insertion is governed by the velocity and the given number density.

class VirialPressure

Bases: _mirheo.Plugins.SimulationPlugin

This plugin compute the virial pressure from a given ParticleVector. Note that the stress computation must be enabled with the corresponding stressName. This returns the total internal virial part only (no temperature term). Note that the volume is not devided in the result, the user is responsible to properly scale the output.

class VirialPressureDumper

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of VirialPressure. Responsible for performing the I/O.

class WallForceCollector

Bases: _mirheo.Plugins.SimulationPlugin

This plugin collects and average the total force exerted on a given wall. The result has 2 components:

  • bounce back: force necessary to the momentum change
  • frozen particles: total interaction force exerted on the frozen particles
class WallForceDumper

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of WallForceCollector. Responsible for the I/O part.

class WallRepulsion

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will add force on all the particles that are nearby a specified wall. The motivation of this plugin is as follows. The particles of regular PVs are prevented from penetrating into the walls by Wall Bouncers. However, using Wall Bouncers with Object Vectors may be undesirable (e.g. in case of a very viscous membrane) or impossible (in case of rigid objects). In these cases one can use either strong repulsive potential between the object and the wall particle or alternatively this plugin. The advantage of the SDF-based repulsion is that small penetrations won’t break the simulation.

The force expression looks as follows:

\[\begin{split}\mathbf{F}(\mathbf{r}) = \mathbf{\nabla}S(\mathbf{r}) \cdot \begin{cases} 0, & S(\mathbf{r}) < -h,\\ \min(F_\text{max}, C (S(\mathbf{r}) + h)), & S(\mathbf{r}) \geqslant -h,\\ \end{cases}\end{split}\]

where \(S\) is the SDF of the wall, \(C\), \(F_\text{max}\) and \(h\) are parameters.

class XYZDumper

Bases: _mirheo.Plugins.PostprocessPlugin

Postprocess side plugin of XYZPlugin. Responsible for the I/O part.

class XYZPlugin

Bases: _mirheo.Plugins.SimulationPlugin

This plugin will dump positions of all the particles of the specified Particle Vector in the XYZ format.

Note

This plugin is inactive if postprocess is disabled

createAddForce(state: MirState, name: str, pv: ParticleVectors.ParticleVector, force: float3) → Tuple[Plugins.AddForce, Plugins.PostprocessPlugin]

Create AddForce plugin

Parameters:
  • name – name of the plugin
  • pvParticleVector that we’ll work with
  • force – extra force
createAddTorque(state: MirState, name: str, ov: ParticleVectors.ParticleVector, torque: float3) → Tuple[Plugins.AddTorque, Plugins.PostprocessPlugin]

Create AddTorque plugin

Parameters:
  • name – name of the plugin
  • ovObjectVector that we’ll work with
  • torque – extra torque (per object)
createAnchorParticles(state: MirState, name: str, pv: ParticleVectors.ParticleVector, positions: Callable[[float], List[float3]], velocities: Callable[[float], List[float3]], pids: List[int], report_every: int, path: str) → Tuple[Plugins.AnchorParticles, Plugins.AnchorParticlesStats]

Create AnchorParticles plugin

Parameters:
  • name – name of the plugin
  • pvParticleVector that we’ll work with
  • positions – positions (at given time) of the particles
  • velocities – velocities (at given time) of the particles
  • pids – global ids of the particles in the given particle vector
  • report_every – report the time averaged force acting on the particles every this amount of timesteps
  • path – folder where to dump the stats
createDensityControl(state: MirState, name: str, file_name: str, pvs: List[ParticleVectors.ParticleVector], target_density: float, region: Callable[[float3], float], resolution: float3, level_lo: float, level_hi: float, level_space: float, Kp: float, Ki: float, Kd: float, tune_every: int, dump_every: int, sample_every: int) → Tuple[Plugins.DensityControlPlugin, Plugins.PostprocessDensityControl]

Create DensityControlPlugin

Parameters:
  • name – name of the plugin
  • file_name – output filename
  • pvs – list of ParticleVector that we’ll work with
  • target_density – target number density (used only at boundaries of level sets)
  • region – a scalar field which describes how to subdivide the domain. It must be continuous and differentiable, as the forces are in the gradient direction of this field
  • resolution – grid resolution to represent the region field
  • level_lo – lower level set to apply the controller on
  • level_hi – highest level set to apply the controller on
  • level_space – the size of one subregion in terms of level sets
  • Ki, Kd (Kp,) – pid control parameters
  • tune_every – update the forces every this amount of time steps
  • dump_every – dump densities and forces in file filename
  • sample_every – sample to average densities every this amount of time steps
createDensityOutlet(state: MirState, name: str, pvs: List[ParticleVectors.ParticleVector], number_density: float, region: Callable[[float3], float], resolution: float3) → Tuple[Plugins.DensityOutletPlugin, Plugins.PostprocessPlugin]

Create DensityOutletPlugin

Parameters:
  • name – name of the plugin
  • pvs – list of ParticleVector that we’ll work with
  • number_density – maximum number_density in the region
  • region – a function that is negative in the concerned region and positive outside
  • resolution – grid resolution to represent the region field
createDumpAverage(state: MirState, name: str, pvs: List[ParticleVectors.ParticleVector], sample_every: int, dump_every: int, bin_size: float3 = float3(1.0, 1.0, 1.0), channels: List[Tuple[str, str]], path: str = 'xdmf/') → Tuple[Plugins.Average3D, Plugins.UniformCartesianDumper]

Create Average3D plugin

Parameters:
  • name – name of the plugin
  • pvs – list of ParticleVector that we’ll work with
  • sample_every – sample quantities every this many time-steps
  • dump_every – write files every this many time-steps
  • bin_size – bin size for sampling. The resulting quantities will be cell-centered
  • path – Path and filename prefix for the dumps. For every dump two files will be created: <path>_NNNNN.xmf and <path>_NNNNN.h5
  • channels

    list of pairs name - type. Name is the channel (per particle) name. Always available channels are:

    • ’velocity’ with type “float4”

    Type is to provide the type of quantity to extract from the channel. Type can also define a simple transformation from the channel internal structure to the datatype supported in HDF5 (i.e. scalar, vector, tensor) Available types are:

    • ’scalar’: 1 float per particle
    • ’vector’: 3 floats per particle
    • ’vector_from_float4’: 4 floats per particle. 3 first floats will form the resulting vector
    • ’tensor6’: 6 floats per particle, symmetric tensor in order xx, xy, xz, yy, yz, zz
createDumpAverageRelative(state: MirState, name: str, pvs: List[ParticleVectors.ParticleVector], relative_to_ov: ParticleVectors.ObjectVector, relative_to_id: int, sample_every: int, dump_every: int, bin_size: float3 = float3(1.0, 1.0, 1.0), channels: List[Tuple[str, str]], path: str = 'xdmf/') → Tuple[Plugins.AverageRelative3D, Plugins.UniformCartesianDumper]

Create AverageRelative3D plugin

The arguments are the same as for createDumpAverage() with a few additions

Parameters:
  • relative_to_ov – take an object governing the frame of reference from this ObjectVector
  • relative_to_id – take an object governing the frame of reference with the specific ID
createDumpMesh(state: MirState, name: str, ov: ParticleVectors.ObjectVector, dump_every: int, path: str) → Tuple[Plugins.MeshPlugin, Plugins.MeshDumper]

Create MeshPlugin plugin

Parameters:
  • name – name of the plugin
  • ovObjectVector that we’ll work with
  • dump_every – write files every this many time-steps
  • path – the files will look like this: <path>/<ov_name>_NNNNN.ply
createDumpObjectStats(state: MirState, name: str, ov: ParticleVectors.ObjectVector, dump_every: int, path: str) → Tuple[Plugins.ObjStats, Plugins.ObjStatsDumper]

Create ObjStats plugin

Parameters:
  • name – name of the plugin
  • ovObjectVector that we’ll work with
  • dump_every – write files every this many time-steps
  • path – the files will look like this: <path>/<ov_name>_NNNNN.txt
createDumpParticles(state: MirState, name: str, pv: ParticleVectors.ParticleVector, dump_every: int, channels: List[Tuple[str, str]], path: str) → Tuple[Plugins.ParticleSenderPlugin, Plugins.ParticleDumperPlugin]

Create ParticleSenderPlugin plugin

Parameters:
  • name – name of the plugin
  • pvParticleVector that we’ll work with
  • dump_every – write files every this many time-steps
  • path – Path and filename prefix for the dumps. For every dump two files will be created: <path>_NNNNN.xmf and <path>_NNNNN.h5
  • channels

    list of pairs name - type. Name is the channel (per particle) name. The “velocity” and “id” channels are always activated. Type is to provide the type of quantity to extract from the channel. Available types are:

    • ’scalar’: 1 float per particle
    • ’vector’: 3 floats per particle
    • ’tensor6’: 6 floats per particle, symmetric tensor in order xx, xy, xz, yy, yz, zz
createDumpParticlesWithMesh(state: MirState, name: str, ov: ParticleVectors.ObjectVector, dump_every: int, channels: List[Tuple[str, str]], path: str) → Tuple[Plugins.ParticleWithMeshSenderPlugin, Plugins.ParticleWithMeshDumperPlugin]

Create ParticleWithMeshSenderPlugin plugin

Parameters:
  • name – name of the plugin
  • ovObjectVector that we’ll work with
  • dump_every – write files every this many time-steps
  • path – Path and filename prefix for the dumps. For every dump two files will be created: <path>_NNNNN.xmf and <path>_NNNNN.h5
  • channels

    list of pairs name - type. Name is the channel (per particle) name. The “velocity” and “id” channels are always activated. Type is to provide the type of quantity to extract from the channel. Available types are:

    • ’scalar’: 1 float per particle
    • ’vector’: 3 floats per particle
    • ’tensor6’: 6 floats per particle, symmetric tensor in order xx, xy, xz, yy, yz, zz
createDumpParticlesWithRodData(state: MirState, name: str, rv: ParticleVectors.ParticleVector, dump_every: int, channels: List[Tuple[str, str]], path: str) → Tuple[Plugins.ParticleSenderWithRodDataPlugin, Plugins.ParticleDumperPlugin]

Create ParticleSenderWithRodDataPlugin plugin The interface is the same as createDumpParticles

Parameters:
  • name – name of the plugin
  • rvRodVector that we’ll work with
  • dump_every – write files every this many time-steps
  • path – Path and filename prefix for the dumps. For every dump two files will be created: <path>_NNNNN.xmf and <path>_NNNNN.h5
  • channels

    list of pairs name - type. Name is the channel (per particle) name. The “velocity” and “id” channels are always activated. Type is to provide the type of quantity to extract from the channel. Available types are:

    • ’scalar’: 1 float per particle
    • ’vector’: 3 floats per particle
    • ’tensor6’: 6 floats per particle, symmetric tensor in order xx, xy, xz, yy, yz, zz
createDumpXYZ(state: MirState, name: str, pv: ParticleVectors.ParticleVector, dump_every: int, path: str) → Tuple[Plugins.XYZPlugin, Plugins.XYZDumper]

Create XYZPlugin plugin

Parameters:
  • name – name of the plugin
  • pvs – list of ParticleVector that we’ll work with
  • dump_every – write files every this many time-steps
  • path – the files will look like this: <path>/<pv_name>_NNNNN.xyz
createExchangePVSFluxPlane(state: MirState, name: str, pv1: ParticleVectors.ParticleVector, pv2: ParticleVectors.ParticleVector, plane: float4) → Tuple[Plugins.ExchangePVSFluxPlane, Plugins.PostprocessPlugin]

Create ExchangePVSFluxPlane plugin

Parameters:
  • name – name of the plugin
  • pv1ParticleVector source
  • pv2ParticleVector destination
  • plane – 4 coefficients for the plane equation ax + by + cz + d >= 0
createForceSaver(state: MirState, name: str, pv: ParticleVectors.ParticleVector) → Tuple[Plugins.ForceSaver, Plugins.PostprocessPlugin]

Create ForceSaver plugin

Parameters:
  • name – name of the plugin
  • pvParticleVector that we’ll work with
createImposeProfile(state: MirState, name: str, pv: ParticleVectors.ParticleVector, low: float3, high: float3, velocity: float3, kBT: float) → Tuple[Plugins.ImposeProfile, Plugins.PostprocessPlugin]

Create ImposeProfile plugin

Parameters:
  • name – name of the plugin
  • pvParticleVector that we’ll work with
  • low – the lower corner of the domain
  • high – the higher corner of the domain
  • velocity – target velocity
  • kBT – temperature in the domain (appropriate Maxwell distribution will be used)
createImposeVelocity(state: MirState, name: str, pvs: List[ParticleVectors.ParticleVector], every: int, low: float3, high: float3, velocity: float3) → Tuple[Plugins.ImposeVelocity, Plugins.PostprocessPlugin]

Create ImposeVelocity plugin

Parameters:
  • name – name of the plugin
  • pvs – list of ParticleVector that we’ll work with
  • every – change the velocities once in every timestep
  • low – the lower corner of the domain
  • high – the higher corner of the domain
  • velocity – target velocity
createMagneticOrientation(state: MirState, name: str, rov: ParticleVectors.RigidObjectVector, moment: float3, magneticFunction: Callable[[float], float3]) → Tuple[Plugins.MagneticOrientation, Plugins.PostprocessPlugin]

Create MagneticOrientation plugin

Parameters:
  • name – name of the plugin
  • rovRigidObjectVector with which the magnetic field will interact
  • moment – magnetic moment per object
  • magneticFunction – a function that depends on time and returns a uniform (float3) magnetic field
createMembraneExtraForce(state: MirState, name: str, pv: ParticleVectors.ParticleVector, forces: List[float3]) → Tuple[Plugins.MembraneExtraForce, Plugins.PostprocessPlugin]

Create MembraneExtraForce plugin

Parameters:
  • name – name of the plugin
  • pvParticleVector to which the force should be added
  • forces – array of forces, one force (3 floats) per vertex in a single mesh
createObjectPortalDestination(state: MirState, name: str, ov: ParticleVectors.ObjectVector, src: float3, dst: float3, size: float3, tag: int, interCommPtr: int) → Tuple[Plugins.ObjectPortalDestination, Plugins.PostprocessPlugin]

Create ObjectPortalDestination plugin

Parameters:
  • name – name of the plugin
  • ov – target object vector
  • src – lower corner of the portal on the source side
  • dst – lower corner of the portal on the destination side
  • size – portal size
  • tag – tag to use for MPI communication
  • interCommPtr – pointer to a MPI_Comm intercommunicator between Mirheo instances.
createObjectPortalSource(state: MirState, name: str, ov: ParticleVectors.ObjectVector, src: float3, dst: float3, size: float3, plane: float4, tag: int, interCommPtr: int) → Tuple[Plugins.ObjectPortalSource, Plugins.PostprocessPlugin]

Create ObjectPortalSource plugin

Parameters:
  • name – name of the plugin
  • ov – source object vector
  • src – lower corner of the portal on the source side
  • dst – lower corner of the portal on the destination side
  • size – portal size
  • plane – plane after which the objects get a new unique identifier Should be far from the source portal and slightly away of the domain boundary.
  • tag – tag to use for MPI communication
  • interCommPtr – pointer to a MPI_Comm intercommunicator between Mirheo instances.
createObjectToParticlesPlugin(state: MirState, name: str, ov: ParticleVectors.ObjectVector, pv: ParticleVectors.ParticleVector, plane: float4) → Tuple[Plugins.ObjectToParticlesPlugin, Plugins.PostprocessPlugin]

Create ObjectPortalSource plugin

Parameters:
  • name – name of the plugin
  • ov – source object vector
  • pv – target particle vector
  • plane – plane (a, b, c, d) defined as a*x + b*y + c*z + d == 0
createParticleChannelSaver(state: MirState, name: str, pv: ParticleVectors.ParticleVector, channelName: str, savedName: str) → Tuple[Plugins.ParticleChannelSaver, Plugins.PostprocessPlugin]

Create ParticleChannelSaver plugin

Parameters:
  • name – name of the plugin
  • pvParticleVector that we’ll work with
  • channelName – the name of the source channel
  • savedName – name of the extra channel
createParticleChecker(state: MirState, name: str, check_every: int) → Tuple[Plugins.ParticleChecker, Plugins.PostprocessPlugin]

Create ParticleChecker plugin

Parameters:
  • name – name of the plugin
  • check_every – check every this amount of time steps
createParticleDisplacement(state: MirState, name: str, pv: ParticleVectors.ParticleVector, update_every: int) → Tuple[Plugins.ParticleDisplacementPlugin, Plugins.PostprocessPlugin]

Create ParticleDisplacementPlugin

Parameters:
  • name – name of the plugin
  • pvParticleVector that we’ll work with
  • update_every – displacements are computed between positions separated by this amount of timesteps
createParticleDrag(state: MirState, name: str, pv: ParticleVectors.ParticleVector, drag: float) → Tuple[Plugins.ParticleDrag, Plugins.PostprocessPlugin]

Create ParticleDrag plugin

Parameters:
  • name – name of the plugin
  • pvParticleVector that we’ll work with
  • drag – drag coefficient
createParticlePortalDestination(state: MirState, name: str, ov: ParticleVectors.ParticleVector, src: float3, dst: float3, size: float3, tag: int, interCommPtr: int) → Tuple[Plugins.ParticlePortalDestination, Plugins.PostprocessPlugin]

Create ParticlePortalDestination plugin

Parameters:
  • name – name of the plugin
  • ..
  • ..
  • .
createParticlePortalSource(state: MirState, name: str, ov: ParticleVectors.ParticleVector, src: float3, dst: float3, size: float3, tag: int, interCommPtr: int) → Tuple[Plugins.ParticlePortalSource, Plugins.PostprocessPlugin]

Create ParticlePortalSource plugin

Parameters:
  • name – name of the plugin
  • ..
  • ..
  • .
createPinObject(state: MirState, name: str, ov: ParticleVectors.ObjectVector, dump_every: int, path: str, velocity: float3, angular_velocity: float3) → Tuple[Plugins.PinObject, Plugins.ReportPinObject]

Create PinObject plugin

Parameters:
  • name – name of the plugin
  • ovObjectVector that we’ll work with
  • dump_every – write files every this many time-steps
  • path – the files will look like this: <path>/<ov_name>_NNNNN.txt
  • velocity – 3 floats, each component is the desired object velocity. If the corresponding component should not be restricted, set this value to PinObject::Unrestricted
  • angular_velocity – 3 floats, each component is the desired object angular velocity. If the corresponding component should not be restricted, set this value to PinObject::Unrestricted
createPinRodExtremity(state: MirState, name: str, rv: ParticleVectors.RodVector, segment_id: int, f_magn: float, target_direction: float3) → Tuple[Plugins.PinRodExtremity, Plugins.PostprocessPlugin]

Create PinRodExtremity plugin

Parameters:
  • name – name of the plugin
  • rvRodVector that we’ll work with
  • segment_id – the segment to which the plugin is active
  • f_magn – force magnitude
  • target_direction – the direction in which the material frame tends to align
createPlaneOutlet(state: MirState, name: str, pvs: List[ParticleVectors.ParticleVector], plane: float4) → Tuple[Plugins.PlaneOutletPlugin, Plugins.PostprocessPlugin]

Create PlaneOutletPlugin

Parameters:
  • name – name of the plugin
  • pvs – list of ParticleVector that we’ll work with
  • plane – Tuple (a, b, c, d). Particles are removed if ax + by + cz + d >= 0.
createRadialVelocityControl(state: MirState, name: str, filename: str, pvs: List[ParticleVectors.ParticleVector], minRadius: float, maxRadius: float, sample_every: int, tune_every: int, dump_every: int, center: float3, target_vel: float, Kp: float, Ki: float, Kd: float) → Tuple[Plugins.RadialVelocityControl, Plugins.PostprocessRadialVelocityControl]

Create VelocityControl plugin

Parameters:
  • name – name of the plugin
  • filename – dump file name
  • pvs – list of concerned ParticleVector
  • maxRadius (minRadius,) – only particles within this distance are considered
  • sample_every – sample velocity every this many time-steps
  • tune_every – adapt the force every this many time-steps
  • dump_every – write files every this many time-steps
  • center – center of the radial coordinates
  • target_vel – the target mean velocity of the particles at \(r=1\)
  • Ki, Kd (Kp,) – PID controller coefficients
createRateOutlet(state: MirState, name: str, pvs: List[ParticleVectors.ParticleVector], mass_rate: float, region: Callable[[float3], float], resolution: float3) → Tuple[Plugins.RateOutletPlugin, Plugins.PostprocessPlugin]

Create RateOutletPlugin

Parameters:
  • name – name of the plugin
  • pvs – list of ParticleVector that we’ll work with
  • mass_rate – total outlet mass rate in the region
  • region – a function that is negative in the concerned region and positive outside
  • resolution – grid resolution to represent the region field
createStats(state: MirState, name: str, filename: str = '', every: int) → Tuple[Plugins.SimulationStats, Plugins.PostprocessStats]

Create SimulationStats plugin

Parameters:
  • name – name of the plugin
  • filename – the stats will also be recorded to that file in a computer-friendly way
  • every – report to standard output every that many time-steps
createTemperaturize(state: MirState, name: str, pv: ParticleVectors.ParticleVector, kBT: float, keepVelocity: bool) → Tuple[Plugins.Temperaturize, Plugins.PostprocessPlugin]

Create Temperaturize plugin

Parameters:
  • name – name of the plugin
  • pv – the concerned ParticleVector
  • kBT – the target temperature
  • keepVelocity – True for adding Maxwell distribution to the previous velocity; False to set the velocity to a Maxwell distribution.
createVelocityControl(state: MirState, name: str, filename: str, pvs: List[ParticleVectors.ParticleVector], low: float3, high: float3, sample_every: int, tune_every: int, dump_every: int, target_vel: float3, Kp: float, Ki: float, Kd: float) → Tuple[Plugins.VelocityControl, Plugins.PostprocessVelocityControl]

Create VelocityControl plugin

Parameters:
  • name – name of the plugin
  • filename – dump file name
  • pvs – list of concerned ParticleVector
  • high (low,) – boundaries of the domain of interest
  • sample_every – sample velocity every this many time-steps
  • tune_every – adapt the force every this many time-steps
  • dump_every – write files every this many time-steps
  • target_vel – the target mean velocity of the particles in the domain of interest
  • Ki, Kd (Kp,) – PID controller coefficients
createVelocityInlet(state: MirState, name: str, pv: ParticleVectors.ParticleVector, implicit_surface_func: Callable[[float3], float], velocity_field: Callable[[float3], float3], resolution: float3, number_density: float, kBT: float) → Tuple[Plugins.VelocityInlet, Plugins.PostprocessPlugin]

Create VelocityInlet plugin

Parameters:
  • name – name of the plugin
  • pv – the ParticleVector that we ll work with
  • implicit_surface_func – a scalar field function that has the required surface as zero level set
  • velocity_field – vector field that describes the velocity on the inlet (will be evaluated on the surface only)
  • resolution – grid size used to discretize the surface
  • number_density – number density of the inserted solvent
  • kBT – temperature of the inserted solvent
createVirialPressurePlugin(state: MirState, name: str, pv: ParticleVectors.ParticleVector, regionFunc: Callable[[float3], float], h: float3, dump_every: int, path: str) → Tuple[Plugins.VirialPressure, Plugins.VirialPressureDumper]

Create VirialPressure plugin

Parameters:
  • name – name of the plugin
  • pv – concerned ParticleVector
  • regionFunc – predicate for the concerned region; positive inside the region and negative outside
  • h – grid size for representing the predicate onto a grid
  • dump_every – report total pressure every this many time-steps
  • path – the folder name in which the file will be dumped
createWallForceCollector(state: MirState, name: str, wall: Walls.Wall, pvFrozen: ParticleVectors.ParticleVector, sample_every: int, dump_every: int, filename: str) → Tuple[Plugins.WallForceCollector, Plugins.WallForceDumper]

Create WallForceCollector plugin

Parameters:
  • name – name of the plugin
  • wallWall that we ll work with
  • pvFrozen – corresponding frozen ParticleVector
  • sample_every – sample every this number of time steps
  • dump_every – dump every this amount of timesteps
  • filename – output filename
createWallRepulsion(state: MirState, name: str, pv: ParticleVectors.ParticleVector, wall: Walls.Wall, C: float, h: float, max_force: float) → Tuple[Plugins.WallRepulsion, Plugins.PostprocessPlugin]

Create WallRepulsion plugin

Parameters:
  • name – name of the plugin
  • pvParticleVector that we’ll work with
  • wallWall that defines the repulsion
  • C\(C\)
  • h\(h\)
  • max_force\(F_{max}\)