Model.setusefeatures#

Model.setusefeatures(mode)#

Specifies the mode for defining and using feature edges for element-based re-meshing.

Parameters:

mode (int) –

The mode for defining and using feature edges for element-based re-meshing. Valid values are:

0 - Feature edges will be auto-detected using the simple feature detection algorithm (as in the Features panel). The feature angle is set using hm.setoption(feature_angle=<value>).

1 - The selected collection of 1D plot elements will be used to form feature edges. This is also useful for using the Features panel to detect and manually edit features. The elements are specified using Model.elementsaddelemsfixed().

3 - Feature edges will be auto-detected by specifying the connected feature detection algorithm. The feature angle is set using hm.setoption(feature_angle=<value>).

7 - Use associated surface edges.

8 - Feature edges will be auto-detected by specifying the connected feature detection algorithm, keeping 1D elements which are part of 2D mesh edges and existing FE edges with nodes already associated to surface edges.

9 - Feature edges will be created from the selected collection of 1D plot elements, keeping 1D elements which are part of 2D mesh edges and existing FE edges with nodes already associated to surface edges.

Example#

Remeshe the displayed elements and keep lines formed by plot elements with IDs 1600 - 2220#
import hm
import hm.entities as ent

model = hm.Model()

remesh_elems_col = hm.CollectionByDisplayed(model, ent.Element)
model.setusefeatures(mode=1)
oneD_elems_col = hm.Collection(model, ent.Element, list(range(1600, 2221)))

model.elementsaddelemsfixed(collection=oneD_elems_col)

model.defaultremeshelems(
    collection=remesh_elems_col,
    elem_size=3.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=0,
    vertex_angle=30,
)
Remeshe the displayed elements with auto detected feature edges with a feature angle of 80 degrees#
import hm
import hm.entities as ent

model = hm.Model()

remesh_elems_col = hm.CollectionByDisplayed(model, ent.Element)
model.setusefeatures(mode=0)
hm.setoption(feature_angle=80.0)

model.defaultremeshelems(
    collection=remesh_elems_col,
    elem_size=3.0,
    elem_type=2,
    elem_type_2=2,
    comp_mode=1,
    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=2,
    vertex_angle=30,
)