mpacts.commands.geometry. orientation

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

import mpacts.commands.geometry.orientation
#or assign it to a shorter name
import mpacts.commands.geometry.orientation as ori

ComputeOrientationCommand

class mpacts.commands.geometry.orientation.ComputeOrientationCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

With a given bias direction and random component, rotates the cell’s orientation (or polarization) towards a new direction each time step.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • bias_dir — bias direction vector for this time step. Make this (0,0,0) if you want no directed influence.
    • direction — Array with a direction vector
    • frac_dir — angular velocity in which to turn towards the directed component (1/s).
    • frac_ran — angular velocity in which to turn towards the randomly generated component (1/s)
    • 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.
    • restrict_to_plane (default value = 0 0 0) — If a plane normal is given, the command will project its direction in the plane. If no value is given, this command will try to find an array called ‘n_restrict’. If found it will be used to restrict to different values of the normals. If not found no restriction is applied at all.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, frac_dir, frac_ran, direction, bias_dir, [gate, predicate, restrict_to_plane]
ComputeOrientationCommand(name, parent, **kwargs)

InitRigidBodyRotationCommand

class mpacts.commands.geometry.orientation.InitRigidBodyRotationCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Computes the orientation quaternions of the segments so that the inverse quaternion rotation of the segment vector will be (1,0,0). This is necessary in order to be able to correct for numerical drift. Also helps for debugging visualisations.
Default location: ‘loop_cmds/pre_body_force_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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate]
InitRigidBodyRotationCommand(name, parent, **kwargs)

OrientToMeanCommand

class mpacts.commands.geometry.orientation.OrientToMeanCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Makes a given ‘direction’ array point towards / away from the mean of the ‘x’ positions of its array manager
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • direction — Array with a direction vector
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • fixed_mean (default value = 0) — If true, requires the user to give ‘mean’ as an option and will only use this mean to orient the cell.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • invert (default value = 0) — If ‘true’, the preferred direction is AWAY from the mean position, instead of towards it!
    • max_y (default value = 1.7976931348623157e+308) — maximal y value to be accounted for in the mean calculation
    • mean (default value = 0 0 0) — mean value to orient towards. Only used (and required) when fixed_mean == true.
    • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, direction, [gate, predicate, max_y, fixed_mean, mean, invert]
OrientToMeanCommand(name, parent, **kwargs)

RandomWalkInPlaneCommand

class mpacts.commands.geometry.orientation.RandomWalkInPlaneCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Drunken man’s walk. A given chance per time unit changes the direction vector of a cell.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • direction — Array with a direction vector
    • p — chance per second to change the cells direction vector.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • cil_factor (default value = 0) — Contact inhibition of locomotion (CIL). Increases the chance of repolarizing when pointing away from free_dir.
    • free_direction (default value = None) — Array which keeps the direction ‘away’ from contact. Used for modeling contact inhibition
    • 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 (default value = 0 0 0) — If a plane normal is given, the command will project its direction in the plane.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, p, direction, [gate, predicate, restrict_to_plane, free_direction, cil_factor]
RandomWalkInPlaneCommand(name, parent, **kwargs)

RotateVectorCommand

class mpacts.commands.geometry.orientation.RotateVectorCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Rotate a given vector according to ‘q’ with a base vector stored in body frame coordinates.
Default location: ‘loop_cmds/pre_body_force_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.
    • vector_BF (default value = None) — Vector with body frame vectors from which the rotated vectors will be computed. If not given, array ‘vector_BF’ is searched.
    • vector (default value = None) — Vector with vector directions to which rotated vectors will be stored. If not given, array ‘vector’ is searched.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate, vector, vector_BF]
RotateVectorCommand(name, parent, **kwargs)

RotateWithBiasCommand

class mpacts.commands.geometry.orientation.RotateWithBiasCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Rotates a direction vector with another ‘bias’ vector with a given angular velocity.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • bias_dir — bias direction vector to which ‘direction’ will be rotated.
    • direction — Array with a direction vector
    • pc — Particle container on which the command is applied
    • w — angular velocity in which to turn towards the directed component (1/s).
  • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, w, direction, bias_dir, [gate, predicate]
RotateWithBiasCommand(name, parent, **kwargs)

UpdateRigidBodyRotationCommand

class mpacts.commands.geometry.orientation.UpdateRigidBodyRotationCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Given the old positions ‘xold’ of segments compute the ‘shortest arc’ to get to the current orientation of the segments and apply that rotation to the ‘orientation’ of these particles. NOTE: currently also updates the xold positions immediately after computing the rigid body rotation.
Default location: ‘loop_cmds/pre_body_force_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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate]
UpdateRigidBodyRotationCommand(name, parent, **kwargs)

UpdateTorsionRotationCommand

class mpacts.commands.geometry.orientation.UpdateTorsionRotationCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Updates the torsion angle given an the array Mt by computing a torsion quaternion and multiplying the ‘orientation’ of the particle container with that rotation quaternion. Note: resets the torsion angle when done now.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
    • relax_time — Characteristic time of torsional relaxation
  • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, relax_time, [gate, predicate]
UpdateTorsionRotationCommand(name, parent, **kwargs)