Main Page | Namespace List | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

CubitInterface Namespace Reference

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


Classes

class  CIObserve
 Classes that need geometry update events need to derive from this class then implement the virtual functions required. More...

class  AssemblyItem
 Class to implement assembly tree interface. More...


CubitInterface Control - Not Generally Useful

CUBIEXPORT void init (const std::vector< std::string > &argv)
CUBIEXPORT void destroy ()
CUBIEXPORT void process_input_files ()
CUBIEXPORT bool prepare_next_script_line ()
CUBIEXPORT void copy_next_script_line (std::string &buffer)
CUBIEXPORT void process_next_script_line ()
CUBIEXPORT void set_exit_handler (ExternalExitHandler *hdlr)
CUBIEXPORT void set_playback_handler (ExternalPlaybackHandler *hdlr)
CUBIEXPORT void set_cubit_message_handler (CubitMessageHandler *hdlr)
CUBIEXPORT void set_progress_tool (ProgressTool *progress)
const int CI_ERROR = -1

System Control and Data

CUBIEXPORT void set_cubit_interrupt (bool interrupt)
 This sets the global flag in Cubit that stops all interruptable processes.

CUBIEXPORT std::string get_version ()
 Get the Cubit version.

CUBIEXPORT std::string get_revision_date ()
 Get the Cubit revision date.

CUBIEXPORT std::string get_build_number ()
 Get the Cubit build number.

CUBIEXPORT std::string get_acis_version ()
 Get the Acis version number.

CUBIEXPORT std::string get_exodus_version ()
 Get the Exodus version number.

CUBIEXPORT std::string get_graphics_version ()
 Get the VTK version number.

CUBIEXPORT void print_cmd_options ()
 Used to print the command line options.

CUBIEXPORT bool is_modified ()
 Get the modified status of the model.

CUBIEXPORT void set_modified (bool modified)
 Set the status of the model.

CUBIEXPORT bool is_undo_save_needed ()
 Get the status of the model relative to undo checkpointing.

CUBIEXPORT void set_undo_saved ()
 Set the status of the model relative to undo checkpointin.

CUBIEXPORT bool is_command_echoed ()
 Check the echo flag in cubit.

CUBIEXPORT bool is_command_journaled ()
 Check the journaling flag in cubit.

CUBIEXPORT void cmd (const char *input_string)
 Pass a command string into Cubit.

CUBIEXPORT void silent_cmd (const char *input_string)
 Pass a command string into Cubit and have it executed without being verbose at the command prompt.

CUBIEXPORT std::vector< int > parse_cubit_list (const std::string &type, std::string int_list, bool include_sheet_bodies=false)
 Parse a Cubit style list of IDs (1,2,4 to 19 by 3 or all) into a list of integers.

CUBIEXPORT void print_raw_help (char *input_line, int order_dependent, int consecutive_dependent)
 Used to print out help when a ?, & or ! is pressed.

CUBIEXPORT int get_error_count ()
 Get the number of errors in the current Cubit session.


Graphics Manipulation and Data

CUBIEXPORT double get_view_distance ()
 Get the distance from the camera to the model (from - at).

CUBIEXPORT std::vector< double > get_view_at ()
 Get the camera 'at' point.

CUBIEXPORT std::vector< double > get_view_from ()
 Get the camera 'from' point.

CUBIEXPORT void unselect_entity (const std::string &entity_type, int entity_id)
 Unselect an entity and removed if from the picked list.

CUBIEXPORT bool is_perspective_on ()
 Get the current perspective mode.

CUBIEXPORT bool is_scale_visibility_on ()
 Get the current scale visibility setting.

CUBIEXPORT int get_rendering_mode ()
 Get the current rendering mode.

CUBIEXPORT int get_pick_type ()
 Get the current pick type.


Mesh Query Support

CUBIEXPORT double get_meshed_volume_or_area (const std::string &geom_type, int entity_id)
 Get the total volume of a volume's mesh.

CUBIEXPORT int get_mesh_intervals (const std::string &geom_type, int entity_id)
 Get the interval count for a specified entity.

CUBIEXPORT double get_mesh_size (const std::string &geom_type, int entity_id)
 Get the mesh size for a specified entity.

CUBIEXPORT void get_quality_stats (const std::string &entity_type, std::vector< int > id_list, const std::string &metric_name, double threshold, bool use_low_threshold, double &min_value, double &max_value, double &mean_value, double &std_value, std::vector< int > &mesh_list, std::string element_type, int &bad_group_id, bool make_group=false)
 Get the quality stats for a specified entity.

CUBIEXPORT std::string get_mesh_scheme (const std::string &geom_type, int entity_id)
 Get the mesh scheme for the specified entity.

CUBIEXPORT bool is_meshed (const std::string &geom_type, int entity_id)
 Determines whether a specified entity is meshed.

CUBIEXPORT bool is_merged (const std::string &geom_type, int entity_id)
 Determines whether a specified entity is merged.

CUBIEXPORT std::string get_smooth_scheme (const std::string &geom_type, int entity_id)
 Get the smooth scheme for a specified entity.

CUBIEXPORT int get_hex_count ()
 Get the count of hexes in the model.

CUBIEXPORT int get_pyramid_count ()
 Get the count of pyramids in the model.

CUBIEXPORT int get_tet_count ()
 Get the count of tets in the model.

CUBIEXPORT int get_quad_count ()
 Get the count of quads in the model.

CUBIEXPORT int get_tri_count ()
 Get the count of tris in the model.

CUBIEXPORT int get_edge_count ()
 Get the count of edges in the model.

CUBIEXPORT int get_node_count ()
 Get the count of nodes in the model.

CUBIEXPORT int get_volume_element_count (int volume_id)
 Get the count of elements in a volume.

CUBIEXPORT int get_surface_element_count (int surface_id)
 Get the count of elements in a surface.

CUBIEXPORT std::vector< int > get_hex_sheet (int node_id_1, int node_id_2)
 Get the list of hex elements forming a hex sheet through the given two node ids. The nodes must be adjacent in the connectivity of the hex i.e. they form an edge of the hex.


Geometry Query Support

CUBIEXPORT bool is_visible (const std::string &geom_type, int entity_id)
 Query visibility for a specific entity.

CUBIEXPORT bool is_virtual (const std::string &geom_type, int entity_id)
 Query virtualality for a specific entity.

CUBIEXPORT std::vector< int > get_source_surfaces (int volume_id)
 Get a list of a volume's sweep source surfaces.

CUBIEXPORT std::vector< int > get_target_surfaces (int volume_id)
 Get a list of a volume's sweep target surfaces.

CUBIEXPORT int get_common_curve_id (int surface_1_id, int surface_2_id)
 Given 2 surfaces, get the common curve id.

CUBIEXPORT int get_common_vertex_id (int curve_1_id, int curve_2_id)
 Given 2 curves, get the common vertex id.

CUBIEXPORT std::string get_merge_setting (const std::string &geom_type, int entity_id)
 Get the merge setting for a specified entity.

CUBIEXPORT std::string get_curve_type (int curve_id)
 Get the curve type for a specified curve.

CUBIEXPORT std::string get_surface_type (int surface_id)
 Get the surface type for a specified surface.

CUBIEXPORT void get_surface_normal (int surface_id, double &x, double &y, double &z)
 Get the surface normal for a specified surface.

CUBIEXPORT void get_surface_centroid (int surface_id, double &x, double &y, double &z)
 Get the surface centroid for a specified surface.

CUBIEXPORT std::vector< std::string > get_entity_modeler_engine (const std::string &geom_type, int entity_id)
 Get the modeler engine type for a specified entity.

CUBIEXPORT std::vector< double > get_bounding_box (const std::string &geom_type, int entity_id)
 Get the bounding box for a specified entity.

CUBIEXPORT std::vector< double > get_total_bounding_box (const std::string &geom_type, std::vector< int > entity_list)
 Get the bounding box for a list of entities.

CUBIEXPORT double get_total_volume (std::vector< int > volume_list)
 Get the total volume for a list of volume ids.

CUBIEXPORT std::string get_entity_name (const std::string &geom_type, int entity_id)
 Get the name of a specified entity.

CUBIEXPORT int get_entity_color_index (const std::string &entity_type, int entity_id)
 Get the color of a specified entity.

CUBIEXPORT bool is_multi_volume (int body_id)
 Query whether a specified body is a multi volume body.

CUBIEXPORT bool is_interval_count_odd (int surface_id)
 Query whether a specified surface has an odd loop.

CUBIEXPORT bool is_periodic (const std::string &geom_type, int entity_id)
 Query whether a specified surface or curve is periodic.

CUBIEXPORT void get_periodic_data (const std::string &geom_type, int entity_id, double &interval, std::string &firmness, int &lower_bound, std::string &upper_bound)
 Get the periodic data for a surface or curve.

CUBIEXPORT bool get_node_constraint ()
 Query current setting for node constraint (move nodes to geometry).

CUBIEXPORT std::vector< int > get_relatives (const std::string &source_geom_type, int source_id, const std::string &target_geom_type)
 Get the relatives (parents/children) of a specified entity.

CUBIEXPORT std::vector< int > get_adjacent_surfaces (const std::string &geom_type, int entity_id)
 Get a list of adjacent surfaces to a specified entity.

CUBIEXPORT std::vector< int > get_adjacent_volumes (const std::string &geom_type, int entity_id)
 Get a list of adjacent volumes to a specified entity.

CUBIEXPORT std::vector< int > get_entities (const std::string &geom_type, bool include_sheet_bodies=false)
 Get all geometry entities of a specified type.

CUBIEXPORT std::vector< int > get_list_of_free_ref_entities (const std::string &geom_type)
 Get all free entities of a given geometry type.

CUBIEXPORT int get_owning_body (const std::string &geom_type, int entity_id)
 Get the owning body for a specified entity.

CUBIEXPORT int get_owning_volume (const std::string &geom_type, int entity_id)
 Get the owning volume for a specified entity.

CUBIEXPORT int get_owning_volume_by_name (const std::string &entity_name)
 Get the owning volume for a specified entity.

CUBIEXPORT double get_curve_length (int curve_id)
 Get the length of a specified curve.

CUBIEXPORT double get_arc_length (int curve_id)
 Get the arc length of a specified curve.

