mpacts.commands.geometry. submergedvolume

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

import mpacts.commands.geometry.submergedvolume
#or assign it to a shorter name
import mpacts.commands.geometry.submergedvolume as sub

ComputeSubmergedVolumeQuadPolyhedronCommand

class mpacts.commands.geometry.submergedvolume.ComputeSubmergedVolumeQuadPolyhedronCommand

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

Command to compute the ‘submerged volume’ of a closed shape composed of quads. The algorithm is based on the computation of the signed volume of an n-sided (here 4) truncated (with the surface) prism for each n-gon (quad). If the normal of the quad aligns with the surface normal, the negative volume is added, while if the volume is opposite to the surface normal, a positive volume contribution is added. The sum of all contributions of each quad guarantees an accurate (up to numerical precision of the prism volume) estimation of the submerged volume of a any closed surface mesh.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
    • x — Positions of the nodes/controlPoints of the submerged solid body
  • 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.
    • surface_normal (default value = 0 1 0) — Unit normal vector of the liquid-void interface, pointing towards the void phase. Default = (0,1,0)
    • surface_origin (default value = 0 0 0) — Any point on the liquid-void interface. Default = (0,0,0)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, x, [gate, predicate, surface_origin, surface_normal]
ComputeSubmergedVolumeQuadPolyhedronCommand(name, parent, **kwargs)

ComputeSubmergedVolumeSimonAttempt

class mpacts.commands.geometry.submergedvolume.ComputeSubmergedVolumeSimonAttempt

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

Experimental do not use!
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • heightmap — LUT representing the surface, the lookup value is supposed to be the height at that X,Y, coordinate
    • 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, heightmap, [gate, predicate]
ComputeSubmergedVolumeSimonAttempt(name, parent, **kwargs)

ComputeSubmergedVolumeSphereCommand

class mpacts.commands.geometry.submergedvolume.ComputeSubmergedVolumeSphereCommand

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

Command to compute the submerged volume, area and center of mass of spheres. The algorithm computes the volume as well as the surface area of each spherical cap defined by the surface level and the sphere.
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.
    • surface_normal (default value = 0 1 0) — Unit normal vector of the liquid-void interface, pointing towards the void phase. Default = (0,1,0)
    • surface_origin (default value = 0 0 0) — Any point on the liquid-void interface. Default = (0,0,0)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate, surface_origin, surface_normal]
ComputeSubmergedVolumeSphereCommand(name, parent, **kwargs)

ComputeSubmergedVolumeTriangulatedPolyhedronCommand

class mpacts.commands.geometry.submergedvolume.ComputeSubmergedVolumeTriangulatedPolyhedronCommand

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

Command to compute the ‘submerged volume’ of a triangulated closed shape. The algorithm is based on the computation of the signed volume of an n-sided (here 3) truncated (with the surface) prism for each n-gon (triangle). If the normal of the triangle aligns with the surface normal, the negative volume is added, while if the volume is opposite to the surface normal, a positive volume contribution is added. The sum of all contributions of each triangle guarantees an accurate (up to numerical precision of the prism volume) estimation of the submerged volume of a any closed surface mesh. It can be verified that this algorithm returns near-identical results as ComputeVolumeCommand for a fully submerged triangulated body.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
    • x — Positions of the nodes/controlPoints of the submerged solid body
  • 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.
    • surface_normal (default value = 0 1 0) — Unit normal vector of the liquid-void interface, pointing towards the void phase. Default = (0,1,0)
    • surface_origin (default value = 0 0 0) — Any point on the liquid-void interface. Default = (0,0,0)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, x, [gate, predicate, surface_origin, surface_normal]
ComputeSubmergedVolumeTriangulatedPolyhedronCommand(name, parent, **kwargs)

NodeDragAttempt

class mpacts.commands.geometry.submergedvolume.NodeDragAttempt

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

Experimental do not use!
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • cd — Drag coefficient thingie
    • heightmap — LUT representing the surface, the lookup value is supposed to be the height at that X,Y, coordinate
    • pc — Particle container on which the command is applied
    • velocitymap — LUT representing the velocity at the surface, the lookup value is supposed to be the velocity at that X,Y, coordinate
  • 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, heightmap, velocitymap, cd, [gate, predicate]
NodeDragAttempt(name, parent, **kwargs)