mpacts.commands.geometry. curvature

This module contains specialized versions of curvature calculation

Attention

Usually, you will want to use the ‘regular’ ComputeCurvatureCommand, which can be found as mpacts.commands.geometry.triangle.ComputeCurvatureCommand.

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

import mpacts.commands.geometry.curvature
#or assign it to a shorter name
import mpacts.commands.geometry.curvature as cur
mpacts.commands.geometry.curvature.CalculateCurvatureOnce(node_mgr, triangle_mgr, min_radius, max_radius, save_to_nodes=False)

Compute Curvature of a given triangle manager only once, and do it right now. After this function has finished, all arrays that are only needed for the curvature computation are automatically cleared and removed.

Parameters:
  • node_mgr – ArrayManager containing the nodes of the triangles of which the curvature should be computed
  • triangle_mgr – ArrayManager containing the triangles of which the curvature should be computed
  • max_radius (float) – to be passed to ComputeCurvatureCommand as maximal_radius
  • min_radius (float) – to be passed to ComputeCurvatureCommand as minimal_radius
  • save_for_nodes (bool) – to be passed to ComputeCurvatureCommand
mpacts.commands.geometry.curvature.ComputeCurvatureOfMesh(x, vil, min_radius=0, max_radius=None, save_to_nodes=False)

Thin wrapper around CalculateCurvatureOnce() to compute to curvature of a mesh with positions x and vertexIndices vil.

Parameters:
  • x – list of mesh positions
  • vil – list of ‘triangles’ refering to nodes in x

Returns a list of computed curvatures.

ComputeCurvatureOnceCommand

class mpacts.commands.geometry.curvature.ComputeCurvatureOnceCommand(name, sim, node_mgr, triangle_mgr, x, maximal_radius, minimal_radius=0, enforce_positive=False)

Bases: mpacts.core.command.PythonCommand

Command to compute the curvature for a given node and triangle manager only once. This command differs from simply setting gate=ExecuteOnce in a regular mpacts.commands.geometry.triangle.ComputeCurvatureCommand in that it also clears and removes all additional arrays that are only needed for curvature calculation.

Parameters:
  • name (str) – Name of the command
  • sim – Root of the simulation tree
  • node_mgr – ArrayManager containing the nodes of the triangles of which the curvature should be computed
  • triangle_mgr – ArrayManager containing the triangles of which the curvature should be computed
  • x – Array containing the positions of the triangle corners :param float maximal_radius: to be passed to ComputeCurvatureCommand
  • minimal_radius (float) – to be passed to ComputeCurvatureCommand
  • enforce_positive (bool) – : to be passed to ComputeCurvatureCommand
ComputeCurvatureOnceCommand(name, parent, **kwargs)
execute()

tmpKeeper

class mpacts.commands.geometry.curvature.tmpKeeper

Bases: object

tmpKeeper(name, parent, **kwargs)
check_or_add(mgr, type_str, name, keep=False)
clear_tmps()