CUBIEXPORT double get_distance_from_curve_start (double x, double y, double z, int curve_id)
 Get the distance from a point on a curve to the curve's start point.

CUBIEXPORT double get_curve_radius (int curve_id)
 Get the radiuis of a specified curve.

CUBIEXPORT double get_surface_area (int surface_id)
 Get the area of a surface.

CUBIEXPORT double get_volume_area (int volume_id)
 Get the area of a volume.

CUBIEXPORT double get_hydraulic_radius_surface_area (int surface_id)
 Get the area of a hydraulic surface.

CUBIEXPORT double get_hydraulic_radius_volume_area (int volume_id)
 Get the area of a hydraulic volume.

CUBIEXPORT std::vector< double > get_center_point (const std::string &entity_type, int entity_id)
 Get the center point of a specified entity.

CUBIEXPORT int get_valence (int vertex_id)
 Get the valence for a specific vertex.

CUBIEXPORT void print_surface_summary_stats ()
 Print the surface summary stats to the console.

CUBIEXPORT void print_volume_summary_stats ()
 Print the volume summary stats to the console.

CUBIEXPORT void get_entity_info (RefEntity *source_entity, std::string &geom_type, int &entity_id)
 Get the geometry type and id given a ref entity.

CUBIEXPORT int get_volume_count ()
 Get the current number of volumes.

CUBIEXPORT int get_surface_count ()
 Get the current number of surfaces.

CUBIEXPORT int get_vertex_count ()
 Get the current number of vertices.

CUBIEXPORT int get_curve_count ()
 Get the current number of curves.

CUBIEXPORT bool is_granite_engine_available ()
 Determine whether pro-e/granite engine is available.


Geometry Repair Support

CUBIEXPORT void get_small_surfaces_hydraulic_radius (std::vector< int > target_volume_ids, double mesh_size, std::vector< int > &small_surfaces, std::vector< double > &small_radius)
 Get the list of small hydraulic radius surfaces for a list of volumes.

CUBIEXPORT void get_small_volumes_hydraulic_radius (std::vector< int > target_volume_ids, double mesh_size, std::vector< int > &small_volumes, std::vector< double > &small_radius)
 Get the list of small hydraulic radius volumes for a list of volumes.

CUBIEXPORT std::vector< int > get_small_curves (std::vector< int > target_volume_ids, double mesh_size)
 Get the list of small curves for a list of volumes.

CUBIEXPORT std::vector< int > get_small_surfaces (std::vector< int > target_volume_ids, double mesh_size)
 Get the list of small surfaces for a list of volumes.

CUBIEXPORT std::vector< int > get_small_volumes (std::vector< int > target_volume_ids, double mesh_size)
 Get the list of small volumes from a list of volumes.

CUBIEXPORT std::vector< int > get_blend_surfaces (std::vector< int > target_volume_ids)
 Get the list of blend surfaces for a list of volumes.

CUBIEXPORT std::vector< int > get_small_loops (std::vector< int > target_volume_ids, double mesh_size)
 Get the list of close loops (surfaces) for a list of volumes.

CUBIEXPORT std::vector< int > get_tangential_intersections (std::vector< int > target_volume_ids, double upper_bound, double lower_bound)
 Get the list of bad tangential intersections for a list of volumes.

CUBIEXPORT void get_sharp_surface_angles (std::vector< int > target_volume_ids, std::vector< int > &large_surface_angles, std::vector< int > &small_surface_angles, std::vector< double > &large_angles, std::vector< double > &small_angles, double upper_bound, double lower_bound)
 Get the list of sharp surface angles for a list of volumes.

CUBIEXPORT void get_sharp_curve_angles (std::vector< int > target_volume_ids, std::vector< int > &large_curve_angles, std::vector< int > &small_curve_angles, std::vector< double > &large_angles, std::vector< double > &small_angles, double upper_bound, double lower_bound)
 Get the list of sharp curve angles for a list of volumes.

CUBIEXPORT void get_bad_geometry (std::vector< int > target_volume_ids, std::vector< int > &body_list, std::vector< int > &volume_list, std::vector< int > &surface_list, std::vector< int > &curve_list)
 Get the list of bad geometry for a list of volumes.

CUBIEXPORT void get_overlapping_surfaces (std::vector< int > target_volume_ids, std::vector< int > &surf_list_1, std::vector< int > &surf_list_2)
 Get the list of overlapping surfaces for a list of volumes.

CUBIEXPORT void get_overlapping_volumes (std::vector< int > target_volume_ids, std::vector< int > &volume_list)
 Get the list of overlapping volumes for a list of volumes.

CUBIEXPORT void get_mergeable_entities (std::vector< int > target_volume_ids, std::vector< std::vector< int > > &surface_list, std::vector< std::vector< int > > &curve_list, std::vector< std::vector< int > > &vertex_list)
 Get the list of mergeable entities from a list of volumes.


Blocks, Sidesets, and Nodesets

CUBIEXPORT std::string get_exodus_entity_name (std::string entity_type, int entity_id)
 Get the name associated with an exodus entity.

CUBIEXPORT std::string get_exodus_entity_description (std::string entity_type, int entity_id)
 Get the description associated with an exodus entity.

CUBIEXPORT std::vector< double > get_all_exodus_times (const std::string &filename)
 Open an exodus file and get a vector of all stored time stamps.

CUBIEXPORT int get_block_id (std::string entity_type, int entity_id)
 Get the associated block id for a specific curve, surface, or volume.

CUBIEXPORT std::vector< int > get_block_ids (const std::string &mesh_geom_file_name)
 Get list of block ids from a mesh geometry file.

CUBIEXPORT std::vector< int > get_block_id_list ()
 Get a list of all blocks.

CUBIEXPORT std::vector< int > get_nodeset_id_list ()
 Get a list of all nodesets.

CUBIEXPORT std::vector< int > get_sideset_id_list ()
 Get a list of all sidesets.

CUBIEXPORT int get_next_sideset_id ()
 Get a next available sideset id.

CUBIEXPORT int get_next_nodeset_id ()
 Get a next available nodeset id.

CUBIEXPORT int get_next_block_id ()
 Get a next available block id.

CUBIEXPORT void get_block_children (int block_id, std::vector< int > &group_list, std::vector< int > &node_list, std::vector< int > &edge_list, std::vector< int > &tri_list, std::vector< int > &face_list, std::vector< int > &pyramid_list, std::vector< int > &tet_list, std::vector< int > &hex_list, std::vector< int > &volume_list, std::vector< int > &surface_list, std::vector< int > &curve_list, std::vector< int > &vertex_list)
 Get lists of any and all possible children of a block.

CUBIEXPORT void get_nodeset_children (int nodeset_id, std::vector< int > &node_list, std::vector< int > &volume_list, std::vector< int > &surface_list, std::vector< int > &curve_list, std::vector< int > &vertex_list)
 get lists of any and all possible children of a nodeset

CUBIEXPORT void get_sideset_children (int sideset_id, std::vector< int > &face_list, std::vector< int > &surface_list, std::vector< int > &curve_list)
 get lists of any and all possible children of a sideset

CUBIEXPORT std::vector< int > get_block_groups (int block_id)
 Get a list of group ids associated with a specific block.

CUBIEXPORT std::vector< int > get_block_volumes (int block_id)
 Get a list of volume ids associated with a specific block.

CUBIEXPORT std::vector< int > get_block_surfaces (int block_id)
 Get a list of surface associated with a specific block.

CUBIEXPORT std::vector< int > get_block_curves (int block_id)
 Get a list of curve associated with a specific block.

CUBIEXPORT std::vector< int > get_block_vertices (int block_id)
 Get a list of vertices associated with a specific block.

CUBIEXPORT std::vector< int > get_block_nodes (int block_id)
 Get a list of nodes associated with a specific block.

CUBIEXPORT std::vector< int > get_block_edges (int block_id)
 Get a list of edges associated with a specific block.

CUBIEXPORT std::vector< int > get_block_tris (int block_id)
 Get a list of tris associated with a specific block.

CUBIEXPORT std::vector< int > get_block_faces (int block_id)
 Get a list of faces associated with a specific block.

CUBIEXPORT std::vector< int > get_block_pyramids (int block_id)
 Get a list of pyramids associated with a specific block.

CUBIEXPORT std::vector< int > get_block_tets (int block_id)
 Get a list of tets associated with a specific block.

CUBIEXPORT std::vector< int > get_block_hexes (int block_id)
 Get a list of hexes associated with a specific block.

CUBIEXPORT std::vector< int > get_nodeset_volumes (int nodeset_id)
 Get a list of volume ids associated with a specific nodeset.

CUBIEXPORT std::vector< int > get_nodeset_surfaces (int nodeset_id)
 Get a list of surface ids associated with a specific nodeset.

CUBIEXPORT std::vector< int > get_nodeset_curves (int nodeset_id)
 Get a list of curve ids associated with a specific nodeset.

CUBIEXPORT std::vector< int > get_nodeset_vertices (int nodeset_id)
 Get a list of vertex ids associated with a specific nodeset.

CUBIEXPORT std::vector< int > get_nodeset_nodes (int nodeset_id)
 Get a list of node ids associated with a specific nodeset.

CUBIEXPORT std::vector< int > get_sideset_curves (int sideset_id)
 Get a list of curve ids associated with a specific sideset.

CUBIEXPORT std::vector< int > get_sideset_surfaces (int sideset_id)
 Get a list of any surfaces in a sideset.

CUBIEXPORT std::vector< int > get_sideset_quads (int sideset_id)
 Get a list of any quads in a sideset.

CUBIEXPORT std::vector< int > get_surface_quads (int surface_id)
 get the list of any quad elements on a given surface

CUBIEXPORT std::string get_entity_sense (std::string source_type, int source_id, int sideset_id)
 Get the sense of a sideset item.

CUBIEXPORT std::string get_wrt_entity (std::string source_type, int source_id, int sideset_id)
 Get the with-respect-to entity.

CUBIEXPORT bool is_using_shells (int sideset_id)
 Get the shell use for a sideset.

CUBIEXPORT std::vector< std::string > get_geometric_owner (std::string mesh_entity_type, std::string mesh_entity_list)
 Get a list of geometric owners given a list of mesh entities.


Group Support

CUBIEXPORT int get_id_from_name (const std::string &name)
 Get id for a named entity.

