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

med_impl Class Reference

Internal ICEM CFD representation of the mesh interface. More...

#include <med_impl.h>

Inheritance diagram for med_impl:

OpenGatewayBase gateway_mesh rf_mesh_interface base_interface med_unsstr_impl List of all members.

Public Methods

 med_impl (const ProjInterface *iProj=0, const GatewayAttrList *iList=0, const GatewayAttrList *iSchema=0)
 Initialize the meshes to nil and ownership to 0.

 med_impl (const med_impl &i)
 NOP Equal operator and copy constructor.

med_impl& operator= (const med_impl &i)
 NOP Equal operator and copy constructor.

 ~med_impl ()
 invoke delete_mesh() to destroy the mesh.

std_mesh* getUnstrmesh ()
 Return unstructured mesh. More...

const std_mesh* getUnstrmesh () const
 Return unstructured mesh. More...

str_mesh* getStrmesh ()
 Return structured mesh. More...

const str_mesh* getStrmesh () const
 Return structured mesh. More...

char getOwnership () const
 Get current ownership bit mask. More...

char getOwnershipUnstruct () const
 Get the ownership of unstruct mesh. More...

char getOwnershipStruct () const
 Get the ownership of struct mesh. More...

void setUnstrmesh (std_mesh *um)
 Set unstructured mesh. More...

void setStrmesh (str_mesh *sm)
 Set structured mesh. More...

void setOwnershipUnstruct (int iOwn)
 Set Ownership bit for unstruct mesh. More...

void setOwnershipStruct (int iOwn)
 Set Ownership bit for struct mesh. More...

int use_mesh () const
 Bit mask of meshes used. More...

void CreateElNumHash ()
 Create hash table.

void DeleteElNumHash ()
 Delete hash table.

void ClearElNumHash ()
 Clear the hash table for new set of entries.

void AddElNumHash (const element *iEl, RF_SIGNED_LONG iNumber)
 Add element to number entry in hash table. More...

RF_SIGNED_LONG LookupElNum (const element *iEl) const
 Lookup invariant element number. More...

element_handle VertexToNode (const vertex_handle& iVert) const
 Get the node element for this vertex IFF in vertex --> node map. More...

void ResizeVertexToNodeMap (size_t iSize)
 Size Vertex to node array but fill with -1 if have to resize. More...

int AddVertexToNodeMap (const vertex_handle& iVertex, const element_handle& iElement)
 Add vertex id to NODE element to map. More...

void InvalidateElementMap ()
 Invalidate the element id to handle map. More...

void ValidateElementMap ()
 Validate the element id to handle map. More...

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

GatewayAttrHandle CreateAnAttribute (const GatewaySchemeHandle& iScheme, unsigned int iVectorSize = 0) const
 Create a new attribute instance for either a node or an element based on the scheme. More...

int AddAttributeToVertex (vertex_handle& iVertex, const char *iAttrName, const GatewayAttrValue& iVal)
 Add an attribute to the vertex. More...

int AddVectorAttributeToVertex (vertex_handle& iVertex, const char *iVectorName, const GatewayAttrValue *iVals, unsigned int iVectorSize=0)
 Add a vector attribute to the vertex specified by the list of doubles (for double attributes only for now). More...

int AddDoubleVectorAttributeToVertex (vertex_handle& iVertex, const char *iVectorName, const double *iVals, unsigned int iVectorSize=0)
 Specialization to just double values to create a vector attribute. More...

int AddComponentAttributeToVertex (vertex_handle& iVertex, const char *iVectorName, const GatewayAttrValue& iVal, unsigned int iIndex=0, unsigned int iVectorSize=0)
 Add the attribute as a component of a vector attribute. More...

int AddComponentAttributeToVertexByName (vertex_handle& iVertex, const char *iVectorName, const GatewayAttrValue& iVal, const char *iComp, unsigned int iVectorSize=0)
 Add the attribute as a component of a vector attribute by component name instead of index. More...

rf_mesh_interfacenewImpl () const
 Return new med_impl. More...

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 suspend_undo ()
 Suspend undo action for those mesh reps that have such a concept. More...

int resume_undo ()
 Resume undo action for those mesh reps that have such a concept. More...

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

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

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

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

int delete_vertex (vertex_handle& vtx)
 Delete the specified vertex. 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 disconnect (element_handle& el)
 Disconnect element ele from the mesh. More...

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 (element_handle& el, vertex_handle& oldv, vertex_handle& nvewv)
 Change node oldv to newv in element. More...

