Cubit Python API 16.12
Functions
CubitModifyInterface Namespace Reference

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

Functions

void  clear_window ()
  clear the graphics window
 
std::vector< int >  create_free_nodes (std::vector< double > &coords)
  create free nodes in cubit
 
std::vector< int >  create_free_tris (std::vector< int > &tri_nodes)
  create free tris in cubit
 
void  draw_line (double x0, double y0, double z0, double x1, double y1, double z1, int color)
 
void  draw_point (double x, double y, double z, int color)
 
void  flush ()
 
void  graphics_transforms ()
  if a cubit graphics window is currently active, allows for interactive transformations of the model with the mouse
 
void  init ()
  Use init to initialize cubit modify access.
 
void  notify_mesh_modified ()
 
int  set_node_coordinates (int num_nodes, int *nodes, double *coords)
  set the coordinate values for nodes
 
bool  transfer_mesh (const std::string &geom_type, int from_entity_id, int to_entity_id, bool snap_to)
  transfer the ownership of all owned mesh entities from one geometry entity to another. transfers onlh mesh entities owned exclusively by the geometry entity. For example only nodes on the interior of a volume will be transferred to a new volume. Use a bottom up approach to successively transfer mesh from vertices, curves, surfaces and then volumes. If not performed completely, can leave the mesh in an invalid state
 

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

◆ clear_window()

void clear_window ( )

clear the graphics window

◆ create_free_nodes()

std::vector< int > create_free_nodes ( std::vector< double > &  coords )

create free nodes in cubit

Parameters
coords vector of node locations, ordered x,y,z for each node
Returns
ids of new nodes created (in same order as coords array)

◆ create_free_tris()

std::vector< int > create_free_tris ( std::vector< int > &  tri_nodes )

create free tris in cubit

Parameters
tri_nodes vector of node ids, ordered ccw for each tri
Returns
ids of new tris created (in same order as tri_nodes array)

◆ draw_line()

void draw_line ( double  x0,
double  y0,
double  z0,
double  x1,
double  y1,
double  z1,
int  color 
)

brief draw a line in space in the graphics window

◆ draw_point()

void draw_point ( double  x,
double  y,
double  z,
int  color 
)

brief draw a point in space in the graphics window

◆ flush()

void flush ( )

brief flush the graphics pipeline

◆ graphics_transforms()

void graphics_transforms ( )

if a cubit graphics window is currently active, allows for interactive transformations of the model with the mouse

◆ init()

void init ( )

Use init to initialize cubit modify access.

◆ notify_mesh_modified()

void notify_mesh_modified ( )

brief updates all entities in cubit DB (including graphics) after the mesh has been modified

◆ set_node_coordinates()

int set_node_coordinates ( int  num_nodes,
int *  nodes,
double *  coords 
)

set the coordinate values for nodes

Parameters
num_nodes number of nodes we are passing in
nodes array of node ids (array size = num_nodes)
coords array of x-y-z coordinates (array size = 3*num_nodes)
Returns
The number of successful node-coordinate asignments (should be the same as num_nodes)

◆ transfer_mesh()

bool transfer_mesh ( const std::string &  geom_type,
int  from_entity_id,
int  to_entity_id,
bool  snap_to 
)

transfer the ownership of all owned mesh entities from one geometry entity to another. transfers onlh mesh entities owned exclusively by the geometry entity. For example only nodes on the interior of a volume will be transferred to a new volume. Use a bottom up approach to successively transfer mesh from vertices, curves, surfaces and then volumes. If not performed completely, can leave the mesh in an invalid state

CubitModifyInterface::transfer_mesh ("surface" , 12, 24, true );
bool transfer_mesh(const std::string &geom_type, int from_entity_id, int to_entity_id, bool snap_to)
transfer the ownership of all owned mesh entities from one geometry entity to another....
Parameters
geom_type Specifies the geometry type of the entity
from_entity_id id of an existing cubit entity of type geom_type that currently contains mesh entities. entity will no longer me "meshed" following this operation
to_entity_id id of an existing cubit entity of type geom_type that does not currently meshed. entity will be meshed following this operation.
snap_to project any nodes to the gometry entity with id to_entity_id
Returns
whether the transfer was successful