Model.hm_comparesetelemsurfmode#
- Model.hm_comparesetelemsurfmode(mode=0)#
Specifies whether to consider element centroids for element-to-surface comparisons. This must precede any calls to hm_compareentities functions. This is useful particularly when comparing coarse meshes and highly curved surfaces.
When this option is enabled, a comparison operation will associate an element with a surface if the element has all its nodes on that surface, or at least one node and the element centroid projects normally to the surface and that projected point lies within roughly one quarter of the average side length of the centroid. Note that for elements that are partially off the edge of a surface, if the centroid is not on the surface but part of the element is (more than just a node or edge), the element will be marked as unmatched instead of intersected.
- Parameters:
mode (int) –
0 - Do not consider element centroids (default)
1 - Consider element centroids
- Returns:
hwReturnStatus- Status object
Example#
Generate a same side comparison of surfaces with IDs 1 - 20 and elems with IDs 101 - 120 , include element centroids#import hm import hm.entities as ent model = hm.Model() surfs = hm.Collection(model, ent.Surface, list(range(1, 21))) elems = hm.Collection(model, ent.Element, list(range(101, 121))) model.hm_compareinit() model.hm_comparesetelemsurfmode(mode=1) model.hm_compareentitiessameside( source_entities=surfs, target_entities=elems, tolerance=0.1, result_type=2, review_results=False, ) model.hm_compareend()