CubitMeshInterface Namespace Reference

This document explains how to access Cubit mesh data from C++ or python. More...

Functions

void
init_mesh_access()
Use init_mesh_access to initialize mesh data access.
void
get_mesh_data_size( DLIList< MRefEntity * > & mref_list, int & num_node, int & num_elem, int & num_node_per_elem, int & connectivity_size)
Get the size of mesh data to be returned from an MRefEntity.
void
get_node_coordinates( DLIList< MRefEntity * > & mref_list, double * node_data)
Get the node coordinate data.
void
get_elem_connectivity( DLIList< MRefEntity * > & mref_list, int * elem_connectivity)
Get the element connectivity.
void
get_side_and_centroid_data( MRefEntity * mref_entity, MRefEntity * mref_parent, std::vector< AdjacencyInfo > & adj_info_list)

Detailed Description

This document explains how to access Cubit mesh data from C++ or python.

The purpose of CubitMeshInterface is to provide developers with a query interface for Cubit mesh data.

Most function prototypes are easy to understand. A few are more ambiguous and for those some examples are provided. Note that input parameters that require entity types, such as "volume", "quad", "curve", and so forth, expect lower case spellings of those entity types.

Examples are provided for C++ and python developers.

Function Documentation

void get_elem_connectivity(
  • DLIList< MRefEntity * > & mref_list,
  • int * elem_connectivity)
Parameters
  • mref
    Specifies the geometry entity for which the mesh data is to be queried
  • elem_connectivity
    Pointer to memory where element connectivity will be written. Data is written to the elem_connectivity array as: number of nodes in element 1 1st node index in element 1 2nd node index in element 1 3rd node index in element 1 ... nth node index in element 1 number of nodes in element 2 1st node index in element 2 2nd node index in element 2 3rd node index in element 2 ... nth node index in element 2 number of nodes in element 3 ...
void get_mesh_data_size(
  • DLIList< MRefEntity * > & mref_list,
  • int & num_node,
  • int & num_elem,
  • int & num_node_per_elem,
  • int & connectivity_size)
Parameters
  • mref
    Specifies the geometry entity for which the mesh data is to be queried
  • num_node
    The number of nodes in the mesh
  • num_elem
    The number of elements in the mesh
  • num_node_per_elem
    The number of nodes per element
  • connectivity_size
    returns the number of data entries that will be written to the elem_connectivity array in get_elem_connectivity(). This gives the size of memory to be allocated for elem_connectivity before calling get_elem_connectivity().
void get_node_coordinates(
  • DLIList< MRefEntity * > & mref_list,
  • double * node_data)
Parameters
  • mref
    Specifies the geometry entity for which the mesh data is to be queried
  • node_data
    Pointer to memory where node coordinates will be written. Allocated size must be at least 3 * number of nodes in the mesh