Model.elementqualityoptimizenodenew#

Model.elementqualityoptimizenodenew(node_id, midnodes_flag=1, optimize_flag=1)#

Optimizes a node location to improve the attached elements’ quality index according to pre-set quality criteria. This function only functions between an Model.elementqualitysetup() function and an Model.elementqualityshutdown() function. Current element quality criteria for optimization must be set before using this function. The function may be applied at any time without resetting the current quality criteria.

Parameters:
  • node_id (int) – The node ID to optimize its location.

  • midnodes_flag (int) –

    Neighboring mid-nodes during optimization.

    0 - Do not consider neighboring.

    1 - Consider neighboring.

  • optimize_flag (int) –

    Optimize the node location.

    1 - Along the surface.

    2 - Normal to the surface.

    3 - Along and then normal to the surface.

Example#

Optimize the location of the nodes with ID ‘s 102 , 397 and 432 use quality criteria from a file#
import hm
import hm.entities as ent

model = hm.Model()

model.readqualitycriteria(file_name="c:/criteria/mycriteria.txt")

elems = model.CreateCollectionByDisplayed(ent.Element)
model.elementqualitysetup(elementcollection=elems)

model.elementqualityoptimizenodenew(node_id=102, midnodes_flag=1, optimize_flag=1)
model.elementqualityoptimizenodenew(node_id=397, midnodes_flag=0, optimize_flag=2)
model.elementqualityoptimizenodenew(node_id=432, midnodes_flag=1, optimize_flag=1)

model.elementqualityshutdown(dontsaveflag=1)