Model.auto_elem_cleanup_new#

Model.auto_elem_cleanup_new(elem_collection, node_collection, feature_angle, criteria_file, ConsiderFailedElems_failed=0, ConsiderFailedElems_adjacent=0, ConsiderFailedElems_layers=0, FixFailedElements_mode=0, FixWarpageByNodeMove_mode=0, FixWarpageByNodeMove_tolerance=0.000000, KeepNonShellConnected_mode=0, PreserveFeatures=Collection(), QISmooth_mode=0, QISmooth_target=0.000000, QISmooth_move_shared=0, QISmooth_move_shared_tol=0.000000, QISmooth_move_free=0, QISmooth_move_free_tol=0.000000, ReduceTriaElements_reduce_trias=0, ReduceTriaElements_keep_edges=0, RemoveInverseElements_mode=0, RemoveInverseElements_angle=0.000000, SplitWarpedSkewedQuads_mode=0)#

Attempts to automatically improve the quality of failed elements using node movements and/or local remeshing, along with optional tria reduction.

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

  • node_collection (Collection) – The collection containing the any anchor node entities to preserve during cleanup.

  • feature_angle (double) – The angle used to define features. Valid values are 0-360, and 30 is a common value.

  • criteria_file (hwString) – The path to the criteria file. If the criteria are set using Model.setqualitycriteria(), the value dummy can be used as the criteria file name.

  • ConsiderFailedElems_failed (int) –

    This defines the elements affected by the cleanup. Valid values are:

    0 - Consider all elements.

    1 - Consider only failed elements.

  • ConsiderFailedElems_adjacent (int) –

    Used when ConsiderFailedElems_failed=1. Valid values are:

    0 - Do not consider adjacent elements to failed elements.

    1 - Consider adjacent elements to failed elements.

  • ConsiderFailedElems_layers (int) – The number of adjacent layers to consider. Used when ConsiderFailedElems_adjacent=1.

  • FixFailedElements_mode (int) –

    Indicates whether to use the QI-based re-meshing to cleanup elements. Valid values are:

    0 - Do not perform re-meshing.

    1 - Perform re-meshing.

  • FixWarpageByNodeMove_mode (int) –

    This defines the tria reduction mode. Valid values are:

    0 - Do not fix warped elements by normal node movement.

    1 - Fix warped elements by normal node movement.

  • FixWarpageByNodeMove_tolerance (double) – The maximum value a node is allowed to move normally to fix the warpage. Used when FixWarpageByNodeMove_mode=1.

  • KeepNonShellConnected_mode (int) –

    Indicates whether to maintain connectivity between 2D element edges shared with 1D and 3D elements during cleanup. Valid values are:

    0 - Do not maintain connectivity. Elements may become disconnected after cleanup.

    1 - Maintain connectivity.

  • PreserveFeatures (Collection) – The collection containing the 1D plot element entities.

  • QISmooth_mode (int) –

    Option defining the optimization of the quality. Valid values are:

    0 - Do not optimize quality.

    1 - Optimize quality.

  • QISmooth_target (double) – The QI target value to attempt to achieve.

  • QISmooth_move_shared (int) –

    Option defining how to move nodes across a shared edge. Valid values are:

    0 - Move nodes along shared edges only

    1 - Move nodes along and across shared edges

  • QISmooth_move_shared_tol (double) – The maximum amount a node is allowed to move across a shared edge when QISmooth_move_shared=1.

  • QISmooth_move_free (int) –

    Option defining how to move nodes across free edges. Valid values are:

    0 - Move nodes along free edges only.

    1 - Move nodes along and across free edges.

  • QISmooth_move_free_tol (double) – The maximum amount a node is allowed to ove across a free edge when QISmooth_move_free=1.

  • ReduceTriaElements_reduce_trias (int) –

    This defines the tria reduction options. Valid values are:

    0 - Do not perform tria reduction.

    1 - Perform tria reduction.

  • ReduceTriaElements_keep_edges (int) –

    Used when ReduceTriaElements_reduce_trias=1. Valid values are:

    0 - Do not preserve edges.

    1 - Preserve edges.

  • RemoveInverseElements_mode (int) –

    This indicates whether to split warped/split quads.

    0 - Do not remove.

    1 - Remove.

  • RemoveInverseElements_angle (double) – The inversion angle to consider.

  • SplitWarpedSkewedQuads_mode (int) –

    This indicates whether to split warped/split quads.

    0 - Do not split.

    1 - Split.

Example#

Auto correct all elements, using anchor node with ID 50, defining the criteria via a file, no preserved features, considering 7 adjacent layers, using remeshing and tria reduction#
import hm
import hm.entities as ent

model = hm.Model()

model.readqualitycriteria(file_name="c:/criteria/mycriteria.txt")

element_collection = hm.Collection(model, ent.Element)
node_anchor_collection = hm.Collection(model, ent.Node, [50])

model.auto_elem_cleanup_new(
    elem_collection=element_collection,
    node_collection=node_anchor_collection,
    feature_angle=15.0,
    criteria_file="dummy",
    PreserveFeatures=0,
    ConsiderFailedElems_failed=1,
    ConsiderFailedElems_adjacent=1,
    ConsiderFailedElems_layers=7,
    RemoveInverseElements_mode=1,
    RemoveInverseElements_angle=150.0,
    ReduceTriaElements_reduce_trias=1,
    ReduceTriaElements_keep_edges=1,
    FixFailedElements_mode=1,
    QISmooth_mode=1
    QISmooth_target=0.2,
    QISmooth_move_shared=0,
    QISmooth_move_shared_tol=0.0,
    QISmooth_move_free=0,
    QISmooth_move_free_tol=0.0,
    KeepNonShellConnected=0,
    SplitWarpedSkewedQuads_mode=1,
    FixWarpageByNodeMove_mode=0,
    FixWarpageByNodeMove_tolerance=0.0,
)