Model.cadwrapper#

Model.cadwrapper(collection, param_str, graphicsDB)#

Wraps the input entities and provides additional functionalities to remove nodes, fix quality, or split tria elements.

Parameters:
  • collection (Collection) – The collection containing the input entities. Valid entities are elements and FE surfaces.

  • param_str (hwString) –

    The string defining which operation to perform and the corresponding parameters.

    To remove internal nodes from selected elements:

    "tri: rmnodes"

    To fix quality:

    "rmx2d: angle=<value> prx=<value> ar=<value> szmin=<value> clsfy2d"

    To wrap input:

    "wrap2d: combo=<value> angle=<value> prx=<value> ar=<value> szmin=<value> clsfy2d leak=<value> sz2rm=<value> iter=<value>"

    The options description is:

    • angle

    Fix dihedral angle elements below defined angle.

    • prx

    Fix proximity elements below defined value.

    • ar

    Fix aspect ratio above defined value.

    • szmin

    Fix elements below edge length below defined value.

    • clsfy2d

    Include this string if patch elements in gap needs to be organized in neighboring components, otherwise those will be placed in new component.

    • iter

    Number of iterations for fixes.

    "iter = 0" - Only topological fixes are applied

    0 < "iter" < 99 - Topological fixes and mesh level fixes are applied

    99 < "iter" < 200 - Topological fixes, mesh level fixes and reruns of wrapping are applied

  • graphicsDB (int) – Internal parameter. Always set to 0.

Example#

Wrap the input entities#
import hm
import hm.entities as ent

model = hm.Model()

element_collection = hm.Collection(model, ent.Element)

model.cadwrapper(
    collection=element_collection,
    param_str="wrap2d: combo=1 ar=100 angle=2 sz2rm=20 sz2split=20 clsfy2d iters=99",
    graphicsDB=0,
)