int stored_vertex_dimension () const
 Does the mesh representation store the vertex dimension? By default the answer is no (0). 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...

base_vertex* next_vertex_full (void **cur, int zeroOk)
 Get next vertex both in case of first_vertex() (zeroOk=1) and next_vertex() (zeroOk = 0). More...

int enumerate_vertices (enum_vertex_int_func f, void *d)
 Loop over all vertices in the mesh and invoke function f on each one. 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* next_el_full (void **cur, int eltype, int zeroOk)
 Get next element both in case of first_el() (zeroOk=1) and next_el() (zeroOk = 0). More...

int enumerate_elements (int type, enum_element_int_func f, void *data)
 Loop over all elements of type eltype in the mesh and invoke function f on each one. 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...

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 release_connectivity_info ()
 Release the connectivity information (if it can be safely released). 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...

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_ptwin (const vertex_handle& iVtx) const
 Get the periodic twin of the specified vertex. More...

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_ptwin (const vertex_handle& iVtx, RF_SIGNED_LONG iPtwin)
 Get the periodic twin of the specified vertex. More...

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& v) const
RF_SIGNED_LONG getNumber (const element_handle& e) const
 Return the invariant element number. More...

int BaseVerticesIntOrder (const element_handle& ele, vertex_handle *vv) const
 Return the vertex handles for the element in user specified order. 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 GetPtwinIntOrder (const element_handle& ele, int *vv) const
 Return the vertex indices of the periodic twins of the element in internal connectivity order. More...

int intersect_triangles (const float tri1[3][3], const float tri2[3][3]) const
 Intersect two triangles given by coordinates. More...

double aspect_ratio_quad (const float locs[][3]) const
 Compute aspect ratio for a quad element. More...

double aspect_ratio_tri (const float locs[][3]) const
 Compute aspect ratio for a tri element. More...

int project_to_curves (const float loc[3], float proj[3], float tangent[3], int *famid) const
 Project the point to the curves in the CAD model. More...

int project_to_curves (const double loc[3], double proj[3], double tangent[3], int *famid) const
int max_pid_nogeom () const
 Return mesh's view of the maximum pid number. More...

int family_pid_nogeom (const char *name) const
 Return the group (family) id number of specified group (family). More...

const char* family_name_nogeom (int famid) const
 Return the group (family) name specified by group (family) id number. More...

int delete_family_nogeom (const char *name)
 Delete from the mesh representation the specified group (family). More...

int set_family_nogeom (int famid, const char *name)
 Add new group (family) to mesh representation's view of the current family list. More...

int set_family_by_name_nogeom (int pid, const char *name)
 Add new group (family) to mesh representation's view of the current family list. More...

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...

size_t n_str_vertices () const
 Return the number of structured vertices in the mesh. More...

size_t n_str_volelements () const
 Return the number of structured volume elements in the mesh. More...

size_t n_str_faceelements () const
 Return the number of structured face elements in the mesh. More...

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

int setDegree (int degree)
 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...

int set_strdomain_name (size_t i, const char *name)
 Set the name of the ith structured domain. More...

int set_strdomain_family (size_t i, const char *fam)
 Set the family name of the ith structured domain. More...


Protected Attributes

std_mesh* unstrmesh
 ICEM CFD unstructured mesh.

str_mesh* strmesh
 ICEM CFD structured mesh.

element_handle_list _elements
 Element id number to element handle map.

RFLongestSignedList _vertexToNode
 Vertex number to NODE number map.

void* _elToNumber
 Hash table of element pointer to invariant number. More...

char ownership
 1 if object owns meshes, 0 if not.

char curIgnoreState
 if 1, then undo/redo suspended.


Detailed Description

Internal ICEM CFD representation of the mesh interface.

Uses std_mesh to represent unstructured meshes and strmesh structured. The ownership flag signals whether or not the object owns both of the meshes.

Examples:

med_impl.C.


Member Function Documentation

std_mesh * med_impl::getUnstrmesh ( ) [inline]
 

Return unstructured mesh.

Returns:
unstrmesh.

const std_mesh * med_impl::getUnstrmesh ( ) const [inline]
 

Return unstructured mesh.

Returns:
unstrmesh.
Examples:
med_impl.C.

str_mesh * med_impl::getStrmesh ( ) [inline]
 

Return structured mesh.

Returns:
strmesh.

const str_mesh * med_impl::getStrmesh ( ) const [inline]
 

Return structured mesh.

Returns:
strmesh.
Examples:
med_impl.C.

