Model.defaultmeshelems#

Model.defaultmeshelems(collection, elem_size, elem_type, elem_type_2, comp_mode, size_control, skew_control, edge_mesh_type, min_size, max_size, max_deviation, max_angle, previous_settings, vertex_angle)#

Meshes a selection of elements using saved or default parameters and various options.

Parameters:
  • collection (Collection) – The collection containing the element entities to mesh.

  • elem_size (double) – The default element size used to calculate element densities along edges (when necessary).

  • elem_type (int) –

    Flag indicating the elements generated for mapped meshing algorithms. Valid values are:

    0 - trias

    1 - quads

    2 - mixed

    3 - right trias

    4 - quads only

  • elem_type_2 (int) –

    Flag indicating the elements generated for free meshing algorithms. Valid values are:

    0 - trias

    1 - quads

    2 - mixed

    3 - right trias

    4 - quads only

  • comp_mode (int) –

    Parameter specifying how entities are organized into components:

    0 - Elements are created in the current component. Boundaries between components are not maintained when remeshing.

    1 - Elements are created in the same components as the source elements. Boundaries between components are maintained when remeshing.

  • size_control (int) –

    Flag indicating whether to create uniformly sized elements. Valid values are:

    0 - Do not create uniformly sized elements.

    1 - Create uniformly sized elements.

  • skew_control (int) –

    Flag indicating whether to create optimally shaped elements when using mapping

    algorithms. Valid values are:

    0 - Do not create optimally shaped elements.

    1 - Create optimally shaped elements.

  • edge_mesh_type (int) –

    Determines the algorithm for edge meshing:

    1 - Standard edge meshing.

    2 - Chordal deviation edge meshing.

    11 - Standard edge meshing with flow “align” control.

    12 - Chordal deviation edge meshing with flow “align” control.

    14 - Standard edge meshing with flow “align” and “size” control.

  • min_size (double) – Minimum edge size for chordal deviation edge meshing. Ignored, if edge_mesh_type is not set to 2 or 12.

  • max_size (double) – Maximum edge size for chordal deviation edge meshing. Ignored, if edge_mesh_type is not set to 2 or 12.

  • max_deviation (double) – Maximum deviation for chordal deviation edge meshing. Ignored, if edge_mesh_type is not set to 2 or 12.

  • max_angle (double) – Maximum angle value (in degrees) between edges for chordal deviation edge meshing. Ignored, if edge_mesh_type is not set to 2 or 12.

  • previous_settings (int) –

    Flag indicating whether to break, keep or redo connectivity between neighboring surfaces. Valid values are:

    0 - Keep previous settings and do not break connectivity between neighboring surfaces.

    1 - Break connectivity between neighboring surfaces.

    2 - Keep connectivity between neighboring surfaces.

    3 - Redo connectivity between neighboring surfaces by expanding surface selection by one layer of adjacent surfaces.

  • vertex_angle (double) – When the vertex between two edges exceeds this value, a new node is created to form a vertex. Thus, using high values results in fewer nodes on curved edges, and therefore less-accurate edge approximation. A standard value is vertex_angle=30.0.

Example#

Mesh all elements with a first order mixed mesh of size 4.5 , maintain the original components , with size and skew control , with flow and alignment control , keep the exist connectivity , a vertex angle of 25 , and automatically detect connected features with a feature angle of 20#
import hm
import hm.entities as ent

model = hm.Model()

hm.setoption(element_order=1)
hm.setoption(feature_angle=20)
model.setusefeatures(mode=3)

inp_col = hm.Collection(model, ent.Element)
model.defaultmeshelems(
    collection=inp_col,
    elem_size=4.5,
    elem_type=2,
    elem_type_2=2,
    comp_mode=1,
    size_control=1,
    skew_control=1,
    edge_mesh_type=14,
    min_size=0.0,
    max_size=0.0,
    max_deviation=0.0,
    max_angle=0.0,
    previous_settings=2,
    vertex_angle=25,
)