CUBIEXPORT void get_group_children (int group_id, std::vector< int > &group_list, std::vector< int > &body_list, std::vector< int > &volume_list, std::vector< int > &surface_list, std::vector< int > &curve_list, std::vector< int > &vertex_list, int &node_count, int &edge_count, int &hex_count, int &quad_count, int &tet_count, int &tri_count)
 Get group children.

CUBIEXPORT std::vector< int > get_group_groups (int group_id)
 Get group groups (groups that are children of another group).

CUBIEXPORT std::vector< int > get_group_volumes (int group_id)
 Get group volumes (volumes that are children of a group).

CUBIEXPORT std::vector< int > get_group_surfaces (int group_id)
 Get group surfaces (surfaces that are children of a group).

CUBIEXPORT std::vector< int > get_group_curves (int group_id)
 Get group curves (curves that are children of a group).

CUBIEXPORT std::vector< int > get_group_vertices (int group_id)
 Get group vertices (vertices that are children of a group).

CUBIEXPORT std::vector< int > get_group_nodes (int group_id)
 Get group nodes (nodes that are children of a group).

CUBIEXPORT std::vector< int > get_group_edges (int group_id)
 Get group edges (edges that are children of a group).

CUBIEXPORT std::vector< int > get_group_quads (int group_id)
 Get group quads (quads that are children of a group).

CUBIEXPORT std::vector< int > get_group_tris (int group_id)
 Get group tris (tris that are children of a group).

CUBIEXPORT std::vector< int > get_group_tets (int group_id)
 Get group tets (tets that are children of a group).

CUBIEXPORT std::vector< int > get_group_hexes (int group_id)
 Get group hexes (hexes that are children of a group).

CUBIEXPORT void delete_all_groups ()
 Delete all groups.

CUBIEXPORT void delete_group (int group_id)
 Delete a specific group.

CUBIEXPORT void remove_entity_from_group (int group_id, int entity_id, const std::string &entity_type)
 Remove a specific entity from a specific group.

CUBIEXPORT void group_list (std::vector< std::string > &name_list, std::vector< int > &id_list)
 Get the names and ids of all the groups (excluding the pick group) that are defined by the current cubit session.

CUBIEXPORT std::vector< int > get_mesh_group_parent_ids (const std::string &element_type, int element_id)
 Get the group ids which are parents to the indicated mesh element.

CUBIEXPORT bool is_mesh_element_in_group (const std::string &element_type, int element_id)
 Indicates whether a mesh element is in a group.


General Purpose Utility

CUBIEXPORT bool is_part_of_list (int target_id, std::vector< int > id_list)
 Routine to check for the presence of an id in a list of ids.

CUBIEXPORT int get_last_id (const std::string &entity_type)
 Get the id of the last created entity of the given type.


Metadata Support

CUBIEXPORT std::string get_assembly_metadata (int volume_id, int data_type)
 Get metadata for a specified volume id.

CUBIEXPORT bool is_assembly_metadata_attached (int volume_id)
 Determine whether metadata is attached to a specified volume.

CUBIEXPORT std::string get_assembly_name (const std::string assembly_path)
 Get the stored name of an assembly node.

CUBIEXPORT std::string get_assembly_description (const std::string assembly_path)
 Get the stored description of an assembly node.

CUBIEXPORT int get_assembly_instance (const std::string assembly_path)
 Get the stored instance number of an assembly node.

CUBIEXPORT std::string get_assembly_file_format (const std::string assembly_path)
 Get the stored file format of an assembly node.

CUBIEXPORT std::string get_assembly_units (const std::string assembly_path)
 Get the stored units measure of an assembly node.

CUBIEXPORT std::string get_assembly_material_description (const std::string assembly_path)
 Get the stored material description of an assembly part.

CUBIEXPORT std::string get_assembly_material_specification (const std::string assembly_path)
 Get the stored material specification of an assembly part.


Mesh Element Queries

CUBIEXPORT int get_exodus_id (const std::string &entity_type, int entity_id)
 Get the exodus/genesis id for this element.

CUBIEXPORT std::string get_geometry_owner (const std::string &entity_type, int entity_id)
 Get the geometric owner of this mesh element.

CUBIEXPORT std::vector< int > get_connectivity (const std::string &entity_type, int entity_id)
 Get the list of node ids contained within a mesh entity.

CUBIEXPORT std::vector< int > get_sub_elements (const std::string &entity_type, int entity_id, int dimension)
 Get the lower dimesion entities associated with a higher dimension entities. For example get the faces associated with a hex or the edges associated with a tri.

CUBIEXPORT std::vector< double > get_nodal_coordinates (int node_id)
 Get the nodal coordinates for a given node id.

CUBIEXPORT std::string get_block_element_type (int block_id)
 Get the element type of a block.

CUBIEXPORT int get_exodus_element_count (int entity_id, std::string entity_type)
 Get the number of elements in a exodus entity.

CUBIEXPORT int get_block_attribute_count (int block_id)
 Get the number of attributes in a block.

CUBIEXPORT double get_block_attribute_value (int block_id, int index)
 Get a specific block attribute value.

CUBIEXPORT std::vector< std::string > get_valid_block_element_types (int block_id)
 Get a list of potential element types for a block.

CUBIEXPORT int get_nodeset_node_count (int nodeset_id)
 Get the number of nodes in a nodeset.


Functions

CUBIEXPORT std::vector< AssemblyItem * > get_assembly_items ()
CUBIEXPORT std::vector< int > get_volumes_for_node (std::string node_name, int node_instance)


Detailed Description

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

The purpose of CubitInterface is to provide developers with a query interface into Cubit. With very few exceptions, the functions in CubitInterface will not change Cubit's state. The function, "set_cubit_interrupt" will set a global flag indicating to Cubit that interruptable processes may be halted. Also, the functions "cmd" and "silent_cmd" take actual Cubit command-line directives as input. All other functions provide query access into Cubit.

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

CUBIEXPORT void cmd const char *  input_string  ) 
 

Pass a command string into Cubit.

Passing a command into Cubit using this method will result in an immediate execution of the command. The command is passed directly to Cubit without any validation or other checking.

CubitInterface::cmd("create brick x 10");
cubit.cmd("brick x 10")
Parameters:
input_string Pointer to a string containing a complete Cubit command

CUBIEXPORT void copy_next_script_line std::string &  buffer  ) 
 

CUBIEXPORT void delete_all_groups  ) 
 

Delete all groups.

CUBIEXPORT void delete_group int  group_id  ) 
 

Delete a specific group.

Parameters:
group_id ID of group to delete

CUBIEXPORT void destroy  ) 
 

CUBIEXPORT std::string get_acis_version  ) 
 

Get the Acis version number.

Returns:
A string containing the Acis version number

CUBIEXPORT std::vector<int> get_adjacent_surfaces const std::string &  geom_type,
int  entity_id
 

Get a list of adjacent surfaces to a specified entity.

For a specified entity, find all surfaces that own the entity and surfaces that touch the surface that owns this entity.

std::vector<int> surface_id_list; surface_id_list = CubitInterface::get_adjacent_surfaces("curve", 22);
surface_id_list = cubit.get_adjacent_surfaces("curve", 22)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
A list of surfaces ids

CUBIEXPORT std::vector<int> get_adjacent_volumes const std::string &  geom_type,
int  entity_id
 

Get a list of adjacent volumes to a specified entity.

For a specified entity, find all volumes that own the entity and volumes that touch the volume that owns this entity.

std::vector<int> volume_id_list; volume_id_list = CubitInterface::get_adjacent_volumes("curve", 22);
volume_id_list = cubit.get_adjacent_volumes("curve", 22)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
A list of volume ids

CUBIEXPORT std::vector<double> get_all_exodus_times const std::string &  filename  ) 
 

Open an exodus file and get a vector of all stored time stamps.

Parameters:
filename Fully qualified exodus file name
Returns:
List of time stamps in the exodus file

CUBIEXPORT double get_arc_length int  curve_id  ) 
 

Get the arc length of a specified curve.

Parameters:
curve_id ID of the curve
Returns:
Arc length of the curve

CUBIEXPORT std::string get_assembly_description const std::string  assembly_path  ) 
 

Get the stored description of an assembly node.

Parameters:
assembly_path Path that identifies the assembly node
Returns:
Description of the assembly node

CUBIEXPORT std::string get_assembly_file_format const std::string  assembly_path  ) 
 

Get the stored file format of an assembly node.

Parameters:
assembly_path Path that identifies the assembly node
Returns:
File Format of the assembly node

CUBIEXPORT int get_assembly_instance const std::string  assembly_path  ) 
 

Get the stored instance number of an assembly node.

Parameters:
assembly_path Path that identifies the assembly node
Returns:
Instance of the assembly node

CUBIEXPORT std::vector<AssemblyItem*> get_assembly_items  ) 
 

CUBIEXPORT std::string get_assembly_material_description const std::string  assembly_path  ) 
 

Get the stored material description of an assembly part.

Parameters:
assembly_path Path that identifies the assembly part
Returns:
Material Description of the assembly part

CUBIEXPORT std::string get_assembly_material_specification const std::string  assembly_path  ) 
 

Get the stored material specification of an assembly part.

Parameters:
assembly_path Path that identifies the assembly part
Returns:
Material Specification of the assembly part

CUBIEXPORT std::string get_assembly_metadata int  volume_id,
int  data_type
 

Get metadata for a specified volume id.

Parameters:
volume_id ID of the volume
data_type Magic number representing the type of assembly information to return. 1 = Part Number, 2 = Description, 3 = Material Description 4 = Material Specification, 5 = Assembly Path, 6 = Original File
Returns:
Requested data

CUBIEXPORT std::string get_assembly_name const std::string  assembly_path  ) 
 

Get the stored name of an assembly node.

Parameters:
assembly_path Path that identifies the assembly node
Returns:
Name of the assembly node

CUBIEXPORT std::string get_assembly_units const std::string  assembly_path  ) 
 

Get the stored units measure of an assembly node.

Parameters:
assembly_path Path that identifies the assembly node
Returns:
Units of the assembly node

CUBIEXPORT void get_bad_geometry std::vector< int >  target_volume_ids,
std::vector< int > &  body_list,
std::vector< int > &  volume_list,
std::vector< int > &  surface_list,
std::vector< int > &  curve_list
 

Get the list of bad geometry for a list of volumes.

