Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

openMesh Class Reference

Implementation of rf_mesh_interface that maintains storage of vertices and unstructured elements in blocks so that memory can be shared with visual3 (or any other application) directly. More...

#include <openMesh.h>

Inheritance diagram for openMesh:

rf_mesh_interface base_interface openMeshVertexInfo List of all members.

Public Methods

 openMesh (RFConnOrder iOrd=connect_icemcfd_order)
 By default, precision is floating and degree is 3.

 openMesh (const openMesh &i)
 Copy an existing openMesh. More...

openMesh& operator= (const openMesh &i)
 Equality operator also validates node storage. More...

 ~openMesh ()
 Free coordinate memory.

void* getCoords ()
 Return pointer to all node coordinates. More...

const void* getCoords () const
 Return pointer to all node coordinates. More...

RFPrecType getPrec () const
 Return precision of the coordinates. More...

size_t getCur_allocation () const
 Return the current memory allocation. More...

int getStralloc () const
 Return the structured memory allocation flag.

int setCoords (void *ncoords, size_t alloc_coords)
 Set the coordinates memory to be from externally given pointer. More...

int clear_strmesh ()
 Clear structured mesh.

int clear_unstrmesh ()
 Clear the unstructured mesh.

int clear_counters ()
 Clear just the counters in the unstructured mesh.

void* prec_offset (void *start, size_t offset)
 Return the pointer to memory of current precision at given offset. More...

const void* prec_offset (const void *start, size_t offset) const
 Return the pointer to memory of current precision at given offset. More...

void* coord_offset (size_t offset)
 Offset into coord array using prec_offset(). More...

const void* coord_offset (size_t offset) const
 Offset into coord array using prec_offset(). More...

void* start_str_nodes ()
 Return the beginning of the structured coordinate memory. More...

const void* start_str_nodes () const
 Return the beginning of the structured coordinate memory. More...

void* new_coords () const
 Return block of memory of size given by cur_allocation. More...

void* clone_coords () const
 Clone coordinate memory. More...

int coord_alloc (size_t nverts, int do_update_dom=1)
 Allocate the coorindate memory for nverts. More...

int allocate_coord_size (size_t nreq)
 Allocate enough coordinate memory of at least size nreq. More...

int free_coords ()
 Free coordinate memory.

size_t request_size (size_t nreq) const
 Compute the next block allocation. More...

void copy_strverts_to (void *start_str)
 Copy just the structured vertex coordinates to memory given by start_str. More...

int updateStructNodes ()
 Update the pointers to memory in all structured domains. More...

int get_location (const openMesh_vertex *vi, float loc[3]) const
 Get the location of vertex specified by vi. More...

int get_location (const openMesh_vertex *vi, double loc[3]) const
 Same as get_location()(const openMesh_vertex *, float[3]) except location returned in double precision array.

int set_location (openMesh_vertex *vi, const float loc[3])
 Set the location of vertex specified by vi. More...

int set_location (openMesh_vertex *vi, const double loc[3])
 Same as set_location()(const openMesh_vertex *, float[3]) except location returned in double precision array.

RF_SIGNED_LONG getVtx_offset () const
 Internal method used by get_vtxconn_offset().

int setVtx_offset (RF_SIGNED_LONG v)
 Internal method used by set_vtxconn_offset(). More...

rf_mesh_interfacenewImpl () const
int create_unstrmesh ()
 Create new unstructured mesh. More...

int create_strmesh ()
 Create new structured mesh. More...

int delete_unstrmesh ()
 Delete unstructured mesh. More...

int delete_strmesh ()
 Create new structured mesh. More...

int clear_mesh ()
 Empty mesh. More...

RFPrecType get_prec () const
 If representation can handle both double and float precisions for vertex coordinates, then this method can be implemented. More...

void set_default_prec ()
 Fix the default precision if none set to this point.

int set_prec (RFPrecType p)
 Only get one bite at this apple. More...

int allocate_vertex_memory (size_t nverts, RFPrecType p)
 Can only be called before loading all vertices (unstruct first followed by struct). More...

int allocate_strvertex_memory (size_t dom=0)
 Allocate memory for coordinates of specified structured domain. More...

int set_vtxconn_offset (RF_SIGNED_LONG vtx_offset)
 Set current vertex offset. More...

