Model.qismoothfixfailed#
- Model.qismoothfixfailed(smoothcollection, anchorcollection, criteria_file, feature_angle, ignore_features, freenodesmovelimit, breaknodesmovelimit, smoothedgenodesmovelimit, flgs, max_iterations)#
This function is applied to a selection of elements given by the
smoothcollection. It changes positions of nodes of elements violating the quality index threshold and possibly of adjacent elements. Maximum displacements of nodes on feature edges are limited by the user-specified values.- Parameters:
smoothcollection (Collection) – The collection containing the element entities.
anchorcollection (Collection) – The collection containing the (to welds) node entities not allowed to move.
criteria_file (hwString) – The path to the criteria file. If the criteria are set by a preceding function, “dummy” can be used as a criteria file name.
feature_angle (double) – Elements feature angle for defining of features in degrees (30 degrees is a commonly used value).
ignore_features (int) –
The flag defining permissions of node movement across the feature edges:
0 - Nodes are not allowed to move across feature edges.
1 - Nodes are allowed to be moved across shared edges; free edges nodes, marked edges, edges of features (beads, washers, dimples, birdbeaks, fillets), all fixed nodes are forbidden for movement across.
2 - The same as
ignore_features=1, but nodes on some of the features surfaces (beads, vertices) are unfixed + end vertices of fillet edge are unfixed.3 - The same as
ignore_features=2, but fillet edges are released and some curves sharp break vertices are unfixed.4 - All shared edges nodes,including recognized features boundary edges, all non-user marked edges and fixed vertices are released for movement across;
5 - The same as
ignore_features=4but free edges nodes are also released, those nodes are not allowed to move off the surfaces;6 - The same as
ignore_features=5but free edges nodes are allowed now to move off surfaces breaking associativity with geometry.freenodesmovelimit (double) – Maximum absolute movement for free edges nodes. If negative value - no constraints are applied.
breaknodesmovelimit (double) – Maximum absolute movement for shared feature edges nodes. If negative value - no constraints are applied.
smoothedgenodesmovelimit (double) – Maximum absolute movement for smooth (non-feature) shared edges nodes. If negative value - no constraints applied.
flgs (int) – Flags controlling internal algorithms. The default is 0. The
flgs = 256should be used to mark moved free edges by plot elements placed in the predefined component - to account for the moved edges on the future steps.max_iterations (int) – Maximum number attempts to fix the failed elements. Usually 3-5 can be used.
Examples#
Fix the displayed failed elements with no anchor nodes , use the quality criteria file “ C:/Altair / hw8.0 / hm / batchmesh/10mm.criteria “ , feature angle 30.0 degrees ,ignore_features=6( the free edges ‘ nodes are allowed to be moved across with breaking of associativity with geometry ) , maximum allowed movement of free edges nodes is 0.5 , maximum allowed movement of shared feature edges nodes is 1.0 , no constraints applied to movement across of non - feature shared edges ( -1 ) , no marking of moved feature edges (flgs = 0) , 5 iterations applied#import hm import hm.entities as ent model = hm.Model() model.qismoothfixfailed( smoothcollection=hm.CollectionByDisplayed(model, ent.Element), anchorcollection=hm.Collection(model, ent.Node, populate=False), criteria_file="C:/temp/10mm.criteria", feature_angle=30.0, ignore_features=6, freenodesmovelimit=0.5, breaknodesmovelimit=1.0, smoothedgenodesmovelimit=-1.0, flgs=0, max_iterations=5, )
Do the same , except that node IDs 2342 and 131 are not allowed to move , free edges ‘ nodes are not allowed to move across edges (ignore_features=4) , and the quality criteria are preset directly by the preceding function#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", ] ) model.qismoothfixfailed( smoothcollection=hm.CollectionByDisplayed(model, ent.Element), anchorcollection=hm.Collection(model, ent.Node, [2342, 131]), criteria_file="C:/temp/10mm.criteria", feature_angle=30.0, ignore_features=4, freenodesmovelimit=0.5, breaknodesmovelimit=1.0, smoothedgenodesmovelimit=-1.0, flgs=0, max_iterations=5, )