Bad geometry can be any number of problems associated with poorly defined ACIS geometry.

Parameters:
target_volume_ids List of volume ids to examine.
body_list User specified list where ids of bad bodies will be returned
volume_list User specified list where ids of bad volumes will be returned
surface_list User specified list where ids of bad surfaces will be returned
curve_list User specified list where ids of bad curves will be returned

CUBIEXPORT std::vector<int> get_blend_surfaces std::vector< int >  target_volume_ids  ) 
 

Get the list of blend surfaces for a list of volumes.

Parameters:
target_volume_ids List of volume ids to examine. List of blend surface ids

CUBIEXPORT int get_block_attribute_count int  block_id  ) 
 

Get the number of attributes in a block.

Parameters:
block_id The block id
Returns:
Number of attributes in the block

CUBIEXPORT double get_block_attribute_value int  block_id,
int  index
 

Get a specific block attribute value.

Parameters:
block_id The block id
index The index of the attribute
Returns:
List of attributes

CUBIEXPORT void get_block_children int  block_id,
std::vector< int > &  group_list,
std::vector< int > &  node_list,
std::vector< int > &  edge_list,
std::vector< int > &  tri_list,
std::vector< int > &  face_list,
std::vector< int > &  pyramid_list,
std::vector< int > &  tet_list,
std::vector< int > &  hex_list,
std::vector< int > &  volume_list,
std::vector< int > &  surface_list,
std::vector< int > &  curve_list,
std::vector< int > &  vertex_list
 

Get lists of any and all possible children of a block.

A block can contain a variety of entity types. This routine will return all contents of a specified block.

Parameters:
block_id ID of block to examine
group_list User specified list where groups associated with this block are returned
node_list User specified list where nodes associated with this block are returned
edge_list User specified list where edges associated with this block are returned
tri_list User specified list where tris associated with this block are returned
face_list User specified list where faces associated with this block are returned
pyramid_list User specified list where pyramids associated with this block are returned
tet_list User specified list where tets associated with this block are returned
hex_list User specified list where hexes associated with this block are returned
volume_list User specified list where volumes associated with this block are returned
surface_list User specified list where surfaces associated with this block are returned
curve_list User specified list where curves associated with this block are returned
vertex_list User specified list where vertices associated with this block are returned

CUBIEXPORT std::vector<int> get_block_curves int  block_id  ) 
 

Get a list of curve associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of curve ids contained in the block

CUBIEXPORT std::vector<int> get_block_edges int  block_id  ) 
 

Get a list of edges associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of edge ids contained in the block

CUBIEXPORT std::string get_block_element_type int  block_id  ) 
 

Get the element type of a block.

Parameters:
block_id The block id
Returns:
Element type

CUBIEXPORT std::vector<int> get_block_faces int  block_id  ) 
 

Get a list of faces associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of face ids contained in the block

CUBIEXPORT std::vector<int> get_block_groups int  block_id  ) 
 

Get a list of group ids associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of group ids contained in the block

CUBIEXPORT std::vector<int> get_block_hexes int  block_id  ) 
 

Get a list of hexes associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of hex ids contained in the block

CUBIEXPORT int get_block_id std::string  entity_type,
int  entity_id
 

Get the associated block id for a specific curve, surface, or volume.

int block_id = CubitInterface::get_block_id("surface", 33);
block_id = cubit.get_block_id("surface", 33)
Parameters:
entity_type Type of entity
entity_id Id of entity in question
Returns:
Block id associated with this entity or zero (0) if none

CUBIEXPORT std::vector<int> get_block_id_list  ) 
 

Get a list of all blocks.

Returns:
List of all active block ids

CUBIEXPORT std::vector<int> get_block_ids const std::string &  mesh_geom_file_name  ) 
 

Get list of block ids from a mesh geometry file.

Parameters:
mesh_geom_file_name Fully qualified name of a mesh geometry file
Returns:
List of block ids in the mesh geometry file

CUBIEXPORT std::vector<int> get_block_nodes int  block_id  ) 
 

Get a list of nodes associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of node ids contained in the block

CUBIEXPORT std::vector<int> get_block_pyramids int  block_id  ) 
 

Get a list of pyramids associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of pyramid ids contained in the block

CUBIEXPORT std::vector<int> get_block_surfaces int  block_id  ) 
 

Get a list of surface associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of surface ids contained in the block

CUBIEXPORT std::vector<int> get_block_tets int  block_id  ) 
 

Get a list of tets associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of tet ids contained in the block

CUBIEXPORT std::vector<int> get_block_tris int  block_id  ) 
 

Get a list of tris associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of tri ids contained in the block

CUBIEXPORT std::vector<int> get_block_vertices int  block_id  ) 
 

Get a list of vertices associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of vertex ids contained in the block

CUBIEXPORT std::vector<int> get_block_volumes int  block_id  ) 
 

Get a list of volume ids associated with a specific block.

Parameters:
block_id User specified id of the desired block
Returns:
A list of volume ids contained in the block

CUBIEXPORT std::vector<double> get_bounding_box const std::string &  geom_type,
int  entity_id
 

Get the bounding box for a specified entity.

std::vector<double> vector_list; vector_list = CubitInterface::get_bounding_box("surface", 22);
vector_list = cubit.get_bounding_box("surface", 22)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
A vector of coordinates for the entity's bounding box. Twelve (12) values will be returned in xyz set order repeated four (4) times per set.

CUBIEXPORT std::string get_build_number  ) 
 

Get the Cubit build number.

Returns:
A string containing the current Cubit build number

CUBIEXPORT std::vector<double> get_center_point const std::string &  entity_type,
int  entity_id
 

Get the center point of a specified entity.

std::vector<double> center_point; center_point = CubitInterface::get_center_point("surface", 22);
center_point = cubit.get_center_point("surface", 22)
Parameters:
entity_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
Vector of doubles representing x y z

CUBIEXPORT int get_common_curve_id int  surface_1_id,
int  surface_2_id
 

Given 2 surfaces, get the common curve id.

Parameters:
surface_1_id The id of one of the surfaces
surface_2_id The id of the other surface
Returns:
The id of the curve common to the two surfaces

CUBIEXPORT int get_common_vertex_id int  curve_1_id,
int  curve_2_id
 

Given 2 curves, get the common vertex id.

Parameters:
curve_1_id The id of one of the curves
curve_2_id The id of the other curves
Returns:
The id of the vertex common to the two curves

CUBIEXPORT std::vector<int> get_connectivity const std::string &  entity_type,
int  entity_id
 

Get the list of node ids contained within a mesh entity.

std::vector<int> node_id_list; node_id_list = CubitInterface::get_connectivity("hex", 221);
node_id_list = cubit.get_connectivity("hex", 221)
Parameters:
entity_type The mesh element type
entity_id The mesh element id
Returns:
List of node ids

CUBIEXPORT int get_curve_count  ) 
 

Get the current number of curves.

Returns:
The number of curves in the current model, if any

CUBIEXPORT double get_curve_length int  curve_id  ) 
 

Get the length of a specified curve.

Parameters:
curve_id ID of the curve
Returns:
Length of the curve

CUBIEXPORT double get_curve_radius int  curve_id  ) 
 

Get the radiuis of a specified curve.

Parameters:
curve_id ID of the curve
Returns:
Radius of the curve

CUBIEXPORT std::string get_curve_type int  curve_id  ) 
 

Get the curve type for a specified curve.

Parameters:
curve_id ID of the curve
Returns:
Type of curve

CUBIEXPORT double get_distance_from_curve_start double  x,
double  y,
double  z,
int  curve_id
 

Get the distance from a point on a curve to the curve's start point.

Parameters:
x value of the point to measure
y value of the point to measure
z value of the point to measure
curve_id ID of the curve
Returns:
Distance from the xyz to the curve start

CUBIEXPORT int get_edge_count  ) 
 

Get the count of edges in the model.

Returns:
The number of edges in the model

CUBIEXPORT std::vector<int> get_entities const std::string &  geom_type,
bool  include_sheet_bodies = false
 

Get all geometry entities of a specified type.

std::vector<int> entity_id_list; entity_id_list = CubitInterface::get_entities("volume");
entity_id_list = cubit.get_entities("volume")
Parameters:
geom_type Specifies the geometry type of the entity
include_sheet_bodies If true, then those routines requesting volumes or bodies will have sheet bodies returned. Normally, when requesting volume lists, sheet bodies are specifically excluded. Some parts of the Cubit interface need to see sheet bodies when requesting volumes, hence, the parameter.
Returns:
A list of ids of the specified geometry type

CUBIEXPORT int get_entity_color_index const std::string &  entity_type,
int  entity_id
 

Get the color of a specified entity.

int color_index = CubitInterface::get_entity_color_index("curve", 33);
color_index = cubit.get_entity_color_index("curve", 33)
Parameters:
entity_type Specifies the type of the entity
entity_id Specifies the id of the entity
Returns:
The color of the entity

CUBIEXPORT void get_entity_info RefEntity *  source_entity,
std::string &  geom_type,
int &  entity_id
 

Get the geometry type and id given a ref entity.

Parameters:
source_entity Pointer to a ref entity
geom_type User specified variable where the geometry type will be returned
entity_id User specified variable where the entity id will be returned

CUBIEXPORT std::vector<std::string> get_entity_modeler_engine const std::string &  geom_type,
int  entity_id
 

Get the modeler engine type for a specified entity.

std::vector<std::string> engine_list; engine_list = CubitInterface::get_entity_modeler_engine("surface", 47);
engine_list = cubit.get_entity_modeler_engine("surface", 47)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
A vector of modeler engines associated with this entity

CUBIEXPORT std::string get_entity_name const std::string &  geom_type,
int  entity_id
 

Get the name of a specified entity.

Names returned are of two types: 1) user defined names which are actually stored in Cubit when the name is defined, and 2) 'default' names supplied by Cubit at run-time which are not stored in Cubit. The second variety of name cannot be used to query Cubit.

std::string name = CubitInterface::get_entity_name("vertex", 22);
name = cubit.get_entity_name("vertex", 22)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
The name of the entity

CUBIEXPORT std::string get_entity_sense std::string  source_type,
int  source_id,
int  sideset_id
 

Get the sense of a sideset item.

