Model.acm_create_mpc#

Model.acm_create_mpc(main_collection, secondary_collection, interface_collection, tolerance, behavior)#

Creates MPCs between selected main and secondary elements. It is extracted as a standalone functionality from the acoustic cavity mesher.

Parameters:
  • main_collection (Collection) – The collection containing the element entities belonging to the main body.

  • secondary_collection (Collection) – The collection containing the element entities belonging to the secondary body.

  • interface_collection (Collection) – The collection containing the component entities that define patched holes.

  • tolerance (double) – The maximum search distance to use for finding independent nodes for each dependent node.

  • behavior (double) –

    MPC creation behavior. Valid values are:

    0 - By proximity only.

    1 - By proximity and by intersection check with patched holes. Creates only those MPCs which intersect patched hole components.

    2 - By proximity and by intersection check with patched holes. Creates only those MPCs which do not intersect patched hole components.

Example#

Produce MPCs between main elems in component 813 , secondary elements in comp 816 , and patch elements in component 812 , using a tolerance of 50.0 and creating MPCs using behavior 2#
import hm
import hm.entities as ent

model = hm.Model()

# Collection containing elements of component ID 813
mainElCol = hm.Collection(
    model, ent.Element, hm.Collection(model, ent.Component, [813])
)

# Collection containing elements of component ID 816
secElCol = hm.Collection(
    model, ent.Element, hm.Collection(model, ent.Component, [816])
)

# Collection containing component ID 812
patchElComp = hm.Collection(
    model, ent.Component, [812]
)

model.acm_create_mpc(
    main_collection=mainElCol,
    secondary_collection=secElCol,
    interface_collection=patchElComp,
    tolerance=50.0,
    behavior=2,
)