mpacts.commands.force.constraints. areaforce

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

import mpacts.commands.force.constraints.areaforce
#or assign it to a shorter name
import mpacts.commands.force.constraints.areaforce as are

ComputeGlobalAreaForceCommand

class mpacts.commands.force.constraints.areaforce.ComputeGlobalAreaForceCommand

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

Computes a global ‘area’ tension based on the difference between array area and array area_eq and stores the result in Scalar array area_tension. All three arrays must exist. This command computes the global tension T_g for a body with area A as T_g = k_d ( A - A^* ) / A^*, where * denotes the resting area. ComputeGlobalAreaForceCommand only computes the tension and stores it in an array. To actually translate this tension into forces, this command should be followed by a ComputeTriangleAreaForceCommand in a simulation tree.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • kd (kg . s^-2) — Global Area conservation constant (for whole body): T_area = kd * (total_area - total_area0) / total_area0
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • base_tension (default value = 0) — base tension that should be added for each deformable body.
    • 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, kd, [gate, predicate, base_tension]
ComputeGlobalAreaForceCommand(name, parent, **kwargs)

ComputeSurfaceTensionCommand

class mpacts.commands.force.constraints.areaforce.ComputeSurfaceTensionCommand

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

Computes the corresponding surface tension (stored at the level of individual triangles) for bodies which have a pressure difference over their surface (e.g. a cell with a turgor pressure). The tension is computed from the Young-Laplace equation as: \tau = \frac{1}{2} R \Delta p, in which R is the local value of ‘inverse_curvature’ which must have been computed as this point, and \Delta p is the pressure difference, which must be stored as an array per parent particle. Warning: flat surfaces will naturally have a radius of curvature of infinity, and result in infinite tensions as well. Care should be taken to prevent numerical issues, either by only executing ComputeSurfaceTensionCommand conditionally (for example only at initialization), or by configuring mpacts.commands.geometry.triangle.ComputeCurvatureCommand to prevent too high radii of curvature.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
    • surface_tension — Surface tension of the interface described by the mesh, in the direction of the ‘normal’ array of each node
  • Optional keywords:
    • area (default value = None) — Array with area of each node. If not given, the array ‘area’ will be searched.
    • base_pressure (default value = None) — Array per parent with base_pressure. For example, to have a vesicle of radius ‘R’ in equilibrium, specify: base_pressure=2*surface_tension/R
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • init_base_pressure (default value = 0) — If ‘True’, we will ourselves initialize the base pressure to 2*surface_tension / R for each parent particle where the radius is estimated from the cells equilibrium volume of the parent.
    • 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, surface_tension, [gate, predicate, base_pressure, area, init_base_pressure]
ComputeSurfaceTensionCommand(name, parent, **kwargs)

ComputeTriangleAreaForceCMSCommand

class mpacts.commands.force.constraints.areaforce.ComputeTriangleAreaForceCMSCommand

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

DEPRECATED!nComputes force per triangle based on local area difference area-area_eq and a global area tension which must be pre-computed (see ComputeGlobalAreaForceCommand) and stored in array ‘area_tension’. ComputeTriangleAreaForceCMSCommand differs from ComputeTriangleAreaForceCommand in that it always gives each node of the triangle 1/3th of the force, in the direction of the vector pointing from the triangle’s center of mass (CMS) towards each node. Warning: this command has been deprecated.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • ka — Local Area conservation constant. F_local = ka * (area_triangle - area0)
    • nodes — Array Manager containing the nodes of the deformable body
    • 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)
    • ka_compress (default value = -1) — Optional area conservation constant for compression. If not given, ‘ka’ will be used.
    • 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, ka, nodes, [gate, predicate, ka_compress]
ComputeTriangleAreaForceCMSCommand(name, parent, **kwargs)

ComputeTriangleAreaForceCommand

class mpacts.commands.force.constraints.areaforce.ComputeTriangleAreaForceCommand

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

Computes force per triangle based on local area difference area-area_eq and a global area tension which must be pre-computed (see ComputeGlobalAreaForceCommand) and stored in array 'area_tension'. For each triangle t with area A, a tension is computed as T_t = k_a (A_t - A_t^*)/A_t^* + T_e + \frac{T_g}{2} where * denotes the resting area of the triangle, T_e is an optional externally added tension and T_g is a global tension (kept per parent particle) that is computed by ComputeGlobalAreaForceCommand. The resulting tension is transferred to the F array of the triangle nodes in the direction towards the opposite triangle side: For each node i on triangle t with normal vector n, the force contribution is \vec{F}_{t,i} = T_t ( \vec{x}_k - \vec{x}_j ) \times \vec{\hat{n}}_t, where we have ensured that opposing nodes j and k are sorted in a counter-clock-wise manner.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • ka (kg . s^-2) — Local Area conservation constant. T_local = ka * (area_triangle - area0) / area0 + T_external.
    • nodes — Array Manager containing the nodes of the deformable body.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • external_tension (default value = None) — Array per triangle that keeps an ‘externally’ computed tension T_external that will be added to the triangle area force.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • ka_compress (kg . s^-2) (default value = -1) — Optional area conservation constant for compression. If not given, ‘ka’ will be used.
    • 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, ka, nodes, [gate, predicate, ka_compress, external_tension]
ComputeTriangleAreaForceCommand(name, parent, **kwargs)

ComputeTriangleAreaNonlinearForceCommand

class mpacts.commands.force.constraints.areaforce.ComputeTriangleAreaNonlinearForceCommand

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

Computes force per triangle based on local area difference area-area_eq and a global area tension which must be pre-computed (see ComputeGlobalAreaForceCommand) and stored in array 'area_tension'. For each triangle t with area A, a tension is computed as T_t = k_a \ln \frac{ A_t }{ A_t^* } + T_e + \frac{T_g}{2} where * denotes the resting area of the triangle, T_e is an optional externally added tension and T_g is a global tension (kept per parent particle) that is computed by ComputeGlobalAreaForceCommand. The resulting tension is transferred to the F array of the triangle nodes in the direction towards the opposite triangle side: For each node i on triangle t with normal vector n, the force contribution is \vec{F}_{t,i} = T_t ( \vec{x}_k - \vec{x}_j ) \times \vec{\hat{n}}_t, where we have ensured that opposing nodes j and k are sorted in a counter-clock-wise manner.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • ka (kg . s^-2) — Local Area conservation constant. T_local = ka * ln( area_triangle / area0 ) + T_external.
    • nodes — Array Manager containing the nodes of the deformable body.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • external_tension (default value = None) — Array per triangle that keeps an ‘externally’ computed tension T_external that will be added to the triangle area force.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • ka_compress (kg . s^-2) (default value = -1) — Optional area conservation constant for compression. If not given, ‘ka’ will be used.
    • 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, ka, nodes, [gate, predicate, ka_compress, external_tension]
ComputeTriangleAreaNonlinearForceCommand(name, parent, **kwargs)