std::string sense; sense = CubitInterface::get_entity_sense("face", 332, 2);
sense = cubit.get_entity_sense("face", 332, 2)
Parameters:
source_type Item type - could be 'face', 'surface' or 'curve'
source_id ID of entity
sideset_id ID of the sideset
Returns:
Sense of the source_type/source_id in specified sideset

CUBIEXPORT int get_error_count  ) 
 

Get the number of errors in the current Cubit session.

Returns:
The number of errors in the Cubit session.

CUBIEXPORT int get_exodus_element_count int  entity_id,
std::string  entity_type
 

Get the number of elements in a exodus entity.

int element_count = CubitInterface::get_exodus_element_count(2, "sideset");
element_count = cubit.get_exodus_element_count(2, "sideset")
Parameters:
entity_id The id of the entity
entity_type The type of the entity
Returns:
Number of Elements

CUBIEXPORT std::string get_exodus_entity_description std::string  entity_type,
int  entity_id
 

Get the description associated with an exodus entity.

std::string entity_description; entity_description = CubitInterface::get_exodus_entity_description("sideset", 33);
entity_description = cubit.get_exodus_entity_description("sideset", 33)
Parameters:
entity_type "block", "sideset", nodeset"
entity_id Id of the entity in question
Returns:
Description of the entity or "" if none

CUBIEXPORT std::string get_exodus_entity_name std::string  entity_type,
int  entity_id
 

Get the name associated with an exodus entity.

std::string entity_name; entity_name = CubitInterface::get_exodus_entity_name("sideset", 33);
entity_name = cubit.get_exodus_entity_name("sideset", 33)
Parameters:
entity_type "block", "sideset", nodeset"
entity_id Id of the entity in question
Returns:
Name of the entity or "" if none

CUBIEXPORT int get_exodus_id const std::string &  entity_type,
int  entity_id
 

Get the exodus/genesis id for this element.

int exodus_id = CubitInterface::get_exodus_id("hex", 221);
exodus_id = cubit.get_exodus_id("hex", 221)
Parameters:
entity_type The mesh element type
entity_id The mesh element id
Returns:
Exodus id of the element if element has been written out, otherwise 0

CUBIEXPORT std::string get_exodus_version  ) 
 

Get the Exodus version number.

Returns:
A string containing the Exodus version number

CUBIEXPORT std::vector<std::string> get_geometric_owner std::string  mesh_entity_type,
std::string  mesh_entity_list
 

Get a list of geometric owners given a list of mesh entities.

std::vector<std::string> owner_list; owner_list = CubitInterface::get_geometric_owner("quad", id_list);
owner_list = cubit.get_geometric_owner("quad", id_list)
Parameters:
mesh_entity_type The type of mesh entity
mesh_entity_list A string containing space delimited ids
Returns:
A list of geometry owners in the form of 'surface x', 'curve y', etc.

CUBIEXPORT std::string get_geometry_owner const std::string &  entity_type,
int  entity_id
 

Get the geometric owner of this mesh element.

std::string geom_owner = CubitInterface::get_geometry_owner("hex", 221);
geom_owner = cubit.get_geometry_owner("hex", 221)
Parameters:
entity_type The mesh element type
entity_id The mesh element id
Returns:
Name of owner

CUBIEXPORT std::string get_graphics_version  ) 
 

Get the VTK version number.

Returns:
A string containing the VTK version number

CUBIEXPORT void get_group_children int  group_id,
std::vector< int > &  group_list,
std::vector< int > &  body_list,
std::vector< int > &  volume_list,
std::vector< int > &  surface_list,
std::vector< int > &  curve_list,
std::vector< int > &  vertex_list,
int &  node_count,
int &  edge_count,
int &  hex_count,
int &  quad_count,
int &  tet_count,
int &  tri_count
 

Get group children.

This routine returns a list for each geometry entity type in the group. Since groups may contain both geometry and mesh entities, this routine also returns the count of any mesh entity contained in the group. For groups contained in the group, the group_list will only contain one generation. In other words, if this routine is examining Group ABC, and Group ABC contains Group XYZ and Group XYZ happens to contain other groups (which in turn may contain other groups) this routine will only return the id of Group XYZ.

Parameters:
group_id ID of the group to examine
group_list User specified list where group ids will be returned
body_list User specified list where body ids will be returned
volume_list User specified list where volume ids will be returned
surface_list User specified list where surface ids will be returned
curve_list User specified list where curve ids will be returned
vertex_list User specified list where vertex ids will be returned
node_count User specified variable where the number of nodes will be returned
edge_count User specified variable where the number of edges will be returned
hex_count User specified variable where the number of hexes will be returned
quad_count User specified variable where the number of quads will be returned
tet_count User specified variable where the number of tets will be returned
tri_count User specified variable where the number of tris will be returned

CUBIEXPORT std::vector<int> get_group_curves int  group_id  ) 
 

Get group curves (curves that are children of a group).

This routine returns a list of curves that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of curve ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_edges int  group_id  ) 
 

Get group edges (edges that are children of a group).

This routine returns a list of edges that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of edge ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_groups int  group_id  ) 
 

Get group groups (groups that are children of another group).

This routine returns a list a groups that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of group ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_hexes int  group_id  ) 
 

Get group hexes (hexes that are children of a group).

This routine returns a list of hexes that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of hex ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_nodes int  group_id  ) 
 

Get group nodes (nodes that are children of a group).

This routine returns a list of nodes that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of node ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_quads int  group_id  ) 
 

Get group quads (quads that are children of a group).

This routine returns a list of quads that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of quad ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_surfaces int  group_id  ) 
 

Get group surfaces (surfaces that are children of a group).

This routine returns a list of surfaces that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of surface ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_tets int  group_id  ) 
 

Get group tets (tets that are children of a group).

This routine returns a list of tets that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of tet ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_tris int  group_id  ) 
 

Get group tris (tris that are children of a group).

This routine returns a list of tris that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of tri ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_vertices int  group_id  ) 
 

Get group vertices (vertices that are children of a group).

This routine returns a list of vertices that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of vertex ids contained in the specified group

CUBIEXPORT std::vector<int> get_group_volumes int  group_id  ) 
 

Get group volumes (volumes that are children of a group).

This routine returns a list of volumes that are contained in a specified group.

Parameters:
group_id ID of the group to examine return List of volume ids contained in the specified group

CUBIEXPORT int get_hex_count  ) 
 

Get the count of hexes in the model.

Returns:
The number of hexes in the model

CUBIEXPORT std::vector<int> get_hex_sheet int  node_id_1,
int  node_id_2
 

Get the list of hex elements forming a hex sheet through the given two node ids. The nodes must be adjacent in the connectivity of the hex i.e. they form an edge of the hex.

Returns:
A list of hex ids in the hex sheet

CUBIEXPORT double get_hydraulic_radius_surface_area int  surface_id  ) 
 

Get the area of a hydraulic surface.

Parameters:
surface_id ID of the surface
Returns:
Hydraulic area of the surface

CUBIEXPORT double get_hydraulic_radius_volume_area int  volume_id  ) 
 

Get the area of a hydraulic volume.

Parameters:
volume_id ID of the volume
Returns:
Hydraulic area of the volume

CUBIEXPORT int get_id_from_name const std::string &  name  ) 
 

Get id for a named entity.

This routine returns an integer id for the group whose name is passed in.

int group_id = CubitInterface::get_id_from_name("Assembly_2");
group_id = cubit.get_id_from_name("Assembly_2")
Parameters:
name Name of the group to examine return Integer representing the group

CUBIEXPORT int get_last_id const std::string &  entity_type  ) 
 

Get the id of the last created entity of the given type.

int last_id = CubitInterface::get_last_id("surface");
last_id = cubit.get_last_id("surface")
Parameters:
entity_type Type of the entity being queried
Returns:
Integer id of last created entity

CUBIEXPORT std::vector<int> get_list_of_free_ref_entities const std::string &  geom_type  ) 
 

Get all free entities of a given geometry type.

std::vector<int> free_curve_id_list; free_curve_id_list = CubitInterface::get_list_of_free_ref_entities("curve");
free_curve_id_list = cubit.get_list_of_free_ref_entities("curve")
Parameters:
geom_type Specifies the geometry type of the free entity
Returns:
A list of ids of the specified geometry type

CUBIEXPORT std::string get_merge_setting const std::string &  geom_type,
int  entity_id
 

Get the merge setting for a specified entity.

std::string merge_setting = CubitInterface::get_merge_setting("surface", 33);
merge_setting = cubit.get_merge_setting("surface", 33)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
A text string that indicates the merge setting for the entity

CUBIEXPORT void get_mergeable_entities std::vector< int >  target_volume_ids,
std::vector< std::vector< int > > &  surface_list,
std::vector< std::vector< int > > &  curve_list,
std::vector< std::vector< int > > &  vertex_list
 

Get the list of mergeable entities from a list of volumes.

Given a list of volume ids, this will return 3 lists of potential merge candidates. The returned lists include lists of the merge partners.

Parameters:
target_volume_ids List of volume ids to examine.
surface_list User specified list where mergeable surfaces will be stored
curve_list User specified list where mergeable curves will be stored
vertex_list User specified list where mergeable vertices will be stored

CUBIEXPORT std::vector<int> get_mesh_group_parent_ids const std::string &  element_type,
int  element_id
 

Get the group ids which are parents to the indicated mesh element.

std::vector<int> parent_id_list; parent_id_list = CubitInterface::get_mesh_group_parent_ids("tri", 332);
parent_id_list = cubit.get_mesh_group_parent_ids("tri", 332)
Parameters:
element_type Mesh type of the element
element_id ID of the mesh element return List of group ids that contain this mesh element

CUBIEXPORT int get_mesh_intervals const std::string &  geom_type,
int  entity_id
 

Get the interval count for a specified entity.

int intervals = CubitInterface::get_meshed_intervals("surface", 12);
intervals = cubit.get_meshed_intervals("surface", 12)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
The entity's interval count

CUBIEXPORT std::string get_mesh_scheme const std::string &  geom_type,
int  entity_id
 

Get the mesh scheme for the specified entity.

std::string scheme; CubitInterface::get_mesh_scheme("surface", 12, scheme);
scheme = cubit.get_mesh_scheme("surface", 12)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
The entity's meshing scheme

CUBIEXPORT double get_mesh_size const std::string &  geom_type,
int  entity_id
 

