Model.setredoconnectparams#

Model.setredoconnectparams(mesh_side, num_layers)#

Specifies parameters for redo connectivity element remeshing.

Use of this function implies that it will be followed by a function that performs remeshing/meshing by elements with redo option selected.

Parameters:
  • mesh_side (int) –

    Flag indicating where the transition from existing element density to selected density occurs:

    0 - Transition starts at border formed by selected elements and goes num_layers outside (default)

    1 - Transition starts at border formed by selected elements and goes num_layers inside

  • num_layers (int) – The number of layers for transitioning from existing element density to selected density. (default = 2)

Examples#

Remesh the elements with IDs 1 - 40 , redo connectivity option selected and transition from current element size to element size of 10.0 occur in two layers of elements outside the border formed by selected elements#
import hm
import hm.entities as ent

model = hm.Model()

# Creating a collection that contains the elements with IDs 1-40
filter_elements = hm.FilterByEnumeration(ent.Element, list(range(1, 41)))
elements_collection = hm.Collection(model, filter_elements)

model.setredoconnectparams(mesh_side=0, num_layers=2)

model.defaultmeshelems(
    collection=elements_collection,
    elem_size=10.0,
    elem_type=2,
    elem_type_2=2,
    comp_mode=0,
    size_control=1,
    skew_control=1,
    edge_mesh_type=1,
    min_size=0.0,
    max_size=0.0,
    max_deviation=0.0,
    max_angle=0.0,
    previous_settings=3,
    vertex_angle=30.0,
)
Remesh the elements with IDs 1 - 40 , redo connectivity option selected and transition from current element size to element size of 4.0 occur in three layers of elements inside the border formed by selected elements#
import hm
import hm.entities as ent

model = hm.Model()

# Creating a collection that contains the elements with IDs 1-40
filter_elements = hm.FilterByEnumeration(ent.Element, list(range(1, 41)))
elements_collection = hm.Collection(model, filter_elements)

model.setredoconnectparams(mesh_side=1, num_layers=3)

model.defaultmeshelems(
    collection=elements_collection,
    elem_size=4.0,
    elem_type=2,
    elem_type_2=2,
    comp_mode=0,
    size_control=1,
    skew_control=1,
    edge_mesh_type=1,
    min_size=0.0,
    max_size=0.0,
    max_deviation=0.0,
    max_angle=0.0,
    previous_settings=3,
    vertex_angle=30.0,
)