Model.coarsen_and_decimate_mesh2#
- Model.coarsen_and_decimate_mesh2(comps_collection, nodes_collection, failed_comps_collection, elem_size, elem_type, feature_angle, max_diameter, options, delete_comp_size=0, max_compsize_factor=0, elsize_autoreduce_factor=0, area_compare_factor=1.1, area_low_factor=0.5, feat_angle_area_compare=0, area_low_factor_min=0.25, delete_isolated_small_parts=0, max_adjust_iters=4, delete_duplicated=0, mesh_by_connected_parts=0, delete_smallparts_after_mesh=0, delete_small_t_con_shells=0, generate_plotel_for_orphan_fixed_nodes=False, area_compare_factor_max=1.25, big_part_elems_count=30, small_feat_angle=30, small_feat_angle_big_parts=9, coarsen_to_different_comp=False, max_node_count_per_comp=0)#
Performs mesh coarsening and decimation on selected components. The ability exists to specify sacred nodes that will be maintained after coarsening/decimation. The function has additional options that allow adjusting the element size for small components and deleting elements of small components.
- Parameters:
comps_collection (Collection) – The collection containing the input component entities. This collection must also include components with any 1D multi-leg rigid elements that will be processed by the
optionsflags.nodes_collection (Collection) – The collection containing any node entities to be treated as sacred/fixed. These nodes must belong to the initial mesh. These nodes will be maintained during coarsening/decimation.
failed_comps_collection (Collection) – The collection to store any failed component entities.
elem_size (double) – The element size to use for coarsening/decimation. This must be larger than the initial mesh size.
elem_type (int) –
Element type flag to generate for the coarsened mesh. Valid values are:
0 - trias
1 - quads
2 - mixed
3 - right trias
4 - quads only
feature_angle (double) –
This specifies the maximum angle between the normals of two connected elements. This value is ignored for shell elements. For 3D elements, the appropriate free faces of shell elements are created and meshed with the given
feature_angle. This value is also used to construct the connected edges for the failed components. Then these components are coarsened in a second attempt.If
feature_angle< 1.0, the default value offeature_angle=85.0degrees is used.max_diameter (double) – This option specifies the maximum hole diameter that will be filled by the coarsening operation. The default value is 0.0 (do not fill any holes).
options (int) –
Flags that specify various methods of pre-processing and post-processing of 1D and 2D elements.
Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2 + 8*Bit3 + 16*Bit4 + 32*Bit5 + 64*Bit6). Valid Bit values are:
Bit0
Delete 1D element paths not sharing sacred nodes before mesh coarsening. Valid values are:
0 - Do not utilize this option.
1 - All selected 1D element paths not sharing sacred nodes must be deleted before mesh coarsening. 1D elements paths comprising sacred nodes are preserved. Unselected 1D elements are ignored. Preserved 1D elements which are not free should be attached to the shell mesh after coarsening.
Bit1
Delete 1D elements that appear free after mesh coarsening. Valid values are:
0 - Do not utilize this option.
1 - Selected 1D elements that appear free (are not attached to the shell or solid mesh) after mesh coarsening must be deleted after meshing. 1D elements sharing sacred nodes must be preserved.
Bit2
Update 1D multi-leg elements having free legs after meshing. Valid values are:
0 - Do not utilize this option.
1 - Selected 1D multi-leg elements having free legs after meshing (are not attached to shell or solid mesh) must be updated by deleting the free legs.
Bit3
Convert 1D elements to plot elements after meshing. Valid values are:
0 - Do not utilize this option.
1 - Selected 1D elements remaining after meshing should be converted to plot elements.
Bit4
Convert 2D elements to plot elements after meshing. Valid values are:
0 - Do not utilize this option.
1 - Selected 2D elements should be converted to plot elements after meshing. This flag is utilized only for Optistruct the user profile.
Bit5
Retain the input mesh, and organize the coarsened mesh into a new component. Valid values are:
0 - Do not utilize this option.
1 - Retain the input mesh, and organize the coarsened mesh into a new component.
Bit6
Create 1D plotel elements on coarsened 2D element edges. Valid values are:
0 - Do not utilize this option.
1 - Creates 1D plotel elements on coarsened 2D element edges.
Show Bit value calculator
Radio Button Table Option Name Value Delete 1D element paths not sharing sacred nodes before mesh coarsening (Bit0) Delete 1D elements that appear free after mesh coarsening (Bit1) Update 1D multi-leg elements having free legs after meshing (Bit2) Convert 1D elements to plot elements after meshing (Bit3) Convert 2D elements to plot elements after meshing (Bit4) Retain the input mesh, and organize the coarsened mesh into a new component (Bit5) Create 1D plotel elements on coarsened 2D element edges (Bit6) Calculated argument value: 0 delete_comp_size (double) – Controls the deletion of small components’ elements while coarsening. It specifies the upper limit for the component bounding box maximum dimension for components in which 2D and 3D elements must be deleted while coarsening. If the
delete_comp_size=0.0(default), then no components will be purged during coarsening.max_compsize_factor (double) –
Controls a prior adjustment of the mesh element size for small size components. The
max_compsize_factormust be ≥ 1.0. Formax_compsize_factor < 1a prior adjustment of the component element size is disabled. The default value is 3.0.Note
To explain the algorithm, here are some definitions:
elem_size- Regular input mesh element size for coarseningdelete_comp_size- Maximum dimension size of a component bounding boxcomp_mesh_size - Mesh size used for component coarsening.
The algorithm of a prior adjustment of element size for small components is as follows:
If
delete_comp_size>max_compsize_factor*elem_size, then comp_mesh_size =elem_size.If
delete_comp_size<elem_size/max_compsize_factor, then comp_mesh_size =delete_comp_size.For intermediate component sizes, an embedded formula for component mesh element size is used so that
elem_size/max_compsize_factor< comp_mesh_size <elem_size.elsize_autoreduce_factor (double) – This controls a posteriori iterative adjustments of the component mesh size by the results of the meshing. The result of meshing for each component is estimated by distortion of the original mesh shape. If a distortion limit is exceeded, or meshing failed, then the component mesh size is divided by the
elsize_autoreduce_factorand the meshing is repeated until the mesh is satisfactory. The parameter must be greater the 1.0, otherwise this algorithm is disabled. The default value is 0.0 meaning the auto-reduction is disabled. The recommended value for this factor once it is enabled is 1.5.area_compare_factor (double) – Reserved for future development
area_low_factor (double) – Reserved for future development
feat_angle_area_compare (double) – Reserved for future development
area_low_factor_min (double) – Reserved for future development
delete_isolated_small_parts (double) – Reserved for future development
max_adjust_iters (int) – The maximum number of mesh size auto-reducing iterations. The default value is 4.
delete_duplicated (int) – Reserved for future development
mesh_by_connected_parts (int) – Reserved for future development
delete_smallparts_after_mesh (int) – Reserved for future development
delete_small_t_con_shells (int) – Reserved for future development
generate_plotel_for_orphan_fixed_nodes (bool) – Reserved for future development
area_compare_factor_max (double) – Reserved for future development
big_part_elems_count (int) – Reserved for future development
small_feat_angle (double) – Reserved for future development
small_feat_angle_big_parts (double) – Reserved for future development
coarsen_to_different_comp (bool) – Reserved for future development
max_node_count_per_comp (int) – Reserved for future development
Example#
Create a coarsened and decimated mesh with mixed type elements of element size 30 use all components . put failed components onfailed_comps_collection. Keep node with IDs 16 and 27 as anchor nodes . Ignore all internal loops with diameter less than 65 . If the model has solid elements , create free faces of shell elements and mesh them with a feature angle of 45 degrees . delete selected 1D elements not share sacred nodes before meshing ( option Bit0=1 ) . delete selected free 1D elements after meshing ( option Bit1=1 ) . If the model has rigidlink / RBE3 elements , delete any free legs in the input components ( option Bit2=1 ) . Convert 1D elements to plot elements after meshing ( option Bit3=1 ) . The options are computed as 1 + 2 + 4 + 8 = 15 . delete shell and solid elements of components with maximum bounding box dimension less then 25.0 . use a prior small components mesh with factor 3.0 . use iterative component element size reduce with factor 1.5#import hm import hm.entities as ent model = hm.Model() # Initial collections and output collection components_collection = hm.Collection(model, ent.Component) n_collection = hm.Collection(model, ent.Node, [16,27]) failed_components_collection = hm.Collection(model, ent.Component, populate=False) model.coarsen_and_decimate_mesh2( comps_collection=components_collection, nodes_collection=n_collection, failed_comps_collection=failed_components_collection, elem_size=30.0, elem_type=2, feature_angle=45.0, max_diameter=65.0, options=15, delete_comp_size=25.0, max_compsize_factor=3.0, elsize_autoreduce_factor=1.5, )