HM_ExtAPI::GenerateMesh()

Generates a mesh on surfaces of the model loaded into the HyperMesh database, using mesh areas and constraint edges and points.

Syntax

bool GenerateMesh (
HM_Topology& mesh_area_topo,
HM_EntityMesh& hmesh,
HM_GenerateMeshParamStruct* mesh_params,
int options
);

Type

HyperMesh Ext API Function

Description

This structure contains information about an individual edge in the topology of mesh areas defined by the the HM_Topology structure.

If the function succeeds, the return value is true. If the function fails, the return value is false. To get extended value information, use HM_ExtAPI::GetLastErrorCode().

To query detailed properties of the generated mesh use the mesh interrogation functions of the API. The returned value of the handle hmesh can be used in calls to the mesh interrogation functions.

To free memory allocated by the temporary mesh object, use the HM_ExtAPI::ReleaseMesh() function. The mesh handle becomes invalid after this call and must not be used.

Requires including hm_extapi.h.

Inputs

mesh_area_topo
[in/out] - Reference to an HM_Topology structure that contains information about mesh area topology that includes a set of faces, edges and vertices and topological relations between them.
Upon return, this structure contains information about successful completion or errors in a process of matching input topology to the model currently loaded into the HyperMesh database, and in a process of meshing.
hmesh
[out] - A handle to the temporary mesh object that represents the mesh created as a result of the call to this function. The handle may be NULL or invalid in case the function fails.
mesh_params
[in] - Pointer to an HM_GenerateMeshParamStruct structure that contains additional parameters used for meshing and intermediate output. If the pointer is set to NULL then default parameters are used.
options
[in] - A set of bit flags that can be used to specify additional options to control the flow of the algorithm.
The value of this parameter can be a combination of the following flags:
HM_GM_OPTS_BATCH - BatchMesher mode is used. If this flag is set then mesh_params must not be NULL, and the members param_file_path and criteria_file_path of HM_GenerateMeshParamStruct must be set.
HM_GM_OPTS_IGNORE_ERR - If this flag is set then the algorithm tries to complete the meshing job even if some errors are encountered during the phase of mapping input topology specified by mesh_area_topo parameter. For the case of mapping errors, an attempt is made to identify HM surfaces corresponding to mesh areas that failed to be constructed without errors. If all of the input mesh areas except the degenerate (zero area) areas are identified, then only HM surfaces corresponding to the mesh areas are meshed. If some of the other non-degenerate mesh areas still can not be identified, then the entire model is meshed.
If the flag is not set then the default behavior is to terminate the algorithm if any error is encountered.
HM_GM_OPTS_DEFAULT - Use this value to specify all default options.
HM_GM_OPTS_BATCHORDERAUTO - If this flag is set then batch meshing with multiple criteria/parameters files is being performed by applying batch mesh parameters/criteria in order of increasing element size. If the flag is unset (default) the order of application of multiple batch mesh parameters/criteria is to first apply the local parameters/criteria sets in the order they are given in HM_GenerateMeshParamStruct, then apply the global parameters/criteria.

Errors

None.