Model.fill_fe_holes#

Model.fill_fe_holes(mode, collection, max_width, AdjacentComp=0, ByFeature=0, CurvedFill=0, DefineMaxWidth=0, GuideNodePairs=s_defaultEntityList2, Remesh=0)#

Fills FE holes by automatic or manual detection.

Parameters:
  • mode (int) –

    The mode to identify FE holes:

    0 - Do automatic hole detection using elements on collection.

    1 - Do manual hole detection using nodes on collection. The nodes should be part of a free boundary.

    2 - Do manual hole detection using given the closed 1D elements on collection.

  • collection (Collection) – The collection containing the entities.

  • max_width (double) – Maximum allowed hole width.

  • AdjacentComp (unsigned int) –

    0 - Fill elements should be created in a new component.

    1 - Fill elements should be created in the adjacent component.

    2 - Fill elements should be created in the current component.

  • ByFeature (unsigned int) –

    0 - Features should not be considered.

    1 - Features should be considered.

  • CurvedFill (unsigned int) –

    0 - Gaps are filled without taking into consideration the shape of adjacent elements.

    1 - Gaps are filled taking into consideration the shape of adjacent elements, ensuring a smooth fill.

  • DefineMaxWidth (unsigned int) –

    0 - Ignore max_width for hole filling.

    1 - Consider max_width for hole filling.

  • GuideNodePairs (EntityList2) – Specifies an optional list of node IDs in the form “M1 M2 N1 N2 O1 O2 …” where (M1, M2), (N1, N2) and (O1, O2) are node pairs. These pairs are used to divide the gap to be filled into smaller loops. When provided, gaps are filled ensuring that the loops are split at the specified pairs. This aids in filling complex hole shapes by guiding the filling process correctly.

  • Remesh (unsigned int) –

    0 - Fill elements should not be remeshed.

    1 - Fill elements should be remeshed.

Examples#

Fill the holes defined by the closed 1D elements 10-30, using a max width of 20.5, remeshing filled elements, and create the elements in the adjacent component#
import hm
import hm.entities as ent

model = hm.Model()

elems = hm.Collection(model, ent.Element, list(range(10,31)))

model.fill_fe_holes(
      mode=1,
      collection=elems,
      max_width=20.5,
      AdjacentComp=1,
      DefineMaxWidth=1,
      Remesh=1
)
Smoothly fill a feature hole using a set of nodes#
import hm
import hm.entities as ent

model = hm.Model()

nodes = hm.Collection(model, ent.Node, list(range(12,27)))

model.fill_fe_holes(
      mode=1,
      collection=elems,
      max_width=20.5,
      ByFeature=1,
      CurvedFill=1,
      DefineMaxWidth=1,
      Remesh=1
)
Fill a feature hole using guide pairs (12,18) and (25,13)#
import hm
import hm.entities as ent

model = hm.Model()

nodes = hm.Collection(model, ent.Node, list(range(12,27)))

nodeList = [
      [ent.Loadcol(model, 12), ent.Loadcol(model, 18)],
      [ent.Loadcol(model, 25), ent.Loadcol(model, 13)],
]

model.fill_fe_holes(
      mode=1,
      collection=elems,
      max_width=20.5,
      ByFeature=1,
      CurvedFill=1,
      DefineMaxWidth=1,
      GuideNodePairs=nodeList,
      Remesh=1
)