int allocate_element_memory (const size_t *nele)
 Hint of how many elements of each type to allocate. More...

RFConnOrder GetInternalOrder () const
 Return the internal connection order of the mesh representation. More...

int SetInternalOrder (RFConnOrder order)
 Set order of storage (if can change the order). More...

const void* vertex_coords (RFPrecType *pr) const
 Return the pointer to the start of the vertex memory if mesh representation holds coordinate memory in contiguious block. More...

const int* connectivity (int type, RFConnOrder *order, int *vtxs) const
 Return the element connectivity memory if mesh representation can hold element connectivity in a contiguious block of memory. More...

RF_SIGNED_LONG get_vtxconn_offset () const
 Return current vertex offset. More...

size_t add_domain (const int *dmax)
 Add structured domain with node range (1, 1, 1) to dmax. More...

size_t add_domain (str_domain_handle& dom)
 Add structured domain specified by given domain interface. More...

vertex_handle new_vertex ()
 Create a new vertex of specified type. More...

element_handle new_element (int type)
 Create a new element of specified type. More...

int ConnectIntOrder (element_handle& ele, const int *connect, size_t nid, int famid)
 Specify newly created element ele (new_element()) has connectivity specified by connect. More...

int reconnect_vid (element_handle& el, const int *newv)
 Change the connectivity of element ele to the connectivity specified in the array newv. More...

int reconnect_vid (element_handle& el, const RF_SIGNED_LONG *newv)
int reconnect (element_handle& el, vertex_handle *nvv)
 Change the connectivity of element ele to the connectivity specified in the array of vertex handles newv. More...

int replace_vid (element_handle& el, RF_SIGNED_LONG oldv, RF_SIGNED_LONG newv)
 Change node number oldv to newv in element. More...

int replace (element_handle& el, vertex_handle& oldv, vertex_handle& nvewv)
 Change node oldv to newv in element. More...

int merge_unstr_nodes (const RFMergeVtxList& list)
 Merge the nodes specified by the list. More...

int compress_mesh ()
 Mesh representations that can return vertex coordinates and/or element connectivity in a block, should try and implement this method. More...

int must_remove_degeneracy () const
 Each mesh representation must return whether or not it can tolerate degenerate elements. More...

int stored_vertex_dimension () const
 Does the mesh representation store the vertex dimension? By default the answer is no (0). More...

int delete_vertex (RF_SIGNED_LONG vid)
 Delete specified vertex id. More...

int delete_vertex (vertex_handle& vtx)
 Delete the specified vertex. More...

int delete_element (element_handle& el)
 Delete the element specified. More...

int disconnect (element_handle& el)
 Disconnect element ele from the mesh. More...

vertex_handle first_vertex (void **cur)
 Enumerate vertices but use iterator style. More...

vertex_handle next_vertex (void **cur)
 Enumerate elements but use iterator style. More...

element_handle first_el (void **cur, int eltype=0)
 Enumerate elements but use iterator style. More...

element_handle next_el (void **cur, int eltype=0)
 Enumerate elements but use iterator style. More...

element_handle init_element_iterator (const vertex_handle& v, RF_SIGNED_LONG *next_idx) const
 Initialize the element loop when looping over all elements on a node. More...

element_handle next_element (const vertex_handle& v, RF_SIGNED_LONG *next_idx, const element_handle& cur_el) const
 Go to next element in link list of elements on a node. More...

size_t cellcount_on_node (unsigned int *offset) const
const FacesOnNodegetFaceConn () const
 Representations that can build the FaceConn structure should return a pointer to it. More...

size_t nfaces_on_vertex (int vidx) const
size_t neles_on_face (int vidx, size_t fidx) const
size_t ndim_on_face (int vidx, size_t fidx, int dim) const
size_t face_on_vertex (int vidx, size_t fi, int *fv) const
element_handle ele_on_face (const vertex_handle& v, size_t fidx, size_t elidx) const
 Return the element specified by the vertex, index of the face and the index of the element. More...

void face_on_vertex (int vi, size_t fi, size_t *nvf, int *fv) const
element_handle ele_on_face (int vidx, size_t fidx, size_t elidx) const
int incident_elements_face (int nvf, const int *face, int ordf, int max_return, element_handle *elements, int *face_numbers) const
 Return all elements on face specified by the face vertices. More...

