Model.secondorderfix2#

Model.secondorderfix2(collection, min_jacobian, max_midangle, min_midratio, jacobian_method, fix_method)#

Fixes the middle nodes of second order elements, using parameters to define how the nodes can be moved.

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

  • min_jacobian (double) – The element Jacobian threshold of the fixed result.

  • max_midangle (double) – The maximum angle of the curved edge to the straight edge.

  • min_midratio (double) – The minimum ratio of the two parts of the edge separated by the middle node.

  • jacobian_method (int) –

    The evaluation method of the Jacobian. Valid values are:

    0 - Evaluate at integration points

    1 - Evaluate at corner points

    2 - Evaluate at corner and mid points

    3 - Evaluate at high order integration points

  • fix_method (int) –

    The method used to fix the node.

    0 - Just straighten surface edge, internal middle nodes are not moved.

    1 - Move internal nodes only, boundary middle nodes are not moved.

    2 - Move all nodes (both internal and surface), the boundary nodes should be moved along the geometry.

    3 - Move internal nodes and straighten surface nodes, the boundary nodes can bemoved off the geometry.

    Any other value - Move all nodes and straighten surface nodes. For the boundary nodes, first try to move along geometry. If not able to reach the target, then try to move off the geometry.

Example#

Fix the middle nodes of the elements with IDs 2 and 4 . The target Jacobian at the elements ‘ corner points should be not less than 0.1 , the angle of the fixed edge to the straight edge which is constructed by the two end nodes should be less than 30 degrees , and the ratio of the two parts of the edge separated by the middle node should be greater than 0.8 . Both the internal nodes and boundary nodes can be moved , and the boundary nodes can be kept on the geometry#
import hm
import hm.entities as ent

model = hm.Model()

# Creating a collection that contains the elements to fix
elements_collection = hm.Collection(model, ent.Element, [2, 4])

model.secondorderfix2(
    collection=elements_collection,
    min_jacobian=0.1,
    max_midangle=30.0,
    min_midratio=0.0,
    jacobian_method=1,
    fix_method=2,
)