Model.morphshapesmooth#

Model.morphshapesmooth(shape_collection, node_collection, option, autofix, constraints, feature_angle, report_file)#

Applies the selected shapes on the mark in every combination possible at their most extreme values (either 0.0 and 1.0 or the lower and upper bounds on associated desvar entities), checking the element quality of the mesh and reporting the worst values in a specified file. Optionally this function can be used to smooth the shapes on the collection individually or to smooth all of the combinations of the shapes simultaneously, improving the element quality of the mesh for each combination. The quality will be checked and a report issued after any smoothing is performed. The report will also include the maximum upper and lower bounds at which the shapes on the mark can be applied in order to avoid errors during shape optimization.

Parameters:
  • shape_collection (Collection) – The collection containing the input shape entities.

  • node_collection (Collection) – The collection containing the fixed node entities.

  • option (int) –

    0 - Check all combinations for conflicts.

    1 - Smooth each individual shape and check combinations for conflicts.

    2 - Smooth all shape combinations simultaneously and check combinations for conflicts.

  • autofix (int) –

    Defines which nodes will be fixed.

    0 - No autofix

    1 - Edges

    2 - Edges and features

    3 - Edges and faces

  • constraints (int) –

    0 - Apply all morph constraints.

    1 - Fix all constrained nodes.

  • feature_angle (double) – Used to determine the features when autofix=2.

  • report_file (hwString) – Full path and file name of report file.

Examples#

Check the element quality for the shapes with names “s1”, “s2”, “s3”, “s4” when applied at all possible combinations with fixed nodes selected interactively#
import hm
import hm.entities as ent

model = hm.Model()

model.morphshapesmooth(
    shape_collection=hm.Collection(
        model, ent.Shape, "Name=s1 OR Name=s2 OR Name=s3 OR Name=s4"
    ),
    node_collection=hm.CollectionByInteractiveSelection(model, ent.Node),
    option=0,
    autofix=0,
    constraints=0,
    feature_angle=30.0,
    report_file="C:/Temp/Report.txt",
)
Smooth the shapes with names “s1”, “s2”, “s3”, “s4” for all possible combinations#
import hm
import hm.entities as ent

model = hm.Model()

model.morphshapesmooth(
    shape_collection=hm.Collection(
        model, ent.Shape, "Name=s1 OR Name=s2 OR Name=s3 OR Name=s4"
    ),
    node_collection=hm.CollectionByInteractiveSelection(model, ent.Node),
    option=0,
    autofix=2,
    constraints=0,
    feature_angle=30.0,
    report_file="C:/Temp/Report.txt",
)