Model.split_hex_continuum#

Model.split_hex_continuum(node_array, collection, layers, growth_rate, action, component)#

Split solid element layers of any type through all edges that are topologically parallel to the selected edges while maintaining connectivity and associativity. The propagation is mostly occurring for hex/quad elements splitting along given topological directions.

Parameters:
  • node_array (hwIntList) –

    The list containing the IDs of the nodes.

    Each pair of nodes represents a directed element edge (action < 3) or quad diagonal (action ≥ 3). Any node pair that is not an element edge is ignored. Any node that is not on the input elements is an error.

    For action < 3, the action, input node array and the input elems uniquely define the elements continuum (call it “action elements”) that the action is to be operated on.

  • collection (Collection) – The collection containing the element entities that are candidates to split. Valid entities are components and elements. An empty collection means all elements are candidates. Note, if not all elements are candidates for split, the connectivity may break in the resulting mesh.

  • layers (int) – The number of layers (> 2) to split. Used only for action=0.

  • growth_rate (double) – The common ratio of thicknesses of consecutive split layers. 1.0 means constant layer thickness. Used only for action=0.

  • action (int) –

    -1 - Preview the “action elements” by masking away “non-action elements”.

    -2 - Preview to-be combined elements by masking away all other elements.

    0 - Split “action elements” along topological parallels of the input element edges

    1 - Delete the “action elements”

    2 - Combine “action elements” to the next layer of existing elements indicated by the direction of each input edge. If not combinable, exit with error.

    ≥ 3 - Internally call the legacy split function Model.propagatesplithexas() with split_type=action-2 and looping through all pairs of input nodes.

    Each input node pair should represent a diagonal of quad face of hex. The “action elements” per node pair are a chain of hexes connected by the topologically parallel quad faces starting from the face represented by the input node pair. In the resulting mesh, element connectivity may break and association may not be maintained.

  • component (int) –

    0 - New elements go to current component.

    1 - New elements go to original component.

Example#

Split the element with ID 2 use the nodes with IDs 21 , 25 , 41 , 40 , 21 and 41#
import hm
import hm.entities as ent

model = hm.Model()

model.split_hex_continuum(
    node_array=[21, 25, 41, 40, 21, 41],
    collection=hm.Collection(model, ent.Element, [2]),
    layers=2,
    growth_rate=1.0,
    action=0,
    component=1,
)