Get the mesh size for a specified entity.

double mesh_size = CubitInterface::get_meshed_size("volume", 2);
mesh_size = cubit.get_meshed_size("volume", 2)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
The entity's mesh size

CUBIEXPORT double get_meshed_volume_or_area const std::string &  geom_type,
int  entity_id
 

Get the total volume of a volume's mesh.

double area = CubitInterface::get_meshed_volume_or_area("volume", 1);
area = cubit.get_meshed_volume_or_area("volume", 1)
Parameters:
geom_type Specifies the type of geometric entity - "volume" or "surface"
entity_id Specifies the id of the volume
Returns:
The volume's meshed volume

CUBIEXPORT int get_next_block_id  ) 
 

Get a next available block id.

Returns:
Next available block id

CUBIEXPORT int get_next_nodeset_id  ) 
 

Get a next available nodeset id.

Returns:
Next available nodeset id

CUBIEXPORT int get_next_sideset_id  ) 
 

Get a next available sideset id.

Returns:
Next available sideset id

CUBIEXPORT std::vector<double> get_nodal_coordinates int  node_id  ) 
 

Get the nodal coordinates for a given node id.

Parameters:
node_id The node id
Returns:
a triple containing the x, y, and z coordinates

CUBIEXPORT bool get_node_constraint  ) 
 

Query current setting for node constraint (move nodes to geometry).

Returns:
True if constrained, otherwise false

CUBIEXPORT int get_node_count  ) 
 

Get the count of nodes in the model.

Returns:
The number of nodes in the model

CUBIEXPORT void get_nodeset_children int  nodeset_id,
std::vector< int > &  node_list,
std::vector< int > &  volume_list,
std::vector< int > &  surface_list,
std::vector< int > &  curve_list,
std::vector< int > &  vertex_list
 

get lists of any and all possible children of a nodeset

A nodeset can contain a variety of entity types. This routine will return all contents of a specified nodeset.

Parameters:
nodeset_id User specified id of the desired nodeset
node_list User specified list where nodes associated with this nodeset are returned
volume_list User specified list where volumes associated with this nodeset are returned
surface_list User specified list where surfaces associated with this nodeset are returned
curve_list User specified list where curves associated with this nodeset are returned
vertex_list User specified list where vertices associated with this nodeset are returned

CUBIEXPORT std::vector<int> get_nodeset_curves int  nodeset_id  ) 
 

Get a list of curve ids associated with a specific nodeset.

Parameters:
nodeset_id User specified id of the desired nodeset
Returns:
A list of curve ids contained in the nodeset

CUBIEXPORT std::vector<int> get_nodeset_id_list  ) 
 

Get a list of all nodesets.

Returns:
List of all active nodeset ids

CUBIEXPORT int get_nodeset_node_count int  nodeset_id  ) 
 

Get the number of nodes in a nodeset.

Parameters:
nodeset_id The nodeset id
Returns:
Number of nodes in the nodeset

CUBIEXPORT std::vector<int> get_nodeset_nodes int  nodeset_id  ) 
 

Get a list of node ids associated with a specific nodeset.

Parameters:
nodeset_id User specified id of the desired nodeset
Returns:
A list of node ids contained in the nodeset

CUBIEXPORT std::vector<int> get_nodeset_surfaces int  nodeset_id  ) 
 

Get a list of surface ids associated with a specific nodeset.

Parameters:
nodeset_id User specified id of the desired nodeset
Returns:
A list of surface ids contained in the nodeset

CUBIEXPORT std::vector<int> get_nodeset_vertices int  nodeset_id  ) 
 

Get a list of vertex ids associated with a specific nodeset.

Parameters:
nodeset_id User specified id of the desired nodeset
Returns:
A list of vertex ids contained in the nodeset

CUBIEXPORT std::vector<int> get_nodeset_volumes int  nodeset_id  ) 
 

Get a list of volume ids associated with a specific nodeset.

Parameters:
nodeset_id User specified id of the desired nodeset
Returns:
A list of volume ids contained in the nodeset

CUBIEXPORT void get_overlapping_surfaces std::vector< int >  target_volume_ids,
std::vector< int > &  surf_list_1,
std::vector< int > &  surf_list_2
 

Get the list of overlapping surfaces for a list of volumes.

For every occurance of two overlapping surfaces, two surfaces ids are returned. Those ids are returned in the indicated lists and are aligned. In other words the first id in surf_list_1 overlaps with the first id in surf_list_2. The second id in surf_list_1 overlaps with the second id in surf_list-2, and so on.

Parameters:
target_volume_ids List of volume ids to examine.
surf_list_1 User specified list where the ids of overlapping surfaces will be returned
surf_list_2 User specified list where the ids of overlapping surfaces will be returned

CUBIEXPORT void get_overlapping_volumes std::vector< int >  target_volume_ids,
std::vector< int > &  volume_list
 

Get the list of overlapping volumes for a list of volumes.

For every occurance of two overlapping volumes, two volume ids are returned in volume_list. Modulus 2 of the volume_list should always be 0 (the list should contain an even number of volume ids). The first volume id in the returned list overlaps with the second volume id. The third volume id overlaps with the fourth volume id, and so on.

Parameters:
target_volume_ids List of volume ids to examine.
volume_list User specified list where overlapping volumes ids will be returned

CUBIEXPORT int get_owning_body const std::string &  geom_type,
int  entity_id
 

Get the owning body for a specified entity.

int body_id = CubitInterface::get_owning_body("curve", 12);
body_id = cubit.get_owning_body("curve", 12)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
ID of the specified entity's owning body

CUBIEXPORT int get_owning_volume const std::string &  geom_type,
int  entity_id
 

Get the owning volume for a specified entity.

int volume_id = CubitInterface::get_owning_volume("curve", 12);
volume_id = cubit.get_owning_volume("curve", 12)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
ID of the specified entity's owning volume

CUBIEXPORT int get_owning_volume_by_name const std::string &  entity_name  ) 
 

Get the owning volume for a specified entity.

int volume_id = CubitInterface::get_owning_volume_by_name("TipSurface");
volume_id = cubit.get_owning_volume_by_name("TipSurface")
Parameters:
entity_name Specifies the name (supplied by Cubit) of the entity
Returns:
ID of the specified entity's owning volume or 0 if name is unknown

CUBIEXPORT void get_periodic_data const std::string &  geom_type,
int  entity_id,
double &  interval,
std::string &  firmness,
int &  lower_bound,
std::string &  upper_bound
 

Get the periodic data for a surface or curve.

Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
interval User specified variable where interval count for the specified entity is returned
firmness User specified variable where a firmness of 'hard', 'soft', or 'default' is returned
lower_bound User specified variable where the lower bound value is returned
upper_bound User specified variable where the upper bound value is returned

CUBIEXPORT int get_pick_type  ) 
 

Get the current pick type.

Returns:
The current pick type of the graphics system

CUBIEXPORT int get_pyramid_count  ) 
 

Get the count of pyramids in the model.

Returns:
The number of pyramids in the model

CUBIEXPORT int get_quad_count  ) 
 

Get the count of quads in the model.

Returns:
The number of quads in the model

CUBIEXPORT void get_quality_stats const std::string &  entity_type,
std::vector< int >  id_list,
const std::string &  metric_name,
double  threshold,
bool  use_low_threshold,
double &  min_value,
double &  max_value,
double &  mean_value,
double &  std_value,
std::vector< int > &  mesh_list,
std::string  element_type,
int &  bad_group_id,
bool  make_group = false
 

Get the quality stats for a specified entity.

Parameters:
entity_type Specifies the geometry type of the entity
id_list Specifies a list of ids to work on
metric_name Specify the metric used to determine the quality
threshold Quality threshold value
use_low_threshold use threshold as lower or upper bound
mesh_list list of failed elements
element_type type of failed elements (does not support mixed element types)
make_group whether to create a group or not
bad_group_id ID of the created group
min_value User specified variable where the minimum quality value will be returned
max_value User specified variable where the maximum quality value will be returned
mean_value User specified variable where the mean quality value will be returned
std_value User specified variable where the standard deviation quality value will be returned

CUBIEXPORT std::vector<int> get_relatives const std::string &  source_geom_type,
int  source_id,
const std::string &  target_geom_type
 

Get the relatives (parents/children) of a specified entity.

This can be used to get either ancestors or predecessors for a specific entity. Only one specified entity type is returned with one use of the routine. For example, to get all surface parents associated with Curve 1, 'curve' is the source_geom_type, '1' is the source_id, and 'surface' is the target_geom_type.

std::vector<int> relative_list; curve_list = CubitInterface::get_relatives("surface", 12, "curve");
curve_list = cubit.get_relatives("surface", 12, "curve")
Parameters:
source_geom_type The entity type of the source entity
source_id The id of the source entity
target_geom_type The target geometry type
Returns:
A list of ids of the target geometry type

CUBIEXPORT int get_rendering_mode  ) 
 

Get the current rendering mode.

Returns:
The current rendering mode of the graphics subsystem

CUBIEXPORT std::string get_revision_date  ) 
 

Get the Cubit revision date.

Returns:
A string containing Cubit's last date of revision

CUBIEXPORT void get_sharp_curve_angles std::vector< int >  target_volume_ids,
std::vector< int > &  large_curve_angles,
std::vector< int > &  small_curve_angles,
std::vector< double > &  large_angles,
std::vector< double > &  small_angles,
double  upper_bound,
double  lower_bound
 

Get the list of sharp curve angles for a list of volumes.

'Sharp' is a function of the upper_bound and lower_bound threshold parameters. The id of curves are returned when any angle associated with a curve is less than the lower_bound or greater than the upper_bound.

Parameters:
target_volume_ids List of volume ids to examine.
large_curve_angles User specified list where the ids of curves with curve angles will be returned
small_curve_angles User specified list where the ids of curves with small angles will be returned
large_angles User specified list where the angles associated with large_curve_angles will be returned. Angles returned are in the same order as the ids returned in large_curve_angles.
small_angles User specified list where the angles associated with small_curve_angles will be returned. Angles returned are in the same order as the ids returned in small_curve_angles.
upper_bound Upper threshold angle
lower_bound Lower threshold angle