int incident_elements_face (int nvf, const int *fverts, int ordf, element_handle_list& elements, int *face_numbers) const
 Return can be artitrary number of elements on a face. More...

int incident_elements (int nvf, vertex_handle *fverts, int ordf, int max_return, element_handle *elements, int *face_numbers) const
 All representations should implement this method. More...

int incident_elements (int nvf, vertex_handle *fverts, int ordf, element_handle_list& elements, int *face_numbers) const
 Default method invokes array method. More...

int release_connectivity_info ()
 Release the connectivity information (if it can be safely released). More...

size_t n_unstr_vertices () const
 Return number of unstructured vertices created. More...

size_t n_unstr_elements (int type) const
 Return number of unstructured elements of specified type created. More...

size_t n_unstr_vertices_actual () const
 Return current number of vertices in mesh. More...

size_t n_unstr_elements_actual (int type) const
 Return current number of unstructured elements of specified type in mesh. More...

size_t count_unstr_elements (int type, size_t *s) const
 Return current number of unstructured elements of specified type in mesh. More...

RF_SIGNED_LONG getNumber (const vertex_handle& v) const
 Return invariant id number of specified vertex. More...

vertex_handle lookup_vertex (RF_SIGNED_LONG vid) const
 Return vertex given invariant id number. More...

int get_location (const vertex_handle& v, float loc[3]) const
 Return the location of specified vertex. More...

int get_location (const vertex_handle& v, double loc[3]) const
int get_dimension (const vertex_handle& iVtx) const
 Get the dimension of the vertex. More...

int get_dimension (RF_SIGNED_LONG iVtx) const
int get_ptwin (const vertex_handle& iVtx) const
 Get the periodic twin of the specified vertex. More...

int get_ptwin (RF_SIGNED_LONG iVtx) const
int set_location (vertex_handle& v, const float loc[3])
 Set the location of specified vertex. More...

int set_location (vertex_handle& v, const double loc[3])
 Set the location of specified vertex. More...

int set_dimension (vertex_handle& iVtx, int iDim)
 Set the dimension of the vertex. More...

int set_dimension (RF_SIGNED_LONG iVtx, int iDim)
int set_ptwin (const vertex_handle& iVtx, RF_SIGNED_LONG iPtwin)
 Get the periodic twin of the specified vertex. More...

int set_ptwin (RF_SIGNED_LONG iVtx, RF_SIGNED_LONG iPtwin)
int has_element_on (RF_SIGNED_LONG vid) const
 Does specified vertex have an element on it? More...

int has_element_on (const vertex_handle& vh) const
RF_SIGNED_LONG getNumber (const element_handle& e) const
 Return the invariant element number. More...

element_handle lookup_element (RF_SIGNED_LONG iEid) const
 Return element given invariant id number. More...

int GetConnectivityIntOrder (const element_handle& ele, int *vtxs) const
 Return the connectivity of the element as vertex indices in the internal order of the mesh representation. More...

int GetConnectivityIntOrder_l (const element_handle& ele, RF_SIGNED_LONG *vtxs) const
int max_pid () const
 Return the maximum family id in the mesh. More...

int family_pid (const char *name) const
 Return the family id for given name. More...

const char* family_name (int pid) const
 Return the family name for given family id. More...

int delete_family (const char *name)
 Delete family. More...

int set_family (int pid, const char *name)
 Set the family name for given family id. More...

size_t family_index (const char *name) const
 Utility family method to find the index of name in the family list. More...

size_t family_index (int pid) const
 Find pid in pid list. More...

int get_centroid (const element_handle& ele, double loc[3]) const
 Compute the centroid of the element. More...

int get_centroid (const element_handle& ele, float loc[3]) const
int get_bbox (const element_handle& ele, double bbox_min[3], double bbox_max[3]) const
 Compute the bounding box of the element. More...

int get_bbox (const element_handle& ele, float bbox_min[3], float bbox_max[3]) const
size_t n_domains () const
 Return number of structured domains. More...

str_domain_handle get_domain (size_t i)
 Return the ith structured domain. More...

