mpacts.particles. deformablebody

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

DeformableBody Layout

Particle of type DeformableBody:

  • GeometryTag = GeometryTag_ComposedParticle

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.ArrayGlobalVolumePressureCmd()
Compute total pressure per deformable body which is proportional to the difference between a set (or initial) target volume and the body’s actual volume. A decreased volume leads to a positive pressure. It is up to the user to ensure that when this command is executed, the volume of the body has been accurately set and calculated (e.g. using the Gauss theorem). It is also the responsibility of the user to use another command that translates this global force called volume_force to the degrees of freedom of the body.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • kv — Global volume conservation constant (for whole body): p_global = kv * (total_volume_eq - total_volume) / total_volume_eq.
    • 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)
    • internal_pressure (default value = None) — Internal pressure (such as turgor pressure)
    • kvi (default value = None) — Optional integrative term for global volume conservation. Setting this to non-zero would make this effectively a PI controller.The integrative gain = kv/kvi, hence kvi has units of time (lower = stiffer integrative control)If kvi is given, an array with name ‘volume_error_int’ should be present, and this array should be intialized to zero at the beginning of the simulation.
    • 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.ComputeViscousVolumeChangeCmd()
This command changes the equilibrium volume of a deformable body if a certain threshold volume pressure has been exceeded. Proportional to this pressure multiplied with the permeable surface area (total area or area not in contact), the body will then shrink or expand its reference volume with the constant Lp. We require a reference volume to be set as well as ‘volume_pressure’ and ‘area’. ‘contact area’ also has to be set if Total_area=False.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • Lp — Hydraulic conductivity [m/ (Pa s)]
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • Total_area (default value = 1) — If true, volume loss is assumed to occur over the total area. If false, only the area not in contact will be assumed permeable
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • max_volume (default value = 1.7976931348623157e+308) — Maximal equilibrium volume that a cell can obtain. Above this, the volume will not be changed regardless of pressure.
    • min_volume (default value = 0) — Minimal equilibrium volume that a cell can obtain. Below this, the volume will not be changed regardless of pressure.
    • 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.
    • visc_threshold (default value = 0) — Threshold (pressure) at which the volume of the cell will starts viscously changing based upon the calculated volume pressure. This parameter is always positive.
  • 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.GlobalAreaPressureCmd()
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.
  • 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.GlobalVolumePressureCmd()
Compute total pressure per deformable body which is proportional to the difference between a set (or initial) target volume and the body’s actual volume. A decreased volume leads to a positive pressure. It is up to the user to ensure that when this command is executed, the volume of the body has been accurately set and calculated (e.g. using the Gauss theorem). It is also the responsibility of the user to use another command that translates this global force called volume_force to the degrees of freedom of the body.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • kv — Global volume conservation constant (for whole body): p_global = kv * (total_volume_eq - total_volume) / total_volume_eq.
    • 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)
    • internal_pressure (default value = 0) — Internal pressure (such as turgor pressure)
    • kvi (default value = 0) — Optional integrative term for global volume conservation. Setting this to non-zero would make this effectively a PI controller.The integrative gain = kv/kvi, hence kvi has units of time (lower = stiffer integrative control)If kvi is given, an array with name ‘volume_error_int’ should be present, and this array should be intialized to zero at the beginning of the simulation.
    • 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.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.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.