Model.setqualitycriteria#

Model.setqualitycriteria(string_array, mode)#

Defines the current element quality criteria via flexible string input. This may be useful for autocleanup, interactive QI meshing, QI node optimization, element cleanup, etc…

Parameters:
  • string_array (hwStringList) –

    The string array that contains the element quality criteria information. There are two types of strings, quality parameters and threshold penalty values.

    The 13 quality parameter strings have the following structure:

    "line_number tag switch weight ideal_good_warn_failed_worst method"

    • line_number <ID> (optional)

    The line ID.

    • tag <value>

    The unique parameter tag. Valid values are: min length, max length, aspect ratio, warpage, max angle quad, min angle quad, max angle tria, min angle tria, skew, jacobian, chordal dev, taper, % of trias.

    • switch <flag>

    0 - Disables

    1 - Enables the parameter.

    • weight <value>

    The dimensionless parameter weight in the composite quality index (1.0 is default).

    • ideal_good_warn_fail_worst <list of value>

    A sequence of parameters value thresholds defining the start value of the corresponding parameter range. The sequence should be monotonic, either increasing or decreasing according to the specific parameter.

    • method <ID> (optional)

    The method solver ID used for calculation of the parameter. See the list of the methods IDs in the description of Model.elementchecksettings() function. If the method is omitted, then the default method is applied.

    The threshold penalty string has the following structure:

    "line_number tag ideal_rate good_rate warn_rate fail_rate worst_rate"

    • line_number <ID> (optional)

    The line ID.

    • tag <value>

    The string penalty value.

    • ideal_rate good_rate warn_rate fail_rate worst_rate <list of value>

    A non-decreasing sequence of dimensionless ratings corresponding to the parameters’ thresholds and used for calculation of the composite quality index by each parameter value. The default penalties values are 0.0, 0.8, 1.0, 10.0. It is not recommended to change the ratings for ideal and fail thresholds from the default values.

  • mode (int) –

    0 - The criteria are reset completely for all the elements quality parameters. Any omitted parameters are disabled.

    1 - The criteria data are changed only for the input elements quality parameters. Any omitted parameters remain unchanged.

Examples#

Completely resetting the quality criteria using default methods#
import hm
import hm.entities as ent

model = hm.Model()

model.setqualitycriteria(
    string_array=[
        " 0 penalty value      0.00    0.00    0.80    1.00   10.00",
        " 1 min length        1 1.0   3.000   2.749   1.502   1.000   0.749  1",
        " 2 max length        1 1.0   3.000   3.600   4.500   6.000   9.000  0",
        " 3 aspect ratio      1 1.0   1.000   2.000   4.400   5.000  10.000  0",
        " 4 warpage           1 1.0   0.000   5.000  13.000  15.000  30.000  0",
        " 5 max angle quad    1 1.0  90.000 110.000 134.000 140.000 160.000  0",
        " 6 min angle quad    1 1.0  90.000  70.000  46.000  40.000  20.000  0",
        " 7 max angle tria    1 1.0  60.000  80.000 112.000 120.000 150.000  0",
        " 8 min angle tria    1 1.0  60.000  50.000  34.000  30.000  15.000  0",
        " 9 skew              1 1.0   0.000  10.000  34.000  40.000  70.000  0",
        "10 jacobian          1 1.0   1.000   0.900   0.700   0.600   0.300  0",
        "11 chordal dev       0 1.0   0.000   0.300   0.800   1.000   2.000  0",
        "12 taper             1 1.0   0.000   0.200   0.500   0.600   0.900  0",
        "13 % of trias        1 1.0   0.000   6.000  10.000  15.000  20.000  0",
    ],
    mode=0,
)
Reset aspect ratio and skew thresholds use ANSYS ( solver 9 ) methods . Keep all other criteria unchanged#
import hm
import hm.entities as ent

model = hm.Model()

model.setqualitycriteria(
    string_array=[
        "aspect ratio 1 1.0 1.000 1.500 3.000 4.000 10.000 9",
        "skew 1 1.0 0.000 8.000 30.00 35.00 60.000 9",
    ],
    mode=1,
)