Model.associate_nodes_to_geom#

Model.associate_nodes_to_geom(mesh_entity_collection, manual_association, assoc_tol, snap_tol, snap_nodes, override_assoc, geom_entity=Collection())#

Associates source nodes to target geometry using either a manual or automatic option.

Parameters:
  • mesh_entity_collection (Collection) – The collection containing the source entities. Valid entities are nodes and elements. If elements are selected, all the nodes of the elements will be considered for association.

  • manual_association (int) –

    Enables manual association. With automatic association, nodes will be automatically associated with the matching geometry. With manual association, user must select a single geometry and the selected nodes will be associated to that geometry. By default, manual association will override the existing association. Valid options are:

    0 - Automatic

    1 - Manual

  • assoc_tol (double) – The tolerance used for both automatic and manual association. Only nodes which fall within this tolerance of the geometry will be associated. It is recommended to generally keep this tolerance high.

  • snap_tol (double) – Tolerance used for manual association to snap nodes within this tolerance to points to boundary geometry when associating to lines, surfaces, and solids. For example, when associating to a line, the selected nodes within the snap tolerance will be associated to end points of the lines.

  • snap_nodes (int) –

    Enables moving nodes to their initial geometry location when associated. Valid options are:

    0 - Disabled

    1 - Enabled

  • override_assoc (int) –

    Enables overriding the existing association. If disabled, selected nodes with existing initial association will be skipped for new association. It is recommended to keep this option disabled for automatic association. Valid options are:

    0 - Disabled

    1 - Enabled

  • geom_entity_collection (Collection) – The collection of geometry entities to which the nodes must be associated. Valid values are points, lines, surfs and solids. This option is only required for manual_association=1. Only a single point, line, surface or solid must be selected for manual association.

Examples#

Automatically associating all nodes in the model#
import hm
import hm.entities as ent

model = hm.Model()

elem_col = hm.Collection(model, ent.Element)

model.associate_nodes_to_geom(
    mesh_entity_collection=elem_col,
    manual_association=0,
    assoc_tol=10.0,
    snap_tol=0.1,
    snap_nodes=0,
    override_assoc=1,
)
Manually associating nodes with ID 24 and 23 to line with ID 17#
import hm
import hm.entities as ent

model = hm.Model()

node_col = hm.Collection(model, ent.Node, [24, 23])
geom_col = hm.Collection(model, ent.Line, [17])

model.associate_nodes_to_geom(
    mesh_entity_collection=node_col,
    manual_association=0,
    assoc_tol=10.0,
    snap_tol=0.1,
    snap_nodes=0,
    override_assoc=1,
    geom_entity_collection=geom_col,
)