str_domain_handle get_domain (size_t i) const
int ijk_of_domain (size_t i, int ijk[3]) const
 Return the ijk range (1-n) for ith structured domain. More...

int set_basic_topo ()
 Set the basic topology of a set of structured domains. More...

int setDegree (int deg)
 Set the degree of the structured mesh (2 or 3D). More...

int getDegree () const
 Return the degree of the structured mesh (2 or 3D). More...


Protected Attributes

RFIntList pids
 list of pids in parallel with list of family names.

RFFamilyList families
 List of family names in parallel with list of ids.

void* coords
 openMesh owns all node storage for both structure and unstructured meshes.

size_t cur_allocation
 Current memory allocation of coords.

RFPrecType prec
 Precision of coords.

int stralloc
 Structured nodes have been allocated. More...

int degree
 Degree of mesh. More...

openMesh_str_domain_list str_mesh
 All structured domains. More...

openMesh_unstr_mesh unstr_mesh
 unstructured mesh. More...


Detailed Description

Implementation of rf_mesh_interface that maintains storage of vertices and unstructured elements in blocks so that memory can be shared with visual3 (or any other application) directly.

Implementation details of interface functions can be found in the documentation for openMesh_unstr.

See also:
openMesh_unstr.


Constructor & Destructor Documentation

openMesh::openMesh ( const openMesh & i )
 

Copy an existing openMesh.

Parameters:
i   instance to copy.


Member Function Documentation

openMesh & openMesh::operator= ( const openMesh & i )
 

Equality operator also validates node storage.

The mesh will be an exact duplicate of passed mesh.

Parameters:
i   instance to copy.
Returns:
reference to current openMesh.

void * openMesh::getCoords ( ) [inline]
 

Return pointer to all node coordinates.

Returns:
memory for coorinates.

const void * openMesh::getCoords ( ) const [inline]
 

Return pointer to all node coordinates.

User cannot modify.

Returns:
memory for coorinates.

RFPrecType openMesh::getPrec ( ) const [inline]
 

Return precision of the coordinates.

Returns:
precision of coordinate values.

size_t openMesh::getCur_allocation ( ) const [inline]
 

Return the current memory allocation.

Returns:
current size of coordinate allocation.

int openMesh::setCoords ( void * ncoords,
size_t alloc_coords ) [inline]
 

Set the coordinates memory to be from externally given pointer.

Instance takes over ownership.

Parameters:
ncoords   external memory to hold or holding coordinate values.
alloc_coords   allocation for the passed array ncoords.

void * openMesh::prec_offset ( void * start,
size_t offset ) [inline]
 

Return the pointer to memory of current precision at given offset.

Parameters:
start   start of memory.
offset   how many of datum to offset into the memory.
Returns:
pointer to memory at offset from start of precision set by set_prec().

const void * openMesh::prec_offset ( const void * start,
size_t offset ) const [inline]
 

Return the pointer to memory of current precision at given offset.

User cannot modify.

Parameters:
start   start of memory.
offset   how many of datum to offset into the memory.
Returns:
pointer to memory at offset from start of precision set by set_prec().

void * openMesh::coord_offset ( size_t offset ) [inline]
 

Offset into coord array using prec_offset().

See also:
prec_offset()
Parameters:
offset   offset value into coordinate memory.
Returns:
prec_offset(coords, offset).

const void * openMesh::coord_offset ( size_t offset ) const [inline]
 

Offset into coord array using prec_offset().

User cannot modify.

See also:
prec_offset().
Parameters:
offset   offset value into coordinate memory.
Returns:
prec_offset(coords, offset).

void * openMesh::start_str_nodes ( ) [inline]
 

Return the beginning of the structured coordinate memory.

Returns:
pointer to beginning of structured coordinate data.

const void * openMesh::start_str_nodes ( ) const [inline]
 

Return the beginning of the structured coordinate memory.

User cannot modify.

Returns:
pointer to beginning of structured coordinate data.

void * openMesh::new_coords ( ) const [inline]
 

Return block of memory of size given by cur_allocation.

Returns:
block of memory sized by cur_allocation.

void * openMesh::clone_coords ( ) const [inline]
 

Clone coordinate memory.

Leave current memory alone.

Returns:
cloned coordinate memory.

