Model.aligntoedges#

Model.aligntoedges(line_collection, node_collection, FailureCountTolerance=0.1, FailureIndexTolerance=0.05, GlobalFailureCountTolerance=0.1, GlobalFailureIndexTolerance=0.05, OrientationMismatchPenalty=0, LengthDistortionPenalty=0, EdgeDeviationPenalty=0, WigglePenalty=0, NumIterations=0)#

Attempts to move nodes near edges to align them with the geometry of the edge. It further takes arguments that control the quality of the resulting mesh so that quality does not become too bad. When it cannot move nodes to an entire edge, it then attempts to move nodes to end vertices of that edge, performing smoothing where necessary on elements around those nodes. The function requires that quality criteria have been set already.

Parameters:
  • line_collection (Collection) – The collection containing the lines to which to align FE edges to.

  • node_collection (Collection) – The collection containing the node to align to lines.

  • FailureCountTolerance (double) – The percentage local failure count tolerance at each edge to which nodes are being moved to. If the failure count of elements around the nodes being moved increases beyond this percent of the neighboring element count, the node movement will be rolled back. The default value is 0.1.

  • FailureIndexTolerance (double) – The percentage local failure quality index tolerance at each edge to which nodes are being moved to. If the failure quality index of elements around the nodes being moved increases beyond this percent of the previous quality index of elements around these nodes, the node movement will be rolled back. The default value is 0.05.

  • GlobalFailureCountTolerance (double) – The percentage global failure count tolerance to use for the mesh quality control after node movement to each edge. If the movement of nodes to an edge causes the global failure count of the mesh to increase beyond this percent of the total element count, the node movement will be rolled back. The default value is 0.1.

  • GlobalFailureIndexTolerance (double) – The percentage global failure quality index tolerance to use for the mesh quality control after node movement to each edge. If after the movement of nodes to an edge, the global failure quality index of the mesh increases beyond this percent of the previous global quality index of elements in the model, the node movement will be rolled back. The default value is 0.05.

  • OrientationMismatchPenalty (double) – Reserved for future development.

  • LengthDistortionPenalty (double) – Reserved for future development.

  • EdgeDeviationPenalty (double) – Reserved for future development.

  • WigglePenalty (double) – Reserved for future development.

  • NumIterations (double) – Reserved for future development.

Example#

Attempt to align all nodes to all lines , using a failure count tolerance of 0.2 and failure index tolerance of 0.2#
import hm
import hm.entities as ent

model = hm.Model()
lines = hm.Collection(model,ent.Line)
nodes = hm.Collection(model,ent.Node)
model.aligntoedges(
    line_collection=lines,
    node_collection=nodes,
    FailureCountTolerance=0.2,
    FailureIndexTolerance=0.2
)