mpacts.commands.force.constraints. volumeconservation

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

import mpacts.commands.force.constraints.volumeconservation
#or assign it to a shorter name
import mpacts.commands.force.constraints.volumeconservation as vol
mpacts.commands.force.constraints.volumeconservation.AddVolumeConservation(SimOrCmdList, kv, mgr, triangle_mgr, node_mgr, normal_cmd, zero_parent_area_cmd, sum_area_parent_cmd, curvature_cmd, init_volume_eq=-1)

Finds or makes and returns the necessary commands for volume conservation with a ‘linear controller’. Returns:

  • command to reset volume to 0
  • command to calculate total volume
  • command to calculate the global volume pressure/force
  • command to calculate the individual node force from the global pressure
Parameters:
SimOrCmdList normally simulation object kv volume conservation proportinality constant mgr the parent PC of the nodes and the triangles triangle_mgr the array manager for triangles node_mgr the array manager for the nodes normal_cmd command to calculate triangle normals zero_parent_area_cmd setting total area to 0 sum_area_parent_cmd calculating total surface area curvature_cmd calculating local curvatures init_volume_eq equilibrium volume - if negative (default), the initial volume will be taken.
mpacts.commands.force.constraints.volumeconservation.AddVolumeConservationArrays(mgr, triangle_mgr, node_mgr)
mpacts.commands.force.constraints.volumeconservation.VolumeConservation(deformable_PC, triangle_PC, kv, SimOrCmdList=None, init_volume_eq=None, **kwargs)
Adds all necessary commands to the DeformableBodyPC ‘deformable_mgr’ with ‘triangle_mgr’.
Assumes (and checks) that Curvature (and therefore node-normals) are already being calculated correctly every time-step.
Parameters:
-deformable_PC the parent ParticleContainer of the nodes and the triangles
-triangle_PC the ParticleContainer for triangles
-kv volume conservation proportinality constant
-SimOrCmdList normally simulation object
-init_volume_eq
 equilibrium volume - if None (default), the initial volume will be taken.

-k_visc if given, we will create a ViscousVolumeChangeCmd, which also takes -visc_threshold as an (optional) argument.