int openMesh::coord_alloc ( size_t nverts,
int do_update_dom = 1 )
 

Allocate the coorindate memory for nverts.

Parameters:
nverts   number of vertices to allocate for.
do_update_dom   update structured vertex memory. User can delay this for performance reasons.

int openMesh::allocate_coord_size ( size_t nreq ) [inline]
 

Allocate enough coordinate memory of at least size nreq.

Parameters:
nreq   minimum size of memory requested.

size_t openMesh::request_size ( size_t nreq ) const [inline]
 

Compute the next block allocation.

Used by allocate_coord_size(). Memory allocated in blocks. Rounds request up to next size given by coor_alloc_block.

Parameters:
nreq   minimum size requested.
Returns:
size rounded up to fit in allocation block size.

void openMesh::copy_strverts_to ( void * start_str )
 

Copy just the structured vertex coordinates to memory given by start_str.

Parameters:
start_str   storage to copy structured vertex location to.

int openMesh::updateStructNodes ( )
 

Update the pointers to memory in all structured domains.

Used whenever a new unstructured vertex has been added. If have a mixed structured and unstructured mesh, this can lead to a slight degradation in performance. To avoid this, define unstructued nodes first before allocating storage space for the structured node coordinates.

Returns:
1 success; 0 failure.

int openMesh::get_location ( const openMesh_vertex * vi,
float loc[3] ) const [inline]
 

Get the location of vertex specified by vi.

Parameters:
vi   pointer to vertex.
loc   location of vertex. Returned to user.
Returns:
1 success, 0 node has been deleted.

int openMesh::set_location ( openMesh_vertex * vi,
const float loc[3] ) [inline]
 

Set the location of vertex specified by vi.

Parameters:
vi   pointer to vertex.
loc   location of vertex to be set.
Returns:
1 success, 0 node has been deleted.

int openMesh::setVtx_offset ( RF_SIGNED_LONG v ) [inline]
 

Internal method used by set_vtxconn_offset().

Parameters:
v   vertex offset to set.

rf_mesh_interface * openMesh::newImpl ( ) const [virtual]
 

Returns:
new openMesh

Reimplemented from rf_mesh_interface.

int openMesh::create_unstrmesh ( ) [virtual]
 

Create new unstructured mesh.

Seperated from new structured mesh for efficiency sake. Must be implemented. Implementations that do not concern themselves with unstructured meshes can make this method a NOP.

Returns:
1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::create_strmesh ( ) [virtual]
 

Create new structured mesh.

Seperated from new unstructured mesh for efficiency sake. Must be implemented. Implementations that do not concern themselves with structured meshes can make this method a NOP.

Returns:
1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::delete_unstrmesh ( ) [virtual]
 

Delete unstructured mesh.

Seperated from deletion of structured mesh for efficiency sake. Must be implemented. Implementations that do not concern themselves with unstructured meshes can make this method a NOP.

Returns:
1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::delete_strmesh ( ) [virtual]
 

Create new structured mesh.

Seperated from new unstructured mesh for efficiency sake. Must be implemented. Implementations that do not concern themselves with structured meshes can make this method a NOP.

Returns:
1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::clear_mesh ( ) [virtual]
 

Empty mesh.

Does not necessarily mean that mesh is deleted though that is one way a representation can signal 'clear' mesh. The representation must be able to be loaded after clear complete. Base class implementation invokes delete str and unstr mesh methods to carry out work. It recreates empty structured domains for each structured domain it removes thus making it possible to instantly reload. Implementation can override if this implementation of clear does not make sense.

Returns:
1 success; 0 failure.

Reimplemented from rf_mesh_interface.

Reimplemented in openMeshVertexInfo.

RFPrecType openMesh::get_prec ( ) const [virtual]
 

If representation can handle both double and float precisions for vertex coordinates, then this method can be implemented.

Return specified precision.

See also:
set_prec()
Returns:
vertex precision to set.

Reimplemented from rf_mesh_interface.

int openMesh::set_prec ( RFPrecType p ) [virtual]
 

Only get one bite at this apple.

Only set the precision once. Once set, it will not be reset. If the precision passed as RFPrecNone, then default to RFPrecFloat -- ie minimize memory used.

Parameters:
prec   desired precision of mesh.

