Model.automesh_params#

Model.automesh_params(mapmethod=0, smoothmethod=1, mindensity=1, mindensitycurvratio=0.0, mindensitylength=0.0, triamapflow=-2)#

Set 2D meshing parameters on edges and faces. This must be called before 2D meshing functions. After executing the 2D meshing functions, the parameters defined in this function are restored to their default values.

Parameters:
  • mapmethod (int) –

    Defines the method to map nodes between opposite edges of rectangular shaped surfaces:

    0 - Auto decide (default)

    1 - Force map to use parametric lengths. Generally useful when the number and biasing of nodes on opposite edges are similar in order to make more regular mesh flow lines.

    2 - Force map to use arc lengths. Generally useful for constant size meshing with unaligned density and biasing on opposite edges to make more regularly shaped elements.

  • smoothmethod (int) –

    Defines the smoothing method to be used in the meshing function. Useful prior to calling automatic meshing. Valid values are:

    0 - None

    1 - Auto-decide (default)

    2 - Size corrected

    3 - Shape corrected

    4 - Angle corrected

  • mindensity (int) – Assign a minimum density on edges. This will ensure a minimum number of nodes even for small edges.

  • mindensitycurvratio (double) – The ratio of the curved edge length to the length of a straight segment between edge ends, where mindensity will be applied.

  • mindensitylength (double) – The threshold for edge length to split only small edges, where mindensity will be applied.

  • triamapflow (int) –

    Defines additional method for meshing triangular-shaped surfaces. Standard tria map method is used if not specified. Valid values are:

    -1 - Tria Map center mode

    0 - Tria Map corner mode with automatic corner selection

    > 0 - Tria Map corner mode with the selection of vertex ID (for geometry mesh) or node ID (for element mesh).

Example#

Set several 2D meshing options#
import hm
import hm.entities as ent

model = hm.Model()

mc_col = hm.Collection(model, ent.Meshcontrol)

model.automesh_params(
    mindensity=2,
    mindensitylength=0.2,
    mindensitycurvratio=1.1,
    mapmethod=1,
    triamapflow=0,
    smoothmethod=2,
)