CUBIEXPORT void get_sharp_surface_angles std::vector< int >  target_volume_ids,
std::vector< int > &  large_surface_angles,
std::vector< int > &  small_surface_angles,
std::vector< double > &  large_angles,
std::vector< double > &  small_angles,
double  upper_bound,
double  lower_bound
 

Get the list of sharp surface angles for a list of volumes.

'Sharp' is a function of the upper_bound and lower_bound threshold parameters. The id of surfaces are returned when any angle associated with a surface is less than the lower_bound or greater than the upper_bound.

Parameters:
target_volume_ids List of volume ids to examine.
large_surface_angles User specified list where the ids of surfaces with large angles will be returned
small_surface_angles User specified list where the ids of surfaces with small angles will be returned
large_angles User specified list where the angles associated with large_surface_angles will be returned. Angles returned are in the same order as the ids returned in large_surface_angles.
small_angles User specified list where the angles associated with small_surface_angles will be returned. Angles returned are in the same order as the ids returned in small_surface_angles.
upper_bound Upper threshold angle
lower_bound Lower threshold angle

CUBIEXPORT void get_sideset_children int  sideset_id,
std::vector< int > &  face_list,
std::vector< int > &  surface_list,
std::vector< int > &  curve_list
 

get lists of any and all possible children of a sideset

A nodeset can contain a variety of entity types. This routine will return all contents of a specified sideset.

Parameters:
sideset_id User specified id of the desired sideset
face_list User specified list where faces associated with this sideset are returned
surface_list User specified list where surfaces associated with this sideset are returned
curve_list User specified list where curves associated with this sideset are returned

CUBIEXPORT std::vector<int> get_sideset_curves int  sideset_id  ) 
 

Get a list of curve ids associated with a specific sideset.

Parameters:
sideset_id User specified id of the desired sideset
Returns:
A list of curve ids contained in the sideset

CUBIEXPORT std::vector<int> get_sideset_id_list  ) 
 

Get a list of all sidesets.

Returns:
List of all active sideset ids

CUBIEXPORT std::vector<int> get_sideset_quads int  sideset_id  ) 
 

Get a list of any quads in a sideset.

A sideset can contain quadrilateral elements. This function will return those quad elements if they exist. An empty list will be returned if there are no quads in the sideset.

Parameters:
sideset_id User specified id of the desired sideset
Returns:
A list of the quads in the sideset

CUBIEXPORT std::vector<int> get_sideset_surfaces int  sideset_id  ) 
 

Get a list of any surfaces in a sideset.

A sideset can contain surfaces. This function will return those surfaces if they exist. An empty list will be returned if there are no surfaces in the sideset.

Parameters:
sideset_id User specified id of the desired sideset
Returns:
A list of the surfaces defining the sideset

CUBIEXPORT std::vector<int> get_small_curves std::vector< int >  target_volume_ids,
double  mesh_size
 

Get the list of small curves for a list of volumes.

'Small' is a function of the mesh_size passed into the routine. The mesh_size parameter will act as the threshold for determining what 'small' is. A small entity is one that has an edge length smaller than mesh_size.

Parameters:
target_volume_ids List of volume ids to examine. in Cubit is valid as input here.
mesh_size Indicate the mesh size used as the threshold
Returns:
List of small curve ids

CUBIEXPORT std::vector<int> get_small_loops std::vector< int >  target_volume_ids,
double  mesh_size
 

Get the list of close loops (surfaces) for a list of volumes.

'Small' or 'Close' is a function of the mesh_size passed into the routine. The mesh_size parameter will act as the threshold for determining what 'small' is. A small entity is one that has an edge length smaller than mesh_size.

Parameters:
target_volume_ids List of volume ids to examine.
mesh_size Indicate the mesh size used as the threshold
Returns:
List of close loop (surface) ids

CUBIEXPORT std::vector<int> get_small_surfaces std::vector< int >  target_volume_ids,
double  mesh_size
 

Get the list of small surfaces for a list of volumes.

'Small' is a function of the mesh_size passed into the routine. The mesh_size parameter will act as the threshold for determining what 'small' is. A small entity is one that has an edge length smaller than mesh_size.

Parameters:
target_volume_ids List of volume ids to examine.
mesh_size Indicate the mesh size used as the threshold
Returns:
List of small surface ids

CUBIEXPORT void get_small_surfaces_hydraulic_radius std::vector< int >  target_volume_ids,
double  mesh_size,
std::vector< int > &  small_surfaces,
std::vector< double > &  small_radius
 

Get the list of small hydraulic radius surfaces for a list of volumes.

'Small' is a function of the mesh_size passed into the routine. The mesh_size parameter will act as the threshold for determining what 'small' is. A small entity is one that has an edge length smaller than mesh_size.

Parameters:
target_volume_ids List of volume ids to examine.
mesh_size Indicate the mesh size used as the threshold
small_surfaces User specified list where the ids of small surfaces will be returned
small_radius User specified list where the radius of each small surface will be returned. The order of the radius values is the same as the order of the returned ids.

CUBIEXPORT std::vector<int> get_small_volumes std::vector< int >  target_volume_ids,
double  mesh_size
 

Get the list of small volumes from a list of volumes.

'Small' is a function of the mesh_size passed into the routine. The mesh_size parameter will act as the threshold for determining what 'small' is. A small entity is one that has an edge length smaller than mesh_size.

Parameters:
target_volume_ids List of volume ids to examine.
mesh_size Indicate the mesh size used as the threshold
Returns:
List of small volume ids

CUBIEXPORT void get_small_volumes_hydraulic_radius std::vector< int >  target_volume_ids,
double  mesh_size,
std::vector< int > &  small_volumes,
std::vector< double > &  small_radius
 

Get the list of small hydraulic radius volumes for a list of volumes.

'Small' is a function of the mesh_size passed into the routine. The mesh_size parameter will act as the threshold for determining what 'small' is. A small entity is one that has an edge length smaller than mesh_size.

Parameters:
target_volume_ids List of volume ids to examine.
mesh_size Indicate the mesh size used as the threshold
small_volumes User specified list where the ids of small volumes will be returned
small_radius User specified list where the radius of each small volume will be returned. The order of the radius values is the same as the order of the returned ids.

CUBIEXPORT std::string get_smooth_scheme const std::string &  geom_type,
int  entity_id
 

Get the smooth scheme for a specified entity.

std::string smooth_scheme; CubitInterface::get_smooth_scheme("curve", 122, smooth_scheme);
smooth_scheme = cubit.get_smooth_scheme("curve", 122)
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
The smooth scheme associated with the entity

CUBIEXPORT std::vector<int> get_source_surfaces int  volume_id  ) 
 

Get a list of a volume's sweep source surfaces.

Parameters:
volume_id Specifies the volume id
Returns:
List of surface ids

CUBIEXPORT std::vector<int> get_sub_elements const std::string &  entity_type,
int  entity_id,
int  dimension
 

Get the lower dimesion entities associated with a higher dimension entities. For example get the faces associated with a hex or the edges associated with a tri.

std::vector<int> face_id_list; face_id_list = CubitInterface::get_sub_elements("hex", 221, 2);
face_id_list = cubit.get_sub_elements("hex", 221, 2)
Parameters:
entity_type The mesh element type of the higher dimension entity
entity_id The mesh element id
dimension The dimension of the desired sub entities
Returns:
List of ids of the desired dimension

CUBIEXPORT double get_surface_area int  surface_id  ) 
 

Get the area of a surface.

Parameters:
surface_id ID of the surface
Returns:
Area of the surface

CUBIEXPORT void get_surface_centroid int  surface_id,
double &  x,
double &  y,
double &  z
 

Get the surface centroid for a specified surface.

Parameters:
surface_id ID of the surface
x User specified variable where the x coordinate will be returned
y User specified variable where the y coordinate will be returned
z User specified variable where the z coordinate will be returned

CUBIEXPORT int get_surface_count  ) 
 

Get the current number of surfaces.

Returns:
The number of surfaces in the current model, if any

CUBIEXPORT int get_surface_element_count int  surface_id  ) 
 

Get the count of elements in a surface.

Returns:
The number of elements (both quads and tris) in a surface

CUBIEXPORT void get_surface_normal int  surface_id,
double &  x,
double &  y,
double &  z
 

Get the surface normal for a specified surface.

Parameters:
surface_id ID of the surface
x User specified variable where the x coordinate will be returned
y User specified variable where the y coordinate will be returned
z User specified variable where the z coordinate will be returned

CUBIEXPORT std::vector<int> get_surface_quads int  surface_id  ) 
 

get the list of any quad elements on a given surface

Parameters:
surface_id User specified id of the desired sideset
Returns:
A list of the quad ids on the surface

CUBIEXPORT std::string get_surface_type int  surface_id  ) 
 

Get the surface type for a specified surface.

Parameters:
surface_id ID of the surface
Returns:
Type of surface

CUBIEXPORT std::vector<int> get_tangential_intersections std::vector< int >  target_volume_ids,
double  upper_bound,
double  lower_bound
 

Get the list of bad tangential intersections for a list of volumes.

'Bad' is a function of the upper_bound and lower_bound threshold parameters. The id of surfaces are returned when any tangential angle associated with a surface is less than the lower_bound or greater than the upper_bound.

Parameters:
target_volume_ids List of volume ids to examine.
upper_bound Upper threshold angle
lower_bound Lower threshold angle
Returns:
List of surface ids associated with bad tangential angles

CUBIEXPORT std::vector<int> get_target_surfaces int  volume_id  ) 
 

Get a list of a volume's sweep target surfaces.

Parameters:
volume_id Specifies the volume id
Returns:
List of surface ids

CUBIEXPORT int get_tet_count  ) 
 

Get the count of tets in the model.

Returns:
The number of tets in the model

CUBIEXPORT std::vector<double> get_total_bounding_box const std::string &  geom_type,
std::vector< int >  entity_list
 

Get the bounding box for a list of entities.

std::vector<double> vector_list; vector_list = CubitInterface::get_total_bounding_box("surface", entity_list);
vector_list = cubit.get_total_bounding_box("surface", entity_list)
Parameters:
geom_type Specifies the geometry type of the entity
entity_list List of ids associated with geom_type
Returns:
A vector of coordinates for the entity's bounding box. Twelve (12) values will be returned in xyz set order repeated four (4) times per set.

CUBIEXPORT double get_total_volume std::vector< int >  volume_list  ) 
 

Get the total volume for a list of volume ids.

