moab
CN.cpp File Reference
#include "moab/CN.hpp"
#include "MBCNArrays.hpp"
#include "MBCN.h"
#include <assert.h>
#include <string.h>

Go to the source code of this file.

Namespaces

namespace  moab
 

Class representing axis-aligned bounding box.


Defines

#define MUC   CN::mUpConnMap[this_type][source_dim][target_dim]

Functions

template<typename T >
static short int moab::side_number (const T *parent_conn, const EntityType parent_type, const T *child_conn, const int child_num_verts, const int child_dim, int &side_no, int &sense, int &offset)
template<typename T >
bool moab::connectivity_match (const T *conn1_i, const T *conn2_i, const int num_vertices, int &direct, int &offset)
void MBCN_GetBasis (int *rval)
 get the basis of the numbering system
void MBCN_SetBasis (const int in_basis)
 set the basis of the numbering system
void MBCN_EntityTypeName (const int this_type, char *rval, int rval_len)
 return the string type name for this type
void MBCN_EntityTypeFromName (const char *name, int *rval)
 given a name, find the corresponding entity type
void MBCN_Dimension (const int t, int *rval)
 return the topological entity dimension
void MBCN_VerticesPerEntity (const int t, int *rval)
 return the number of (corner) vertices contained in the specified type.
void MBCN_NumSubEntities (const int t, const int d, int *rval)
 return the number of sub-entities bounding the entity.
void MBCN_SubEntityType (const int this_type, const int sub_dimension, const int index, int *rval)
void MBCN_SubEntityVertexIndices (const int this_type, const int sub_dimension, const int sub_index, int sub_entity_conn[])
void MBCN_AdjacentSubEntities (const int this_type, const int *source_indices, const int num_source_indices, const int source_dim, const int target_dim, int *index_list, int *num_indices, const int operation_type, int *rval)
void MBCN_SideNumber (const int parent_type, const int *child_conn_indices, const int child_num_verts, const int child_dim, int *side_no, int *sense, int *offset)
void MBCN_SideNumberInt (const int *parent_conn, const EntityType parent_type, const int *child_conn, const int child_num_verts, const int child_dim, int *side_no, int *sense, int *offset)
void MBCN_SideNumberUint (const unsigned int *parent_conn, const EntityType parent_type, const unsigned int *child_conn, const int child_num_verts, const int child_dim, int *side_no, int *sense, int *offset)
void MBCN_SideNumberLong (const long *parent_conn, const EntityType parent_type, const long *child_conn, const int child_num_verts, const int child_dim, int *side_no, int *sense, int *offset)
void MBCN_SideNumberUlong (const unsigned long *parent_conn, const EntityType parent_type, const unsigned long *child_conn, const int child_num_verts, const int child_dim, int *side_no, int *sense, int *offset)
void MBCN_SideNumberVoid (void *const *parent_conn, const EntityType parent_type, void *const *child_conn, const int child_num_verts, const int child_dim, int *side_no, int *sense, int *offset)
void MBCN_OppositeSide (const int parent_type, const int child_index, const int child_dim, int *opposite_index, int *opposite_dim, int *rval)
void MBCN_ConnectivityMatchInt (const int *conn1, const int *conn2, const int num_vertices, int *direct, int *offset, int *rval)
void MBCN_ConnectivityMatchUint (const unsigned int *conn1, const unsigned int *conn2, const int num_vertices, int *direct, int *offset, int *rval)
void MBCN_ConnectivityMatchLong (const long *conn1, const long *conn2, const int num_vertices, int *direct, int *offset, int *rval)
void MBCN_ConnectivityMatchUlong (const unsigned long *conn1, const unsigned long *conn2, const int num_vertices, int *direct, int *offset, int *rval)
void MBCN_ConnectivityMatchVoid (void *const *conn1, void *const *conn2, const int num_vertices, int *direct, int *offset, int *rval)
void MBCN_HasMidEdgeNodes (const int this_type, const int num_verts, int *rval)
void MBCN_HasMidFaceNodes (const int this_type, const int num_verts, int *rval)
void MBCN_HasMidRegionNodes (const int this_type, const int num_verts, int *rval)
void MBCN_HasMidNodes (const int this_type, const int num_verts, int mid_nodes[4])
void MBCN_HONodeParent (int elem_type, int num_nodes, int ho_node_index, int *parent_dim, int *parent_index)
void MBCN_HONodeIndex (const int this_type, const int num_verts, const int subfacet_dim, const int subfacet_index, int *rval)
template<typename T >
int moab::permute_this (EntityType t, const int dim, T *conn, const int indices_per_ent, const int num_entries)
template<typename T >
int moab::rev_permute_this (EntityType t, const int dim, T *conn, const int indices_per_ent, const int num_entries)