Reimplemented from rf_mesh_interface.

int openMesh::allocate_vertex_memory ( size_t nverts,
RFPrecType p ) [virtual]
 

Can only be called before loading all vertices (unstruct first followed by struct).

After that, only new_vertex (for unstructured vertices) and allocate_strvertex_memory (for structured domains) can be used.

Parameters:
nverts   number of vertices.
See also:
allocate_strvertex_memory() , set_prec() , rf_backend_interface::allocate_vertex_memory()
Parameters:
prec   desired precision of coordinates.
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::allocate_strvertex_memory ( size_t dom = 0 ) [virtual]
 

Allocate memory for coordinates of specified structured domain.

This method is a hint and hence does not need to be implemented. However, it is strongly suggested that implementations that do handle structured meshes do so.

See also:
allocate_vertex_memory()
Parameters:
dom   index of structured domain to allocate memory for.
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::set_vtxconn_offset ( RF_SIGNED_LONG vtx_offset ) [virtual]
 

Set current vertex offset.

External applications expect node numbering to begin with this number if they are sharing memory with openMesh. Usually 0 or 1. Implementations that can share memory with external applications should reimplement this method. Default method is a NOP.

Parameters:
vtx_offset   vertex offset.
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::allocate_element_memory ( const size_t * nele ) [virtual]
 

Hint of how many elements of each type to allocate.

Parameters:
nele   array of number of elements of each N_ELEMENT_TYPES.
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

RFConnOrder openMesh::GetInternalOrder ( ) const [virtual]
 

Return the internal connection order of the mesh representation.

Returns:
connection order; connect_no_order for error.

Reimplemented from rf_mesh_interface.

int openMesh::SetInternalOrder ( RFConnOrder order ) [virtual]
 

Set order of storage (if can change the order).

The default implementation returns 'not implemented' (2). Only implementations that can change the connectivity order (like openMesh) need implement this method.

See also:
get_conn_order() , SetConnectivityNASTRANOrder() , GetConnectivityIntOrder()
Parameters:
order   internal memory connection order.
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

const void* openMesh::vertex_coords ( RFPrecType * pr ) const [virtual]
 

Return the pointer to the start of the vertex memory if mesh representation holds coordinate memory in contiguious block.

This can improve speed by removing the need to copy coordinate values and reduces memory usage. If mesh representation does not have node coordinates in a block, it should return 0.

Parameters:
prec   precision of node coordinate values returned to caller.
Returns:
node coordinate memory. 0 if cannot represent node coordinates in contiguous memory.
See also:
compress_mesh()

Reimplemented from rf_mesh_interface.

const int* openMesh::connectivity ( int type,
RFConnOrder * order,
int * vtxs ) const [virtual]
 

Return the element connectivity memory if mesh representation can hold element connectivity in a contiguious block of memory.

This can improve speed by removing the need to copy element connectivities and reduce memory usage substantially. If mesh representation does not hold the element connectivity in either a block or in an approved order, it should return 0.

Parameters:
t   connectivity for these type of elements.
ord   node order within an element. Returned to caller.
vo   vertex offset number. Returned to caller.
Returns:
element connectivity for all elements of specified type. 0 if cannot represent element connectivity as contiguous memory.
See also:
compress_mesh()

Reimplemented from rf_mesh_interface.

RF_SIGNED_LONG openMesh::get_vtxconn_offset ( ) const [virtual]
 

Return current vertex offset.

External applications expect node numbering to begin with this number if they are sharing memory with openMesh. Usually 0 or 1. Implementations that can share memory with external applications should reimplement this method. Default method simply returns 0.

Returns:
current vertex offset.

Reimplemented from rf_mesh_interface.

size_t openMesh::add_domain ( const int * dmax ) [virtual]
 

Add structured domain with node range (1, 1, 1) to dmax.

Implementations must specify.

Parameters:
dmax   maximum ijk of nodes in structured domain.
Returns:
index of newly created domain. Generally user will need to use this index in subsequent calls in order to retrieve information about or update information in the structured domain.

Reimplemented from rf_mesh_interface.

size_t openMesh::add_domain ( str_domain_handle & dom ) [virtual]
 

Add structured domain specified by given domain interface.