Parameters:
volume_list List of volume ids
Returns:
The total volume of all volumes indicated in the id list

CUBIEXPORT int get_tri_count  ) 
 

Get the count of tris in the model.

Returns:
The number of tris in the model

CUBIEXPORT int get_valence int  vertex_id  ) 
 

Get the valence for a specific vertex.

Parameters:
vertex_id ID of vertex

CUBIEXPORT std::vector<std::string> get_valid_block_element_types int  block_id  ) 
 

Get a list of potential element types for a block.

Parameters:
block_id The block id
Returns:
List of potential element types

CUBIEXPORT std::string get_version  ) 
 

Get the Cubit version.

Returns:
A string containing the current version of Cubit

CUBIEXPORT int get_vertex_count  ) 
 

Get the current number of vertices.

Returns:
The number of vertices in the current model, if any

CUBIEXPORT std::vector<double> get_view_at  ) 
 

Get the camera 'at' point.

Returns:
The xyz coordinates of the camera's current position

CUBIEXPORT double get_view_distance  ) 
 

Get the distance from the camera to the model (from - at).

Returns:
Distance from the camera to the model

CUBIEXPORT std::vector<double> get_view_from  ) 
 

Get the camera 'from' point.

Returns:
The xyz coordinates of the camera's from position

CUBIEXPORT double get_volume_area int  volume_id  ) 
 

Get the area of a volume.

Parameters:
volume_id ID of the volume
Returns:
Area of the volume

CUBIEXPORT int get_volume_count  ) 
 

Get the current number of volumes.

Returns:
The number of volumes in the current model, if any

CUBIEXPORT int get_volume_element_count int  volume_id  ) 
 

Get the count of elements in a volume.

Returns:
The number of elements (both hex and tet) in a volume

CUBIEXPORT std::vector<int> get_volumes_for_node std::string  node_name,
int  node_instance
 

CUBIEXPORT std::string get_wrt_entity std::string  source_type,
int  source_id,
int  sideset_id
 

Get the with-respect-to entity.

std::string wrt_entity; wrt_entity = CubitInterface::get_wrt_entity("face", 332, 2);
wrt_entity = cubit.get_wrt_entity("face", 332, 2)
Parameters:
source_type Item type - could be 'face', 'surface' or 'curve'
source_id ID of entity
sideset_id ID of the sideset
Returns:
'with-respect-to' entity of the source_type/source_id in specified sideset

CUBIEXPORT void group_list std::vector< std::string > &  name_list,
std::vector< int > &  id_list
 

Get the names and ids of all the groups (excluding the pick group) that are defined by the current cubit session.

Parameters:
name_list User specified list where the active group names will be returned
id_list User specified list where the ids of all active groups will be returned

CUBIEXPORT void init const std::vector< std::string > &  argv  ) 
 

CUBIEXPORT bool is_assembly_metadata_attached int  volume_id  ) 
 

Determine whether metadata is attached to a specified volume.

Parameters:
volume_id ID of the volume
Returns:
True if metadata exists, otherwise false

CUBIEXPORT bool is_command_echoed  ) 
 

Check the echo flag in cubit.

Returns:
A boolean indicating whether commands should be echoed in Cubit

CUBIEXPORT bool is_command_journaled  ) 
 

Check the journaling flag in cubit.

Returns:
A boolean indicating whether commands are journaled by Cubit

CUBIEXPORT bool is_granite_engine_available  ) 
 

Determine whether pro-e/granite engine is available.

Returns:
True if granite engine is available, otherwise false

CUBIEXPORT bool is_interval_count_odd int  surface_id  ) 
 

Query whether a specified surface has an odd loop.

Parameters:
surface_id Id of the surface
Returns:
True if surface contains is/contains an odd looop, otherwise false.

CUBIEXPORT bool is_merged const std::string &  geom_type,
int  entity_id
 

Determines whether a specified entity is merged.

if (CubitInterface::is_merged("surface", 137)) . . .
if cubit.is_merged("surface", 137):
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity

CUBIEXPORT bool is_mesh_element_in_group const std::string &  element_type,
int  element_id
 

Indicates whether a mesh element is in a group.

if cubit.is_mesh_element_in_group("tet", 445):
Parameters:
element_type Mesh type of the element
element_id ID of the mesh element return True if in a group, otherwise false

CUBIEXPORT bool is_meshed const std::string &  geom_type,
int  entity_id
 

Determines whether a specified entity is meshed.

if (CubitInterface::is_meshed("surface", 137)) . . .
if cubit.is_meshed("surface", 137):
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity

CUBIEXPORT bool is_modified  ) 
 

Get the modified status of the model.

Returns:
A boolean indicating whether the model has been modified

CUBIEXPORT bool is_multi_volume int  body_id  ) 
 

Query whether a specified body is a multi volume body.

Parameters:
body_id Id of the body
Returns:
True if body contains multiple volumes, otherwise false.

CUBIEXPORT bool is_part_of_list int  target_id,
std::vector< int >  id_list
 

Routine to check for the presence of an id in a list of ids.

Parameters:
target_id Target id
id_list List of ids
Returns:
True if target_id is member of id_list, otherwise false

CUBIEXPORT bool is_periodic const std::string &  geom_type,
int  entity_id
 

Query whether a specified surface or curve is periodic.

if (CubitInterface::is_periodic("surface", 22)) . . .
if cubit.is_periodic("surface", 22):
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity
Returns:
True is entity is periodic, otherwise false

CUBIEXPORT bool is_perspective_on  ) 
 

Get the current perspective mode.

Returns:
True if perspective is on, otherwise false

CUBIEXPORT bool is_scale_visibility_on  ) 
 

Get the current scale visibility setting.

Returns:
True if scale is visible, otherwise false

CUBIEXPORT bool is_undo_save_needed  ) 
 

Get the status of the model relative to undo checkpointing.

Returns:
A boolean indicating whether the model has been modified

CUBIEXPORT bool is_using_shells int  sideset_id  ) 
 

Get the shell use for a sideset.

Parameters:
sideset_id ID of the sideset
Returns:
True if the sideset uses shells, otherwise false

CUBIEXPORT bool is_virtual const std::string &  geom_type,
int  entity_id
 

Query virtualality for a specific entity.

if (CubitInterface::is_virtual("surface", 134)) . . .
if cubit.is_virtual("surface", 134)):
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity

CUBIEXPORT bool is_visible const std::string &  geom_type,
int  entity_id
 

Query visibility for a specific entity.

if (CubitInterface::is_visible("volume", 4)) . . .
if cubit.is_visible("volume", 4)):
Parameters:
geom_type Specifies the geometry type of the entity
entity_id Specifies the id of the entity

CUBIEXPORT std::vector<int> parse_cubit_list const std::string &  type,
std::string  int_list,
bool  include_sheet_bodies = false
 

Parse a Cubit style list of IDs (1,2,4 to 19 by 3 or all) into a list of integers.

Cubit users are allowed to input many variations of entities and IDs for any given command. This routine parses the input and returns a regular list of valid IDs for the specified entity type.

Parameters:
type The specific entity type represented by the list of IDs
int_list The string that contains the user's ID list
include_sheet_bodies - include sheet bodies in the integer list
Returns:
A vector of validated integers

CUBIEXPORT bool prepare_next_script_line  ) 
 

CUBIEXPORT void print_cmd_options  ) 
 

Used to print the command line options.

CUBIEXPORT void print_raw_help char *  input_line,
int  order_dependent,
int  consecutive_dependent
 

Used to print out help when a ?, & or ! is pressed.

Parameters:
input_line The current command line being typed by the user
order_dependent Is set to '1' if the key pressed is not &, otherwise '0'
consecutive_dependent Is set to '1' if the pressed is '?', otherwise '0'

CUBIEXPORT void print_surface_summary_stats  ) 
 

Print the surface summary stats to the console.

CUBIEXPORT void print_volume_summary_stats  ) 
 

Print the volume summary stats to the console.

CUBIEXPORT void process_input_files  ) 
 

CUBIEXPORT void process_next_script_line  ) 
 

CUBIEXPORT void remove_entity_from_group int  group_id,
int  entity_id,
const std::string &  entity_type
 

Remove a specific entity from a specific group.

int group_id = 3; int entity_id = 22; CubitInterface::remove_entity_from_group(group_id, entity_id, "surface");
group_id = 3 entity_id = 22 cubit.remove_entity_from_group(group_id, entity_id, "surface")
Parameters:
group_id ID of group from which the entity will be removed
entity_id ID of the entity to be removed from the group
entity_type Type of the entity to be removed from the group

CUBIEXPORT void set_cubit_interrupt bool  interrupt  ) 
 

This sets the global flag in Cubit that stops all interruptable processes.

Parameters:
interrupt Boolean set to TRUE if process is to be stopped

CUBIEXPORT void set_cubit_message_handler CubitMessageHandler hdlr  ) 
 

CUBIEXPORT void set_exit_handler ExternalExitHandler *  hdlr  ) 
 

CUBIEXPORT void set_modified bool  modified  ) 
 

Set the status of the model.

Parameters:
modified A boolean indicating whether the model has been modified.

CUBIEXPORT void set_playback_handler ExternalPlaybackHandler *  hdlr  ) 
 

CUBIEXPORT void set_progress_tool ProgressTool *  progress  ) 
 

CUBIEXPORT void set_undo_saved  ) 
 

Set the status of the model relative to undo checkpointin.

CUBIEXPORT void silent_cmd const char *  input_string  ) 
 

Pass a command string into Cubit and have it executed without being verbose at the command prompt.

Passing a command into Cubit using this method will result in an immediate execution of the command. The command is passed directly to Cubit without any validation or other checking.

cubit.silent_cmd("display")
Parameters:
input_string Pointer to a string containing a complete Cubit command

CUBIEXPORT void unselect_entity const std::string &  entity_type,
int  entity_id
 

Unselect an entity and removed if from the picked list.

Unselecting an entity will unhighlight it in the graphics window and remove it from the global pick list.

cubit.unselect_entity("curve", 221)
Parameters:
entity_type The type of the entity to be unselected
entity_id The ID of the entity to be unselected


Variable Documentation

const int CubitInterface::CI_ERROR = -1
 


Generated on Tue Nov 8 14:17:01 2005 for Cubit Interface by doxygen 1.3.6