Model.create_batch_file#

Model.create_batch_file(element_size=0.0, element_type=0, feature_angle=0, pinholes_diameter=0, layers_around_holes=0, nodes_around_holes=0, beads_suppr_height=0, max_edge_fillets_radius=0)#

Use this function to set a limited set of cleanup parameters directly in the command file for use with Model.autotopocleanup(). Only a few automatic cleanup options are used; others are switched off or used with default parameters.

Parameters:
  • element_size (double) – The target mesh element size.

  • element_type (int) –

    Mesh element types:

    0 - triangle

    1 - quadrilateral

    2 - mixed

  • feature_angle (double) – Elements feature angle used for features definition.

  • pinholes_diameter (double) – Maximum diameter of the holes to be removed (filled).

  • layers_around_holes (int) – Target number of layers of quadrilateral elements around the round holes (usually it is 0, 1, 2).

  • nodes_around_holes (int) – Minimum number of nodes (element links) for round holes.

  • beads_suppr_height (double) – Maximum height of beads to be totally suppressed (removed).

  • max_edge_fillets_radius (double) – Maximum radius of edge fillets to be removed (converted to hard corners).

Example#

Perform topology cleanup of all displayed surfaces use element quality criteria from the file “ nvh10.criteria “ as well as the follow target cleanup parameters ( Element size - 10 mm , Element type - mixed , Element feature angle - 30 degrees , Remove holes with diameter less than 8 mm , Create 2 layers of quad elements around holes , Keep minimal 6 element links for the holes , Remove edge fillets with radius less than 9.0 mm )#
import hm
import hm.entities as ent

model = hm.Model()

model.create_batch_file(
    element_size=10.0,
    element_type=2.0,
    feature_angle=30.0,
    pinholes_diameter=8.0,
    layers_around_holes=2,
    nodes_around_holes=6,
    beads_suppr_height=9,
)

surf_collection = hm.CollectionByDisplayed(model, ent.Surface)

model.autotopocleanup(
    surfcollection=surf_collection, criteria_filename="nvh10.criteria"
)

Note

The cleanup parameters are deleted just after each use, so they must be set before every use.