Define Documentation

#define MUC   CN::mUpConnMap[this_type][source_dim][target_dim]

Function Documentation

void MBCN_AdjacentSubEntities ( const int  this_type,
const int *  source_indices,
const int  num_source_indices,
const int  source_dim,
const int  target_dim,
int *  index_list,
int *  num_indices,
const int  operation_type,
int *  rval 
)

return the vertices of the specified sub entity

Parameters:
parent_connConnectivity of parent entity
parent_typeEntity type of parent entity
sub_dimensionDimension of sub-entity being queried
sub_indexIndex of sub-entity being queried
sub_entity_connConnectivity of sub-entity, based on parent_conn and canonical ordering for parent_type
num_sub_verticesNumber of vertices in sub-entity For a specified set of sides of given dimension, return the intersection or union of all sides of specified target dimension adjacent to those sides.
this_typeType of entity for which sub-entity connectivity is being queried
source_indicesIndices of sides being queried
num_source_indicesNumber of entries in source_indices
source_dimDimension of source entity
target_dimDimension of target entity
index_listIndices of target entities (returned)
operation_typeSpecify either CN::INTERSECT (0) or CN::UNION (1) to get intersection or union of target entity lists over source entities

Definition at line 740 of file CN.cpp.

{
  std::vector<int> tmp_index_list;
  *rval = CN::AdjacentSubEntities((EntityType)this_type, source_indices, 
                                    num_source_indices, source_dim, target_dim, 
                                    tmp_index_list, operation_type);
  std::copy(tmp_index_list.begin(), tmp_index_list.end(), index_list);
  *num_indices = tmp_index_list.size();
}
void MBCN_ConnectivityMatchInt ( const int *  conn1,
const int *  conn2,
const int  num_vertices,
int *  direct,
int *  offset,
int *  rval 
)

given two connectivity arrays, determine whether or not they represent the same entity.

Parameters:
conn1Connectivity array of first entity
conn2Connectivity array of second entity
num_verticesNumber of entries in conn1 and conn2
directIf positive, entities have the same sense (returned)
offsetOffset of conn2's first vertex in conn1
Returns:
int Returns true if conn1 and conn2 match

Definition at line 851 of file CN.cpp.

{
  *rval = CN::ConnectivityMatch(conn1, conn2, num_vertices, 
                                  *direct, *offset);
}
void MBCN_ConnectivityMatchLong ( const long *  conn1,
const long *  conn2,
const int  num_vertices,
int *  direct,
int *  offset,
int *  rval 
)

Definition at line 869 of file CN.cpp.

{
  *rval = CN::ConnectivityMatch(conn1, conn2, num_vertices, 
                                  *direct, *offset);
}
void MBCN_ConnectivityMatchUint ( const unsigned int *  conn1,
const unsigned int *  conn2,
const int  num_vertices,
int *  direct,
int *  offset,
int *  rval 
)

Definition at line 860 of file CN.cpp.

