Model.addfacestocontactsurf#

Model.addfacestocontactsurf(name, elem_collection, node_collection, break_angle, reverse_normals, face_or_edge)#

Adds elements using the face/edge option to a contact surface.

Parameters:
  • name (hwString) – The name of the contact surface to update. User can directly supply a Python string.

  • elem_collection (Collection) – The collection containing the element entities to add.

  • node_collection (Collection) – The collection containing the node entities that define an edge or a face of an element.

  • break_angle (double) – The break angle for finding adjacent elements.

  • reverse_normals (int) –

    Create contact surface. Valid values are:

    0 - Along element normal.

    1 - Opposite element normal.

  • face_or_edge (int) –

    Create contact surface. Valid values are:

    0 - On edge.

    1 - On face.

Example#

Add elements with IDs 1 - 100 with faces defined by nodes with IDs 1 - 5 to contactsurf “ test “ with a break_angle of 30.0#
import hm
import hm.entities as ent

model = hm.Model()

# One-line version of collection using FilterByEnumeration
elem_col = hm.Collection(model, ent.Element, list(range(1, 101)))  # ID 1-100
node_col = hm.Collection(model, ent.Node, list(range(1, 6)))  # ID 1-5

model.addfacestocontactsurf(
    name="test",
    elem_collection=elem_col,
    node_collection=node_col,
    break_angle=30.0,
    reverse_normals=0,
    face_or_edge=1,
)