char med_impl::getOwnership ( ) const [inline]
 

Get current ownership bit mask.

See also:
getOwnershipUnstruct() , getOwnershipStruct()

char med_impl::getOwnershipUnstruct ( ) const [inline]
 

Get the ownership of unstruct mesh.

If 0, owned externally; otherwise owned by med_impl

Examples:
med_impl.C.

char med_impl::getOwnershipStruct ( ) const [inline]
 

Get the ownership of struct mesh.

If 0, owned externally; otherwise owned by med_impl

Examples:
med_impl.C.

void med_impl::setUnstrmesh ( std_mesh * um ) [inline]
 

Set unstructured mesh.

Parameters:
um   new unstructured mesh.

void med_impl::setStrmesh ( str_mesh * sm ) [inline]
 

Set structured mesh.

Parameters:
sm   new structured mesh.

void med_impl::setOwnershipUnstruct ( int iOwn ) [inline]
 

Set Ownership bit for unstruct mesh.

See also:
getOwnership() , getOwnershipUnstruct()
Parameters:
iOwn   if 0, owned externally; otherwise owned by med_impl.

void med_impl::setOwnershipStruct ( int iOwn ) [inline]
 

Set Ownership bit for struct mesh.

See also:
getOwnership() , getOwnershipStruct()
Parameters:
iOwn   if 0, owned externally; otherwise owned by med_impl.

int med_impl::use_mesh ( ) const
 

Bit mask of meshes used.

Returns:
0 no meshes; 1 just unstructured; 2 just structured; 3 mixed (unstructured + structured).
Examples:
med_impl.C.

void med_impl::AddElNumHash ( const element * iEl,
RF_SIGNED_LONG iNumber )
 

Add element to number entry in hash table.

Parameters:
iEl   element to add.
iNumber   associated number.
Examples:
med_impl.C.

RF_SIGNED_LONG med_impl::LookupElNum ( const element * iEl ) const
 

Lookup invariant element number.

Parameters:
iEl   element pointer.
Returns:
element number; -1 if element not found.
Examples:
med_impl.C.

element_handle med_impl::VertexToNode ( const vertex_handle & iVert ) const
 

Get the node element for this vertex IFF in vertex --> node map.

Parameters:
iVert   vertex to get corresponding node for.
Returns:
handle to NODE element; 0 if map fails.
Examples:
med_impl.C.

void med_impl::ResizeVertexToNodeMap ( size_t iSize )
 

Size Vertex to node array but fill with -1 if have to resize.

This is so that new entries are 'invalid' in terms of the mapping of vertex to node element.

Parameters:
iSize   size of vertex to node map.
Examples:
med_impl.C.

int med_impl::AddVertexToNodeMap ( const vertex_handle & iVertex,
const element_handle & iElement )
 

Add vertex id to NODE element to map.

Parameters:
iVertex   vertex.
iElement   corresponding node element.
Returns:
1 if ok; 0 if some error (like vertex or element == 0).
Examples:
med_impl.C.

void med_impl::InvalidateElementMap ( ) [virtual]
 

Invalidate the element id to handle map.

Just sets the validity status. Representations whose map is always valid can simply implement ValidateElementMap as SetElementMapValidity(1)

See also:
ValidateElementMap() , GetElementMapValidity() , SetElementMapValidity()

Reimplemented from gateway_mesh.

Examples:
med_impl.C.

void med_impl::ValidateElementMap ( ) [virtual]
 

Validate the element id to handle map.

This must recreate the element id to element handle map and set the element map. The validity status should be set to one afterwards.

See also:
InvalidateElementMap() , GetElementMapValidity() , SetElementMapValidity()

Reimplemented from gateway_mesh.

Examples:
med_impl.C.

element_handle med_impl::lookup_element ( RF_SIGNED_LONG iEID ) const [virtual]
 

Return element given invariant id number.

Implementations that cannot implement this method in a performant manner should simply return 0. There is no guarantee that this method will succeed because of performance concerns. If application requires this method, the application should use mesh implementation that can carry this operation out in a performant manner (OpenGateway for instance).

Parameters:
iEid   invariant element id number.
Returns:
element for given id number; 0 for failure.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

GatewayAttrHandle med_impl::CreateAnAttribute ( const GatewaySchemeHandle & iScheme,
unsigned int iVectorSize = 0 ) const [virtual]
 

Create a new attribute instance for either a node or an element based on the scheme.

The scheme name is the name of the attribute to create from the schema. Implementation dependent because different systems will have different attributes.

