Model.equivalence#

Model.equivalence(collection, tolerance, mode, location, numbering, equivalence_to_meshnodes=0)#

Equivalences or finds duplicate nodes of selected components or elements within a tolerance.

Parameters:
  • collection (Collection) – The collection containing the imput entities.

  • tolerance (double) – The tolerance used to find neighboring nodes to equivalence.

  • mode (int) –

    Operating mode of the function:

    0 - Preview found nodes.

    1 - Equivalence found nodes.

    3 - Place found nodes on user mark.

  • location (int) –

    Location of equivalenced nodes:

    0 - Equivalence at the location of the node with the lowest ID.

    1 - Equivalence at the location of the node with the highest ID.

    2 - Equivalence at the midpoint of the two nodes.

  • numbering (int) –

    The numbering of the retained node:

    0 - Retain the number of the node with the lowest ID.

    1 - Retain the number of the node with the highest ID.

  • equivalence_to_meshnodes (int) –

    Optional. The equivalencing to mesh nodes:

    0 - Retain the behavior with the location and numbering argument (default).

    1 - Ignore location and numbering argument. If one temporary node and a mesh node are to be equivalenced, always equivalence to mesh nodes and delete the temporary nodes, which are equivalenced.

Examples#

Equivalence the nodes of all displayed components , use a tolerance of 0.1 and keep the location and number of the lowest ID nodes#
import hm
import hm.entities as ent

model = hm.Model()

comps =  hm.CollectionByDisplayed(model, ent.Component)

model.equivalence(
    collection=comps,
    tolerance=0.1,
    mode=1,
    location=0,
    numbering=0,
    equivalence_to_meshnodes=0)
Equivalence nodes with IDs 1 - 100 , use a tolerance of 0.1 and keep the location and number of the lowest ID nodes#
import hm
import hm.entities as ent

model = hm.Model()

nodes =  hm.Collection(model, ent.Node, list(range(1, 101)))

model.equivalence(
    collection=nodes,
    tolerance=0.1,
    mode=1,
    location=0,
    numbering=0,
    equivalence_to_meshnodes=0
)