Model.morphstorematch#

Model.morphstorematch(domain_id, surface_id, mode)#

Predetermines which domains match with which surfaces when using the Model.morphfittosurface() function and the one to one mapping option. There are two ways to use this function, one is to call it for each pair of domains and surfaces, passing in the IDs to store as matches; the other is to call it once and automatically match all the overlapping domains and surfaces in pairs. In the case of matching domains to surfaces automatically, a domain’s nodes must be associated to a surface for a match to be registered.

Parameters:
  • domain_id (unsigned int) – ID of a 2D domain to map to a surface.

  • surface_id (unsigned int) – ID of a surface to map to a 2D domain.

  • mode (int) –

    0 - Clear the current list of matching domains and surfaces

    1 - Add the given domain and surface pair to the current list

    2 - Clear the list and fill it with all overlapping domain and surface pairs

Example#

Set the fitting list to have three pairs of domains and surfaces#
import hm
import hm.entities as ent

model = hm.Model()

model.morphstorematch(domain_id=0, surface_id=0, mode=0)
model.morphstorematch(domain_id=2, surface_id=4, mode=1)
model.morphstorematch(domain_id=3, surface_id=5, mode=1)
model.morphstorematch(domain_id=4, surface_id=11, mode=1)