Parameters:
iSchema   Schema of attribute to create for node or element. Caller responsible for checking type if uses this interface.
iVectorSize   size of vector. If 0 (or if scalar) then attribute is not resized. TODO -- only dynamically resize dynamic vector types.
Returns:
handle to attribute. If == NULL_int, then creation unsuccessful.

Reimplemented from OpenGatewayBase.

Examples:
med_impl.C.

int med_impl::AddAttributeToVertex ( vertex_handle & iVertex,
const char * iAttrName,
const GatewayAttrValue & iVal ) [virtual]
 

Add an attribute to the vertex.

If named attribute is already attached to vertex, it will be replaced by the new value specified here (ie acts as 'set').

Parameters:
iVertex   vertex.
iAttrName   attribute name.
iVal   value to set for the attribute.
Returns:
1 for success; 0 otherwise.

Reimplemented from gateway_mesh.

Examples:
med_impl.C.

int med_impl::AddVectorAttributeToVertex ( vertex_handle & iVertex,
const char * iVectorName,
const GatewayAttrValue * iVals,
unsigned int iVectorSize = 0 ) [virtual]
 

Add a vector attribute to the vertex specified by the list of doubles (for double attributes only for now).

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

Parameters:
iVectorSize   if 0, then the array of values is taken to be the vector size specified in the scheme. Otherwise, it is the number of entries in iVals and if the size exceeds the size in the scheme, the attribute will be resized.

Reimplemented from gateway_mesh.

Examples:
med_impl.C.

int med_impl::AddDoubleVectorAttributeToVertex ( vertex_handle & iVertex,
const char * iVectorName,
const double * iVals,
unsigned int iVectorSize = 0 ) [virtual]
 

Specialization to just double values to create a vector attribute.

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

Reimplemented from gateway_mesh.

Examples:
med_impl.C.

int med_impl::AddComponentAttributeToVertex ( vertex_handle & iVertex,
const char * iVectorName,
const GatewayAttrValue & iVal,
unsigned int iIndex = 0,
unsigned int iVectorSize = 0 ) [virtual]
 

Add the attribute as a component of a vector attribute.

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

Parameters:
iVectorName   name of vector attribute to which we are adding the attribute.
iIndex   component for the attribute to be added.
iVectorSize   if the size is > 0 AND the index is greater than the current size, the vector will be resized.
See also:
GatewayVector::SetComponentValue

Reimplemented from gateway_mesh.

Examples:
med_impl.C.

int med_impl::AddComponentAttributeToVertexByName ( vertex_handle & iVertex,
const char * iVectorName,
const GatewayAttrValue & iVal,
const char * iComp,
unsigned int iVectorSize = 0 ) [virtual]
 

Add the attribute as a component of a vector attribute by component name instead of index.

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

Parameters:
iComp   component name of vector.

Reimplemented from gateway_mesh.

Examples:
med_impl.C.

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

Return new med_impl.

Returns:
new med_impl object.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

int med_impl::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.

Reimplemented in med_unsstr_impl.

Examples:
med_impl.C.

int med_impl::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.

Reimplemented in med_unsstr_impl.

Examples:
med_impl.C.

int med_impl::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.

Reimplemented in med_unsstr_impl.

Examples:
med_impl.C.

int med_impl::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.

Reimplemented in med_unsstr_impl.

Examples:
med_impl.C.

int med_impl::suspend_undo ( ) [virtual]
 

Suspend undo action for those mesh reps that have such a concept.

By default, mesh representation suspends undo operation during copying.

See also:
copy_unstr_from() , copy_str_from()
Returns:
1 for success, 0 for failure.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

int med_impl::resume_undo ( ) [virtual]
 

Resume undo action for those mesh reps that have such a concept.