Parameters:
dom   structured domain to copy information from.
Returns:
index of newly created domain. Generally user will need to use this index in subsequent calls in order to retrieve information about or update information in the structured domain.

Reimplemented from rf_mesh_interface.

vertex_handle openMesh::new_vertex ( ) [virtual]
 

Create a new vertex of specified type.

Typically implementors only need to return the pointer to the interface. The constructor sharable_pointer::sharable_pointer() then automatically creates a new handle.

See also:
sharable_pointer. , vertex_interface. Implementations must specify.
Parameters:
type   element type to create.
Returns:
abstract handle to new element created.

Reimplemented from rf_mesh_interface.

element_handle openMesh::new_element ( int type ) [virtual]
 

Create a new element of specified type.

Typically implementors only need to return the pointer to the interface. The constructor sharable_pointer::sharable_pointer() then automatically creates a new handle.

See also:
sharable_pointer. , element_interface. Implementations must specify.
Parameters:
type   element type to create.
Returns:
abstract handle to new element created.

Reimplemented from rf_mesh_interface.

int openMesh::ConnectIntOrder ( element_handle & ele,
const int * connect,
size_t nid,
int famid ) [virtual]
 

Specify newly created element ele (new_element()) has connectivity specified by connect.

Implementations must specify. Connectivity is in the user specified order. If no order is specified, the order is NASTRAN Mesh order. A mesh representation need not store more than one order. The requirement of this interface is that the currently set user order be mapped to the internal representation order.

See also:
SetConnectivityNASTRANOrder() , SetInternalOrder() , GetConnectivityIntOrder()
Parameters:
ele   element to be connected.
connect   connectivity of the element.
nid   element number. This number is invariant over the lifecycle of the mesh -- even in the presence of edits.
famid   family id of the element.
Returns:
1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::reconnect_vid ( element_handle & el,
const int * newv ) [virtual]
 

Change the connectivity of element ele to the connectivity specified in the array newv.

By default, the connectivity numbers are converted to vertex handles by use of lookup_vertex(), and the method reconnect(element_handle&, vertex_handle*) is invoked. Implementations may specify if they can more efficiently carry out the reconnection. see openMesh_unstr_mesh::reconnect()

Parameters:
ele   element to be connected.
newv   new connectivity of the element.\
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::reconnect_vid ( element_handle & el,
const RF_SIGNED_LONG * newv ) [virtual]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from rf_mesh_interface.

int openMesh::reconnect ( element_handle & el,
vertex_handle * nvv ) [virtual]
 

Change the connectivity of element ele to the connectivity specified in the array of vertex handles newv.

Implementations must specify. However, if implementation does not allow reconnect, can be a NOP. Note, certain operations might not succeed with certain applications if user chooses to implement as NOP.

Parameters:
ele   element to be connected.
newv   new connectivity of the element.
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::replace_vid ( element_handle & el,
RF_SIGNED_LONG oldv,
RF_SIGNED_LONG newv ) [virtual]
 

Change node number oldv to newv in element.

By default, the connectivity numbers are converted to vertex handles by use of lookup_vertex(), and the method replace()(element_handle&, vertex_handle&, vertex_handle&) is invoked. Implementations may specify if they can more efficiently carry out the reconnection. see openMesh_unstr_mesh::replace()

Parameters:
ele   current element.
oldv   old vertex number.
newv   new vertex number.
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::replace ( element_handle & el,
vertex_handle & oldv,
vertex_handle & nvewv ) [virtual]
 

Change node oldv to newv in element.

Implementations must specify. However, if implementation does not allow replace, can be a NOP. Note, certain operations might not succeed with certain applications if user chooses to implement as NOP.

Parameters:
ele   current element.
oldv   old vertex number.
newv   new vertex number.
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::merge_unstr_nodes ( const RFMergeVtxList & list ) [virtual]
 

Merge the nodes specified by the list.

Parameters:
list   list of merge node descriptors.
Returns:
1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::compress_mesh ( ) [virtual]
 

Mesh representations that can return vertex coordinates and/or element connectivity in a block, should try and implement this method.

After edits have added and removed elements/nodes, the block of memory must be updated to reflect this. If mesh representation cannot compress the mesh, then it must return 0 in response to vertex_coords() or GetConnectivityInOrder methods after edits.