{
  *rval = CN::ConnectivityMatch(conn1, conn2, num_vertices, 
                                  *direct, *offset);
}
void MBCN_ConnectivityMatchUlong ( const unsigned long *  conn1,
const unsigned long *  conn2,
const int  num_vertices,
int *  direct,
int *  offset,
int *  rval 
)

Definition at line 878 of file CN.cpp.

{
  *rval = CN::ConnectivityMatch(conn1, conn2, num_vertices, 
                                  *direct, *offset);
}
void MBCN_ConnectivityMatchVoid ( void *const *  conn1,
void *const *  conn2,
const int  num_vertices,
int *  direct,
int *  offset,
int *  rval 
)

Definition at line 887 of file CN.cpp.

{
  *rval = CN::ConnectivityMatch(conn1, conn2, num_vertices, 
                                  *direct, *offset);
}
void MBCN_Dimension ( const int  t,
int *  rval 
)

return the topological entity dimension

Definition at line 670 of file CN.cpp.

{
  *rval = CN::Dimension((EntityType)t);
}
void MBCN_EntityTypeFromName ( const char *  name,
int *  rval 
)

given a name, find the corresponding entity type

Definition at line 664 of file CN.cpp.

{
  *rval = CN::EntityTypeFromName(name);
}
void MBCN_EntityTypeName ( const int  this_type,
char *  rval,
int  rval_len 
)

return the string type name for this type

Definition at line 655 of file CN.cpp.

{
  const char *rval_tmp = CN::EntityTypeName((EntityType)this_type);
  int rval_len_tmp = strlen(rval_tmp);
  rval_len_tmp = (rval_len_tmp < rval_len ? rval_len_tmp : rval_len);
  strncpy(rval, rval_tmp, rval_len_tmp);
}
void MBCN_GetBasis ( int *  rval)

get the basis of the numbering system

Definition at line 649 of file CN.cpp.

{*rval = CN::GetBasis();}
void MBCN_HasMidEdgeNodes ( const int  this_type,
const int  num_verts,
int *  rval 
)

true if entities of a given type and number of nodes indicates mid edge nodes are present.

Parameters:
this_typeType of entity for which sub-entity connectivity is being queried
num_vertsNumber of nodes defining entity
Returns:
int Returns true if this_type combined with num_nodes indicates mid-edge nodes are likely

Definition at line 901 of file CN.cpp.

{
  *rval = CN::HasMidEdgeNodes((EntityType)this_type, num_verts);
}
void MBCN_HasMidFaceNodes ( const int  this_type,
const int  num_verts,
int *  rval 
)

true if entities of a given type and number of nodes indicates mid face nodes are present.

Parameters:
this_typeType of entity for which sub-entity connectivity is being queried
num_vertsNumber of nodes defining entity
Returns:
int Returns true if this_type combined with num_nodes indicates mid-face nodes are likely

Definition at line 912 of file CN.cpp.

{
  *rval = CN::HasMidFaceNodes((EntityType)this_type, num_verts);
}
void MBCN_HasMidNodes ( const int  this_type,
const int  num_verts,
int  mid_nodes[4] 
)

true if entities of a given type and number of nodes indicates mid edge/face/region nodes are present.

Parameters:
this_typeType of entity for which sub-entity connectivity is being queried
num_vertsNumber of nodes defining entity
mid_nodesIf mid_nodes[i], i=1..3 is true, indicates that mid-edge (i=1), mid-face (i=2), and/or mid-region (i=3) nodes are likely

Definition at line 935 of file CN.cpp.

{
  return CN::HasMidNodes((EntityType)this_type, num_verts, mid_nodes);
}
void MBCN_HasMidRegionNodes ( const int  this_type,
const int  num_verts,
int *  rval 
)

true if entities of a given type and number of nodes indicates mid region nodes are present.

Parameters:
this_typeType of entity for which sub-entity connectivity is being queried
num_vertsNumber of nodes defining entity
Returns:
int Returns true if this_type combined with num_nodes indicates mid-region nodes are likely