By default, mesh representation suspends undo operation during copying of meshes (#.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

RFConnOrder med_impl::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.

Examples:
med_impl.C.

element_handle med_impl::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.

Examples:
med_impl.C.

vertex_handle med_impl::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.

Examples:
med_impl.C.

int med_impl::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.

Examples:
med_impl.C.

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

Delete the specified vertex.

Parameters:
vid   vertex to delete.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

int med_impl::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.

Examples:
med_impl.C.

int med_impl::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.

Examples:
med_impl.C.

int med_impl::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.

Examples:
med_impl.C.

int med_impl::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.

Examples:
med_impl.C.

int med_impl::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.

Examples:
med_impl.C.

vertex_handle med_impl::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.

Examples:
med_impl.C.

vertex_handle med_impl::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.

Examples:
med_impl.C.

base_vertex * med_impl::next_vertex_full ( void ** cur,
int zeroOk )
 

Get next vertex both in case of first_vertex() (zeroOk=1) and next_vertex() (zeroOk = 0).

Parameters:
cur   current token. Updated and returned to user.
zeroOk   if one, the current vertex can be 0, if 0 don't restart iteration by going past end.
Returns:
next vertex.
Examples:
med_impl.C.

int med_impl::enumerate_vertices ( enum_vertex_int_func f,
void * d ) [virtual]
 

Loop over all vertices in the mesh and invoke function f on each one.

Default implementation uses the for ... implementation. Users can override if desired.

See also:
first_vertex() , next_vertex().
Parameters:
f   callback function to invoke on each vertex.
data   user specified anonymous data for callback function f.
Returns:
0 - loop interrupted by function f, otherwise 1.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

element_handle med_impl::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.

Examples:
med_impl.C.

element_handle med_impl::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.

Examples:
med_impl.C.

element * med_impl::next_el_full ( void ** cur,
int eltype,
int zeroOk )
 

Get next element both in case of first_el() (zeroOk=1) and next_el() (zeroOk = 0).

Parameters:
cur   current token. Updated and returned to user.
eltype   element type to iterate over.
zeroOk   if one, the current element can be 0, if 0 don't restart iteration by going past end.
Returns:
next element.
Examples:
med_impl.C.

int med_impl::enumerate_elements ( int type,
enum_element_int_func f,
void * data ) [virtual]
 

Loop over all elements of type eltype in the mesh and invoke function f on each one.

if type specified as MIXED, then all elements in the mesh will be looped over. Default implementation uses the for ... implementation. Users can override if desired.

See also:
first_el() , next_el()
Parameters:
eltype   element type to loop over.
f   callback function to invoke on each element of type.
data   user specified anonymous data for callback function f.
Returns:
0 - loop interrupted by function f, otherwise 1.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

element_handle med_impl::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.

Examples:
med_impl.C.

element_handle med_impl::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.

Examples:
med_impl.C.

int med_impl::incident_elements ( int nvf,
vertex_handle * fverts,
int ordf,
int max_return,
element_handle * elements,
int * face_numbers ) const [virtual]
 

All representations should implement this method.

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

Eventually this method will be deprecated. See incident_elements(int,vertex_handle*,int,element_handle_list&,int*)

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

int med_impl::release_connectivity_info ( ) [virtual]
 

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

Returns:
2 not implemented; 1 success; 0 failure.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

size_t med_impl::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.

Examples:
med_impl.C.

size_t med_impl::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.

size_t med_impl::n_unstr_vertices ( ) const [virtual]
 

Return number of unstructured vertices created.

This includes deleted vertices.

Returns:
number unstructured vertices created.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

size_t med_impl::n_unstr_elements ( int type ) const [virtual]
 

Return number of unstructured elements of specified type created.

This includes deleted elements.

Parameters:
type   element type.
Returns:
number unstructured elements of specified type created.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

size_t med_impl::n_unstr_vertices_actual ( ) const [virtual]
 

Return current number of vertices in mesh.

Default implementation counts non-deleted vertices by hand. If implementation keeps track of the number of deleted vertices, it is suggested that the implementation override this method.

Returns:
number unstructured vertices.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

size_t med_impl::n_unstr_elements_actual ( int type ) const [virtual]
 

Return current number of unstructured elements of specified type in mesh.

If implementation keeps track of the number of deleted elements, it is suggested that the implementation override this method.

See also:
count_unstr_elements()
Parameters:
type   element type.
Returns:
number unstructured elements of specified type in mesh.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

size_t med_impl::count_unstr_elements ( int type,
size_t * s ) const [virtual]
 

Return current number of unstructured elements of specified type in mesh.

Default implementation counts the non-deleted elements by hand. If implementation keeps track of the number of deleted elements, it is suggested that the implementation override this method. Also returned starting element id.

Parameters:
type   element type.
start   starting element id of type.
Returns:
number unstructured elements of specified type in mesh.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

RF_SIGNED_LONG med_impl::getNumber ( const vertex_handle & v ) const [virtual]
 

Return invariant id number of specified vertex.

Returns:
invariant vertex id.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.

vertex_handle med_impl::lookup_vertex ( RF_SIGNED_LONG vid ) const [virtual]
 

Return vertex given invariant id number.

Returns:
vid invariant vertex id.

Reimplemented from rf_mesh_interface.

Examples:
med_impl.C.