See also:
vertex_coords() , GetConnectivityIntOrder().
Returns:
2 does not implement; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

int openMesh::must_remove_degeneracy ( ) const [virtual]
 

Each mesh representation must return whether or not it can tolerate degenerate elements.

If the representation does not override this method, the return is 1 -- ie, by default mesh representations cannot handle degenerate elements.

Returns:
1 mesh representation cannot handle degenerate elements, 0 it can.

Reimplemented from rf_mesh_interface.

int openMesh::stored_vertex_dimension ( ) const [virtual]
 

Does the mesh representation store the vertex dimension? By default the answer is no (0).

Returns:
0 representation does not store vertex dimension, 1 it does.

Reimplemented from rf_mesh_interface.

int openMesh::delete_vertex ( RF_SIGNED_LONG vid ) [virtual]
 

Delete specified vertex id.

Parameters:
vid   invariant vertex id.

Reimplemented from rf_mesh_interface.

int openMesh::delete_vertex ( vertex_handle & vtx ) [virtual]
 

Delete the specified vertex.

Parameters:
vid   vertex to delete.

Reimplemented from rf_mesh_interface.

int openMesh::delete_element ( element_handle & el ) [virtual]
 

Delete the element specified.

Default implementation simply disconnects the element from the mesh. Implementations can override.

Parameters:
ele   the element to delete.
Returns:
1 for success; 0 otherwise.

Reimplemented from rf_mesh_interface.

int openMesh::disconnect ( element_handle & el ) [virtual]
 

Disconnect element ele from the mesh.

Implementations must specify.

Parameters:
ele   element to be connected.

Reimplemented from rf_mesh_interface.

vertex_handle openMesh::first_vertex ( void ** cur ) [virtual]
 

Enumerate vertices but use iterator style.

This method returns the element interface to the first element.

Parameters:
eltype   element type to iterate over. MIXED (0) means all elements (default).
See also:
Next_el
Returns:
iterator to first element type.

Reimplemented from rf_mesh_interface.

vertex_handle openMesh::next_vertex ( void ** cur ) [virtual]
 

Enumerate elements but use iterator style.

This method returns the next element in list of specified type.

Parameters:
eltype   element type to iterate over. MIXED (0) means all elements (default).
See also:
First_el
Returns:
iterator to first element type.

Reimplemented from rf_mesh_interface.

element_handle openMesh::first_el ( void ** cur,
int eltype = 0 ) [virtual]
 

Enumerate elements but use iterator style.

This method returns the element interface to the first element.

See also:
Next_el
Parameters:
cur   current token used by representation for iteration. Returned to user.
eltype   element type to iterate over. MIXED (0) means all elements (default).
Returns:
iterator to first element type.

Reimplemented from rf_mesh_interface.

element_handle openMesh::next_el ( void ** cur,
int eltype = 0 ) [virtual]
 

Enumerate elements but use iterator style.

This method returns the next element in list of specified type.

See also:
First_el
Parameters:
cur   current token used by representation for iteration. Users should simply pass in a same value used in first_el. Value updated.
eltype   element type to iterate over. MIXED (0) means all elements (default).
Returns:
next element in list.

Reimplemented from rf_mesh_interface.

element_handle openMesh::init_element_iterator ( const vertex_handle & v,
RF_SIGNED_LONG * next_idx ) const [virtual]
 

Initialize the element loop when looping over all elements on a node.

Implementations must specify.

Parameters:
v   vertex that user wishes to find all elements connected to this node.
next_idx   user specified pointer to integer that is used by next_element() to advance to the next element. The value only has meaning to next_element().
Returns:
first element on vertex.

Reimplemented from rf_mesh_interface.

element_handle openMesh::next_element ( const vertex_handle & v,
RF_SIGNED_LONG * next_idx,
const element_handle & cur_el ) const [virtual]
 

Go to next element in link list of elements on a node.

Implementations must specify.

Parameters:
v   vertex that user wishes to find all elements connected to this node.
See also:
next_element()
Parameters:
next_idx   user specified pointer to integer that is used by next_element() to advance to the next element for implementations that use an index to do so.
Returns:
first element on vertex.

Reimplemented from rf_mesh_interface.