Definition at line 923 of file CN.cpp.

{
  *rval = CN::HasMidRegionNodes((EntityType)this_type, num_verts);
}
void MBCN_HONodeIndex ( const int  this_type,
const int  num_verts,
const int  subfacet_dim,
const int  subfacet_index,
int *  rval 
)

for an entity of this type with num_verts vertices, and a specified subfacet (dimension and index), return the index of the higher order node for that entity in this entity's connectivity array

Parameters:
this_typeType of entity being queried
num_vertsNumber of vertices for the entity being queried
subfacet_dimDimension of sub-entity being queried
subfacet_indexIndex of sub-entity being queried
Returns:
index Index of sub-entity's higher-order node

Definition at line 969 of file CN.cpp.

{
  
  *rval = CN::HONodeIndex((EntityType)this_type, num_verts, subfacet_dim, subfacet_index);

}
void MBCN_HONodeParent ( int  elem_type,
int  num_nodes,
int  ho_node_index,
int *  parent_dim,
int *  parent_index 
)

given data about an element and a vertex in that element, return the dimension and index of the sub-entity that the vertex resolves. If it does not resolve a sub-entity, either because it's a corner node or it's not in the element, -1 is returned in both return values.

Parameters:
elem_typeType of entity being queried
num_nodesThe number of nodes in the element connectivity
ho_node_indexThe position of the HO node in the connectivity list (zero based)
parent_dimDimension of sub-entity high-order node resolves (returned)
parent_indexIndex of sub-entity high-order node resolves (returned)

Definition at line 951 of file CN.cpp.

{
  return CN::HONodeParent((EntityType)elem_type, num_nodes, ho_node_index, 
                            *parent_dim, *parent_index);
}
void MBCN_NumSubEntities ( const int  t,
const int  d,
int *  rval 
)

return the number of sub-entities bounding the entity.

Definition at line 682 of file CN.cpp.

{
  *rval = CN::NumSubEntities((EntityType)t, d);
}
void MBCN_OppositeSide ( const int  parent_type,
const int  child_index,
const int  child_dim,
int *  opposite_index,
int *  opposite_dim,
int *  rval 
)

return the dimension and index of the opposite side, given parent entity type and child dimension and index. This function is only defined for certain types of parent/child types: (Parent, Child dim->Opposite dim): (Tri, 1->0), (Tri, 0->1), (Quad, 1->1), (Quad, 0->0), (Tet, 2->0), (Tet, 1->1), (Tet, 0->2), (Hex, 2->2), (Hex, 1->1)(diagonally across element), (Hex, 0->0) (diagonally across element) All other parent types and child dimensions return an error.

Parameters:
parent_typeThe type of parent element
child_typeThe type of child element
child_indexThe index of the child element
opposite_indexThe index of the opposite element
Returns:
status Returns 0 if successful, -1 if not

Definition at line 834 of file CN.cpp.

{
  *rval = CN::OppositeSide((EntityType)parent_type, child_index, child_dim, 
                             *opposite_index, *opposite_dim);
}
void MBCN_SetBasis ( const int  in_basis)

set the basis of the numbering system

Definition at line 652 of file CN.cpp.

{CN::SetBasis(in_basis);}
void MBCN_SideNumber ( const int  parent_type,
const int *  child_conn_indices,
const int  child_num_verts,
const int  child_dim,
int *  side_no,
int *  sense,
int *  offset 
)

return the side index represented in the input sub-entity connectivity

Parameters:
parent_typeEntity type of parent entity
child_conn_indicesChild connectivity to query, specified as indices into the connectivity list of the parent.
child_num_vertsNumber of values in child_conn_indices
child_dimDimension of child entity being queried
side_noSide number of child entity (returned)
senseSense of child entity with respect to order in child_conn (returned)
offsetOffset of child_conn with respect to canonical ordering data (returned)
Returns:
status Returns zero if successful, -1 if not

