Model.refine_by_patterns#

Model.refine_by_patterns(collection, node, auto_transition, refine_zone_height, refine_zone_length, refine_zone_size, refine_zone_width, squeez, transition_zone_height, transition_zone_length, transition_zone_width, system=Entity())#

Refines a zone elements using an all quad pattern. The zone is described by a refinement box and center node. The refined mesh is then connected to the existing mesh using an all quad pattern through the transition zone, described by a transition box.

The refinement box will contain the refined elements, while the region between the refinement box and the transition box will contain quads patterns used to transition between the refined mesh and base mesh size.

Parameters:
  • collection (Collection) – The collection containing the element entities. Generally, it is best to select displayed elements and allow the proper elements within the box to be selected internally.

  • node (Entity) – The object describing the node entity that defines the center of the refinement box.

  • auto_transition (int) – Currently unused and should be set to 0.

  • refine_zone_height (double) – Defines the height of the refinement zone.

  • refine_zone_length (double) – Defines the length of the refinement zone.

  • refine_zone_size (double) – Defines the mesh size within the refinement zone.

  • refine_zone_width (double) – Defines the width of the refinement zone.

  • squeez (int) – Currently unused and should be set to 1.

  • transition_zone_height (double) – Defines the height of the transition zone.

  • transition_zone_length (double) – Defines the length of the transition zone.

  • transition_zone_width (double) – Defines the width of the transition zone.

  • system (Entity) – The object describing the entity of the local coordinate system to which the zones are oriented. A default of None (global system) is used if not specified.

Example#

Refine elements around node 60.0 with refinement size 1.0 using a refinement box of dimension (10.0,15.0,20.0) and transition box of dimension (40.0,50.0,45.0)#
import hm
import hm.entities as ent

model = hm.Model()

model.refine_by_patterns(
    collection=hm.Collection(model, ent.Element),
    node=ent.Node(model, 60),
    refine_zone_size=1.0,
    auto_transition=0,
    transition_zone_length=40.0,
    transition_zone_width=50.0,
    transition_zone_height=45.0,
    refine_zone_length=10.0,
    refine_zone_width=15.0,
    refine_zone_height=20.0,
    squeez=0,
)