Model.morphcreatedomaindc#

Model.morphcreatedomaindc(elemcollection, type, part, rethand, bydom, bycomp)#

Creates a domain from the elements on the mark with various options.

Parameters:
  • elemcollection (Collection) – The collection containing the element entities.

  • type (int) –

    -1 - Autoupdate

    1 - 1D domain

    2 - 2D domain

    3 - 3D domain

    6 - Local domains (1D, 2D, and 3D)

    7 - General domain

  • part (int) –

    0 - Do not use partitioning

    1 - Partition all domains

    2 - Only partition elements on solid domains (only for type = 6)

  • rethand (int) –

    0 - Do not retain handles

    1 - Retain handles

  • bydom (int) –

    0 - Do not divide selected elements by existing domain

    1 - Divide elements by existing domains

  • bycomp (int) –

    0 - Do not divide selected elements by components

    1 - Divide selected elements by components

Example#

A new domain is created from the elements on the collection. The type specified notes which elements in the collection will be retained. If no elements of the correct type are on the collection, the function will exit. Elements from existing domains may be placed on the collection and will be removed from their former domain and placed in the new domain#
import hm
import hm.entities as ent

model = hm.Model()

model.morphcreatedomaindc(
elemcollection=hm.CollectionByInteractiveSelection(model, ent.Element),
type=2,
part=1,
rethand=1,
bydom=0,
bycomp=0,
)