Definition at line 767 of file CN.cpp.

{
  CN::SideNumber((EntityType)parent_type, child_conn_indices, child_num_verts, child_dim,
                   *side_no, *sense, *offset);
}
void MBCN_SideNumberInt ( const int *  parent_conn,
const EntityType  parent_type,
const int *  child_conn,
const int  child_num_verts,
const int  child_dim,
int *  side_no,
int *  sense,
int *  offset 
)

Definition at line 776 of file CN.cpp.

{
  moab::side_number(parent_conn, parent_type, child_conn, child_num_verts, 
              child_dim, *side_no, *sense, *offset);
}
void MBCN_SideNumberLong ( const long *  parent_conn,
const EntityType  parent_type,
const long *  child_conn,
const int  child_num_verts,
const int  child_dim,
int *  side_no,
int *  sense,
int *  offset 
)

Definition at line 794 of file CN.cpp.

{
  moab::side_number(parent_conn, parent_type, child_conn, child_num_verts, 
              child_dim, *side_no, *sense, *offset);
}
void MBCN_SideNumberUint ( const unsigned int *  parent_conn,
const EntityType  parent_type,
const unsigned int *  child_conn,
const int  child_num_verts,
const int  child_dim,
int *  side_no,
int *  sense,
int *  offset 
)

Definition at line 785 of file CN.cpp.

{
  moab::side_number(parent_conn, parent_type, child_conn, child_num_verts, 
              child_dim, *side_no, *sense, *offset);
}
void MBCN_SideNumberUlong ( const unsigned long *  parent_conn,
const EntityType  parent_type,
const unsigned long *  child_conn,
const int  child_num_verts,
const int  child_dim,
int *  side_no,
int *  sense,
int *  offset 
)

Definition at line 803 of file CN.cpp.

{
  moab::side_number(parent_conn, parent_type, child_conn, child_num_verts, 
              child_dim, *side_no, *sense, *offset);
}
void MBCN_SideNumberVoid ( void *const *  parent_conn,
const EntityType  parent_type,
void *const *  child_conn,
const int  child_num_verts,
const int  child_dim,
int *  side_no,
int *  sense,
int *  offset 
)

Definition at line 812 of file CN.cpp.

{
  moab::side_number(parent_conn, parent_type, child_conn, child_num_verts, 
              child_dim, *side_no, *sense, *offset);
}
void MBCN_SubEntityType ( const int  this_type,
const int  sub_dimension,
const int  index,
int *  rval 
)

return the type of a particular sub-entity.

Parameters:
this_typeType of entity for which sub-entity type is being queried
sub_dimensionTopological dimension of sub-entity whose type is being queried
indexIndex of sub-entity whose type is being queried
Returns:
type Entity type of sub-entity with specified dimension and index

Definition at line 692 of file CN.cpp.

{
  
  *rval = CN::SubEntityType((EntityType)this_type, sub_dimension, index);

}
void MBCN_SubEntityVertexIndices ( const int  this_type,
const int  sub_dimension,
const int  sub_index,
int  sub_entity_conn[] 
)

return the vertex indices of the specified sub-entity.

Parameters:
this_typeType of entity for which sub-entity connectivity is being queried
sub_dimensionDimension of sub-entity
sub_indexIndex of sub-entity
sub_entity_connConnectivity of sub-entity (returned to calling function)

Definition at line 708 of file CN.cpp.

{
  CN::SubEntityVertexIndices((EntityType)this_type, sub_dimension, 
                               sub_index, sub_entity_conn);
}
void MBCN_VerticesPerEntity ( const int  t,
int *  rval 
)

return the number of (corner) vertices contained in the specified type.

Definition at line 676 of file CN.cpp.

{
  *rval = CN::VerticesPerEntity((EntityType)t);
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines