Model.midmesh_inspect_init#

Model.midmesh_inspect_init(SourceCollection, TargetCollection, CheckMinElemSize=1, MinEdgeOffEdgeDeviation=0.1, MinElemCenterDeviation=0.1, MinNodeOffMidDeviation=0.1, MinNodeOffSolidEdgeDeviation=0.1, MinNodeOutOfSolidDeviation=0.1)#

Initializes the midmesh inspection module. This must precede any calls to other midmesh_inspect_ APIs, and must be followed by a call to Model.midmesh_inspect_end().

This tool detects problem clusters in midmeshes as follows:

  • Nodes off middle

  • Nodes off solid sides

  • Nodes out of solid

  • Element edges off of solid sides

  • Element centers off middle

Parameters:
  • SourceCollection (Collection) – The collection containing the source entities, which must define the solid. Valid entities are components, elements, solids and surfaces.

  • TargetCollection (Collection) – The collection containing the entities defining the midmesh. Valid values are components and elements.

  • CheckMinElemSize (int) – Checks the minimum element size criteria while fixing the element center off mid and edge off solid edge problems. Valid values are 1 and 2.

  • MinEdgeOffEdgeDeviation (double) – Detects element edges off solid sides with its value as minimum deviation. Valid values are > 0.0.

  • MinElemCenterDeviation (double) – Detects element centers off middle with its value as minimum deviation. Valid values are > 0.0.

  • MinNodeOffMidDeviation (double) – Detects nodes off middle with its value as minimum deviation. Valid values are > 0.0.

  • MinNodeOffSolidEdgeDeviation (double) – Detects nodes off solid sides with its value as minimum deviation. Valid values are > 0.0.

  • MinNodeOutOfSolidDeviation (double) – Detects nodes out of solid with its value as minimum deviation. Valid values are > 0.0.

Examples#

Detect all problem types#
import hm
import hm.entities as ent

model = hm.Model()

source_collection = hm.Collection(model, ent.Component, "name=shell")
target_collection = hm.Collection(model, ent.Component, "Name=MidmeshEdges OR Name=Mid")

model.midmesh_inspect_init(
    SourceCollection=source_collection,
    TargetCollection=target_collection,
    MinNodeOffMidDeviation=0.2,
    MinNodeOffSolidEdgeDeviation=0.2,
    MinNodeOutOfSolidDeviation=0.2,
    MinEdgeOffEdgeDeviation=0.2,
    MinElemCenterDeviation=0.3,
    CheckMinElemSize=1,
)

model.midmesh_inspect_end()
Detect and correct nodes off mid , delete empty sets , and shut down the inspection module#
import hm
import hm.entities as ent

model = hm.Model()

source_collection = hm.Collection(model, ent.Component, "name=shell")
target_collection = hm.Collection(model, ent.Component, "Name=MidmeshEdges OR Name=Mid")

model.midmesh_inspect_init(
    SourceCollection=source_collection,
    TargetCollection=target_collection,
    MinNodeOffMidDeviation=0.2,
)

node_collection = hm.Collection(model, ent.Node, target_collection)
model.midmesh_inspect_fix_problems(
    entitylist=list(node_collection),
    ProblemType="NodeOffMid",
    SmoothClusters=True,
    SmoothMethod="Auto",
)

model.midmesh_inspect_delete_sets(mode=2)

model.midmesh_inspect_end()