Model.tetmesh_set_input#

Model.tetmesh_set_input(collection1, mode1, collection2, mode2)#

Supplies additional input to tetmesh().

For the special case that both inputs are inactive, this function clears selections from all previous calls to tetmesh() and Model.tetmesh_set_input(). This is normally not necessary since such cleanup is normally done at the end of each call to tetmesh().

Parameters:
  • collection1 (Collection) – The collection containing the first entities. Valid entities are nodes, elements, components, surfaces and solids. If collection1 is empty then it is considered inactive input.

  • mode1 (int) –

    -1 - Ignored (inactive input)

    0 - Float without boundary layer

    1 - Fixed without boundary layer

    2 - Float with boundary layer

    3 - Fixed with boundary layer

    4 - Size control boxes

    5 - Anchor nodes

    6 - 3D re-mesh

    7 - 3D re-mesh with free boundary swappable-float

    8 - 3D re-mesh with free boundary remeshable-float

    9 - Remeshable-float without BL

    10 - Remeshable-float with BL

    11 - Elem input for fluid volume selection. Either touched (or normal pointed into) are fluid volumes

  • collection2 (Collection) – The collection containing the second entities. Valid entities are nodes, elements, components, surfaces and solids. If collection2 is empty then it is considered inactive input.

  • mode2 (int) –

    -1 - Ignored (inactive input)

    0 - Float without boundary layer

    1 - Fixed without boundary layer

    2 - Float with boundary layer

    3 - Fixed with boundary layer

    4 - Size control boxes

    5 - Anchor nodes

    6 - 3D re-mesh

    7 - 3D re-mesh with free boundary swappable-float

    8 - 3D re-mesh with free boundary remeshable-float

    9 - Remeshable-float without BL

    10 - Remeshable-float with BL

    11 - Elem input for fluid volume selection. Either touched (or normal pointed into) are fluid volumes

Example#

Add input for tetmesh()#
import hm
import hm.entities as ent

model = hm.Model()

# Create Tetramesh
elements_col = hm.Collection(model, ent.Element, populate=False)
str_array = ["tet: 35 1.3 -1 0.014 0.8 0 0 1"]

comps_list_input_tetmesh = [
    comp
    for comp in hm.Collection(model, ent.Component)
    if comp.name in ("^elem_size_ctrl_0.1", "^elem_size_ctrl_0.5")
]
comps_col_input_tetmesh = hm.Collection(comps_list_input_tetmesh)
model.tetmesh_set_input(collection1=comps_col_input_tetmesh,mode1=4,collection2=hm.Collection(model,ent.Element,populate=False),mode2=-1)

col1_tet=hm.Collection(model,ent.Component,"name=float_shells")
col2_tet=hm.Collection(model,ent.Component,"name=fixed_shells")
model.tetmesh(
    collection1=col2_tet,
    mode1=0,
    collection2=col1_tet,
    mode2=1,
    string_array=str_array,
)