CM2 MeshTools® Suite /release 4.7.0

by | Jun 1, 2016

  • 4.7.0
  • June 2016
  • All CM2 MeshTools® Suite
  • Major release of the CM2 MeshTools® Suite
  • Due to changes in the API, client applications must be recompiled against the new headers


  • Lib names suffix is _47 for this series.
  • Visual Studio 2008 is deprecated and will be no longer supported in future versions.
  • Windows XP is deprecated and will be no longer supported in future versions.

/new features

All meshers (except Intersect and Layers)

  • New functions data_type::IDs_sorted_by_color to retrieve easily the groups of elements with same color.
    These functions are straightforwardly based on the new function meshtools::get_sorted_order (see below) and are provided for convenience only

CM2 HexaMesh

  • New output vector hexamesh::data_type::pathological_boundary_IDs similar to tetramesh::data_type::pathological_boundary_IDs.
    This array gives, upon exit, the sorted IDs (i.e. the column IDs in data_type::connectB) of the faces that has intersection(s) with some other hard entities (nodes, edges, faces).
    In strict-constraint mode (mode.strict_constraints_level > 0), the generator stops with an error when this vector is not empty.
  • New mode hexamesh::operating_mode_type::CONVEX_HULL_MODE similar to tetramesh::operating_mode_type::CONVEX_HULL_MODE.
    In this mode, the mesher 3-D triangulates a set of nodes (data_type::connectB, data_type_connectE and data_type::isolated_nodes) generating tetrahedrons only.

CM2 SurfRemesh T3, CM2 SurfRemesh Q4

  • New functions data_type::IDs_sorted_by_color_in and data_type::sort_by_skeleton_colors_in (resp. data_type::IDs_sorted_by_color and data_type::sort_by_skeleton_colors) to retrieve easily the groups of elements in the initial mesh (resp. new mesh) with same color.

CM2 MeshTools

  • New function meshtools::get_colors_boundaries to find out the boundaries between elements of different colors.
  • New function meshtools::get_elements_on_boundaries to find out the elements sharing some specified boundaries (for instance triangles sharing some specific edges or tetrahedrons sharing some specific triangle faces).
  • New function meshtools::get_sorted_order to get the order of elements according to their color.
  • meshtools::NASTRAN_input and meshtools::NASTRAN_output now support CPYRAM (and CPYRA) solid type (linear only).
    Converted to and from CM2_PYRAMID5 elements.

COM interface

  • New project ccm2hexamesh for the COM wrapper to CM2 HexaMesh.


All meshers

  • Some mesh-quality improvements (optimization schemes).

CM2 QuadMesh, CM2 QuadMesh Aniso, CM2 SurfRemesh Q4, CM2 SurfMesh Q4

  • Fewer (-30%) triangles in mixed mode (mode.all_quad_flag = false) on average vs 4.6.

CM2 TriaMesh, CM2 TriaMesh Aniso, CM2 QuadMesh, CM2 QuadMesh Aniso

  • Hard-entities (nodes/edges) enforcement scheme fortified.
  • Improvements in CONVEX_HULL_MODE.

CM2 HexaMesh

  • Fewer tetrahedrons on average.

CM2 TetraMesh, CM2 TetraMesh Aniso

  • Hard-entities (nodes/edges/faces) enforcement scheme fortified.
  • Improvements in CONVEX_HULL_MODE.

CM2 SurfRemesh T3, CM2 SurfRemesh Q4

  • Curvatures (like in drill holes) are better taken into account.

CM2 Intersect T3

  • Fewer remaining pathologies (hard cases).

CM2 SurfMesh T3, CM2 SurfMesh Q4

(based on CM2 TriaMesh Aniso, CM2 QuadMesh Aniso and OpenCascade, still experimental)

  • Much fewer elements in most cases due to new anisotropic meshing of curves.

CM2 MeshTools (whole library)

  • Port to Intel C++ Composer 16.0, GCC 6.1, clang 3.8.
  • Doc fixes and improvements.


CM2 TetraMesh, CM2 TetraMesh Aniso

  • Bug in the hard-entities enforcement scheme.

CM2 SurfRemesh T3, CM2 SurfRemesh Q4

  • In some circumstances (small, bad isolated patches), the mode.patch_angle_tolerance was not respected.
    This could lead to excessive geometric errors.
  • Hard open nodes could be removed during the clean-up phase.
    This could also lead to missing hard edges/faces in the final mesh.
  • With mode.remesh_flag = false and mode.optim_level = 0, the data.colors, data.skeleton_edges and data.skeleton_colors vectors were empty upon exit.
  • The data_type::hard_faces vector was not saved by data_type::save nor read by data_type::load.

CM2 QuadMesh, CM2 QuadMesh Aniso, CM2 SurfRemesh Q4, CM2 SurfMesh Q4

  • Sometimes thin triangles were preferred to thin quads.


  • meshtools::NASTRAN_output and meshtools::FEMAP_output: bug with mixed element types (CM2_FACE_MIX, CM2_SOLID_MIX).

COM interface

  • Updated and fixes (warning codes, helpstring, version numbers…)

/breaking changes

All meshers (except SurfRemesh, Intersect and Layers)

  • Field operating_mode_type::reset_external_boundaries_flag removed.
    This flag was used in REGULARIZE_MODE to tell the mesher whether it should recompute the boundary (i.e. matrix connectB) or use the one provided by the user.
    In the latter case, problems could occur when the user-provided boundary was invalid (not closed or not delimiting properly the various colourized subdomains).
    Now, matrix connectB is systematically recomputed in REGULARIZE_MODE (this is fast enough) taking into account different colourized subdomains and user-provided embedded boundaries if any.
  • To be consistent with CM2 SurfRemesh, CM2 SurfMesh and CM2 Intersect T3, the subdomains’ colour now starts at 0 (used to be 1).

CM2 SurfRemesh T3, CM2 SurfRemesh Q4

  • operating_mode_type::solid_flag renamed operating_mode_type::closed_manifold_flag (usage unchanged).
  • data_type::CM2_NON_MANIFOLD_SOLID_WARNING renamed data_type::CM2_NON_CLOSED_MANIFOLD_WARNING (usage unchanged).
  • Default value for operating_mode_type::max_chordal_error is now -0.02, i.e. 2% (used to be 5%).
    This leads to finer meshes along curved skeleton lines.


  • meshtools1d::subdivise (not English) renamed meshtools1d::subdivide.
  • meshtools::get_mesh_bounding_elements: new parameter (out) nbr_elfe_boundaries.
    The vector of IDs is now composite: KBs[i] = Ki*nbr_elfe_boundaries + bi.
    To get the element IDs again, divide by nbr_elfe_boundaries: Ki = KBs[i] / nbr_elfe_boundaries;
    To get the local boundary IDs, perform a modulo operation: bi = KBs[i] % nbr_elfe_boundaries;
  • meshtools2d::principal_curvatures: ridge nodes are no longer discarded (but low accuracy and curvature directions are out of plane).