Model.automesh_mc#
- Model.automesh_mc(entity_collection, mesh_control_collection, mode)#
Meshes elements or surfaces using mesh controls. The following rules apply:
A model control is mandatory for meshing, and only one is needed. It will indicate whether meshing is performed on surfaces, or on elements.
The entities selected in each local, feature and refinement control must existing in the final selection, which is composed of entities selected by the model control, and those on the
entity_collection.Feature-based meshing is only available for surfaces. When feature controls are involved, depending on the mode, a feature global or body control may be mandatory. See the
modeargument for details.During meshing, entities in local and feature controls will be meshed by themselves. The rest will be taken care of by model control, or by the feature body control.
- Parameters:
entity_collection (Collection) – The collection containing the entities to be meshed. Valid entities are surfaces, elements, components and regions.
mesh_control_collection (Collection) – The collection containing the meshcontrol entities to be used.
mode (int) –
The meshing mode for feature based meshing. Valid values are:
0 - Normal mode. Both body and feature controls will be meshed. At least one feature global or body control is needed.
1 - Feature only mode. Only feature controls will be meshed. Feature global or body controls are optional.
Examples#
Mesh all surfaces use mesh controls with IDs 1 - 3#import hm import hm.entities as ent model = hm.Model() input_surfs = hm.Collection(model, ent.Surface) mc_col = hm.Collection(model, ent.Meshcontrol, [1, 2, 3]) model.automesh_mc(entity_collection=input_surfs, mesh_control_collection=mc_col, mode=0)
Meshing elements defined in the model control and all other mesh controls#import hm import hm.entities as ent model = hm.Model() mc_col = hm.Collection(model, ent.Meshcontrol) model.automesh_mc( entity_collection=hm.Collection(model, ent.Surface, populate=False), mesh_control_collection=mc_col, mode=0, )