Model.setmeshparams_byentity#

Model.setmeshparams_byentity(entity, EdgeAlgType=INT_MAX, EdgeBiasing=DBL_MAX, EdgeBiasStyle=INT_MAX, EdgeChordalDeviation=DBL_MAX, EdgeDensity=DBL_MAX, EdgeDistribution=hwDoubleList(), EdgeElemSize=DBL_MAX, EdgeMaxAngle=DBL_MAX, EdgeMaxSize=DBL_MAX, EdgeMinSize=DBL_MAX, FaceAlgType=INT_MAX, FaceElemType=INT_MAX, FaceElemType2=INT_MAX, FaceMeshAlgorithm=INT_MAX, FaceMeshMapPoint1=Entity(), FaceMeshMapPoint2=Entity(), FaceMeshMapPoint3=Entity(), FaceMeshMapPoint4=Entity(), FaceMeshMapPoint5=Entity(), FaceMeshMapNode1=Entity(), FaceMeshMapNode2=Entity(), FaceMeshMapNode3=Entity(), FaceMeshMapNode4=Entity(), FaceMeshMapNode5=Entity(), FaceSizeControl=INT_MAX, FaceSkewControl=INT_MAX, FaceSmoothMethod=0, FaceSmoothTolerance=DBL_MAX)#

Sets 2D meshing edge and face parameters used during surface and element meshing. For surface meshing, the edge definition is by surface edge entity, and the face definition is by surface entity.

For element remeshing, the edge definition is by pair of nodes defining an element edges (see Model.setmeshparams_bynodepair), and the face definition is by element entity. While remeshing, topology is built with the user-defined feature option. A topological edge is assigned a user given edge parameter if it is part of a user given element edge, and similarly for face parameters.

Parameters:
  • entity (Entity) – The object describing the entity.

  • EdgeAlgType (int) –

    Flag indicating the edge algorithm type. Valid for a line or node entity. Valid values are:

    1 - Size and biasing

    2 - Chordal deviation. When the function is being called for the first time for an edge, or when any of the chordal deviation parameters have been changed, the element density parameter is ignored and the edge element density is set to the value required by the chordal deviation parameters. Subsequent calls of the function with the same chordal deviation parameters reset the edge element density to the specified value with the same along edge density distribution.

  • EdgeBiasing (double) – The biasing value of the element length to use along the edge. Valid for a line or node entity.

  • EdgeBiasStyle (int) –

    The style of biasing to use. Valid for a line or node entity. Valid values are:

    0 - Linear

    1 - Exponential

    2 - Bell curve

  • EdgeChordalDeviation (double) – The maximum chordal deviation distance for the element for the edge. Valid for a line or node entity.

  • EdgeDensity (double) – The element density for the edge. Valid for a line or node entity.

  • EdgeDistribution (hwDoubleList) – The user-defined internal node distribution for the edge. Valid for a line or node entity.

  • EdgeElemSize (double) – The element size for the edge. Valid for a line or node entity.

  • EdgeMaxAngle (double) – The maximum turn angle value (in degrees) between adjacent element links for the edge for chordal deviation meshing. Valid for a line or node entity.

  • EdgeMaxSize (double) – The maximum element size for the edge for EdgeAlgType=2. Valid for a line or node entity.

  • EdgeMinSize (double) – The minimum element size for the edge for all EdgeAlgType values. Valid for a line or node entity.

  • FaceAlgType (int) –

    Flag indicating the face algorithm type. Valid for for a surface or element entity. Valid values are:

    0 - Standard surface meshing

    1 - Meshing with flow “align” control

    3 - Meshing with flow “align” and “size” control

  • FaceElemType (int) –

    Flag indicating the elements generated for mapped meshing algorithms. Valid for for a surface or element entity. Valid values are:

    0 - Trias

    1 - Quads

    2 - Mixed

    3 - Right trias

    4 - Quads only

    5 - No meshing

  • FaceElemType2 (int) –

    Flag indicating the elements generated for free meshing algorithms. Valid for for a surface or element entity. Valid values are:

    0 - Trias

    1 - Quads

    2 - Mixed

    3 - Right trias

    4 - Quads only

    5 - No meshing

  • FaceMeshAlgorithm (int) –

    Determines the surface-based mesh generation algorithm to use when creating elements on the face. Valid for for a surface or element entity. Valid values are:

    1 - Auto-decide

    2 - Map as rectangle

    3 - Map as triangle

    4 - Map as pentagon

    5 - Map as circle

    6 - Free shape

  • FaceMeshMapPoint1 (Entity) – For map algorithms, the optional point entity for corner 1. Valid for for a surface or element entity.

  • FaceMeshMapPoint2 (Entity) – For map algorithms, the optional point entity for corner 2. Valid for for a surface or element entity.

  • FaceMeshMapPoint3 (Entity) – For map algorithms, the optional point entity for corner 3. Valid for for a surface or element entity.

  • FaceMeshMapPoint4 (Entity) – For map algorithms, the optional point entity for corner 4. Valid for for a surface or element entity.

  • FaceMeshMapPoint5 (Entity) – For map algorithms, the optional point entity for corner 5. Valid for for a surface or element entity.

  • FaceMeshMapNode1 (Entity) – For map algorithms, the optional node entity for corner 1. Valid for for a surface or element entity.

  • FaceMeshMapNode2 (Entity) – For map algorithms, the optional node entity for corner 2. Valid for for a surface or element entity.

  • FaceMeshMapNode3 (Entity) – For map algorithms, the optional node entity for corner 3. Valid for for a surface or element entity.

  • FaceMeshMapNode4 (Entity) – For map algorithms, the optional node entity for corner 4. Valid for for a surface or element entity.

  • FaceMeshMapNode5 (Entity) – For map algorithms, the optional node entity for corner 5. Valid for for a surface or element entity.

  • FaceSizeControl (int) –

    Flag indicating whether to create uniformly sized elements. Valid for for a surface or element entity. Valid values are:

    0 - Do not create uniformly sized elements

    1 - Create uniformly sized elements

  • FaceSkewControl (int) –

    Flag indicating whether to create optimally shaped elements when using mapping algorithms. Valid for for a surface or element entity. Valid values are:

    0 - Do not create optimally shaped elements

    1 - Create optimally shaped elements

  • FaceSmoothMethod (int) –

    The smoothing method to use. Valid for for a surface or element entity. Valid values are:

    0 - Auto-decide

    1 - Size corrected

    2 - Shape corrected

  • FaceSmoothTolerance (double) – Applies the smoothing algorithm until the largest adjustment made to a nodal position is less than this value. Valid vales are > 0.0. Valid for entity_type as surfaces or elements.

Example#

Set parameters and perform surface meshing#
import hm
import hm.entities as ent

model = hm.Model()

model.setmeshparams_byentity(
    entity=ent.Line(model, 8),
    EdgeDensity=8,
    EdgeAlgType=1
)

model.setmeshparams_byentity(entity=ent.Line(model, 6),
    EdgeDistribution=[0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875],
    EdgeAlgType=3
)

model.setmeshparams_byentity(entity=ent.Surface(model, 1),
    FaceElemType=2,
    FaceElemType2=5,
    FaceMeshAlgorithm=5,
    FaceAlgType=0
)

model.setedgedensitylinkbytypeandaspectratio(type=0,aspect_ratio=-1)

surfs = hm.Collection(model, ent.Surface, [1])

model.defaultremeshsurf(
    collection=surfs,
    elem_size=1.0,
    elem_type=2.0,
    elem_type_2=2.0,
    previous_settings=0,
    comp_mode=1,
    size_control=1,
    skew_control=1,
    mesh_type=1,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)