Model.morphconstraintupdatedof#

Model.morphconstraintupdatedof(collection, dof1, dof2, dof3, system_entity, options, entity, color)#

Creates a constraint which fixes one or more translational degrees of freedom for the selected nodes relative to either the global coordinate system or a specified local coordinate system.

A degree of freedom for a coordinate system is one of the three translational directions. For a rectangular coordinate system the three degrees of freedom are along each axis: the x-axis, the y-axis, and the z-axis. For a cylindrical coordinate system the three degrees of freedom are in the radial direction, the theta direction, and the z direction. For example, for a rectangular coordinate system, if the y-axis degree of freedom is fixed for a node, it will be allowed to move only in the x and z directions, remaining in a plane perpendicular to the y axis. Similarly, for a cylindrical coordinate system, if the theta degree of freedom is fixed for a node, it can move only in the radial and z directions. Note that fixing the radial and z degrees of freedom for a cylindrical coordinate system will force a node to move in a circle about the axis of that system.

Parameters:
  • collection (Collection) – The collection containing the node entities to be constrained.

  • dof1 (int) –

    0 - Allow the nodes to move in the x (or radial) direction

    1 - Constrain the nodes from moving in the x (or radial) direction

  • dof2 (int) –

    0 - Allow the nodes to move in the y (or theta) direction

    1 - Constrain the nodes from moving in the y (or theta) direction

  • dof3 (int) –

    0 - Allow the nodes to move in the z direction

    1 - Constrain the nodes from moving in the z direction

  • system_entity (Entity) – The system entity.

  • options (int) –

    0 - Does not affect nodes near constrained nodes

    1 - Enable mesh stretching around constrained nodes

  • entity (Entity) – The morph constrained entity to update.

  • color (int) – The color of the constraint. Valid values are 1-64.

Example#

Update a DOF constraint with ID 12 for nodes with IDs 1 - 100 in the radial direction of a local cylindrical coordinate system with ID 5 and with mesh stretching enabled#
import hm
import hm.entities as ent

model = hm.Model()

model.morphconstraintupdatedof(
    collection=hm.Collection(model, ent.Node, list(range(1, 101))),
    dof1=1,
    dof2=0,
    dof3=0,
    system_entity=ent.System(model, 5),
    options=1,
    entity=ent.Morphconstraint(model, 12),
    color=22,
)