MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include "moab/CN.hpp"
#include "MBCNArrays.hpp"
#include "MBCN.h"
#include <cassert>
#include <cstring>
#include <iterator>
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 MUC CN::mUpConnMap[this_type][source_dim][target_dim] |
Referenced by moab::CN::AdjacentSubEntities().
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
parent_conn | Connectivity of parent entity |
parent_type | Entity type of parent entity |
sub_dimension | Dimension of sub-entity being queried |
sub_index | Index of sub-entity being queried |
sub_entity_conn | Connectivity of sub-entity, based on parent_conn and canonical ordering for parent_type |
num_sub_vertices | Number 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_type | Type of entity for which sub-entity connectivity is being queried |
source_indices | Indices of sides being queried |
num_source_indices | Number of entries in source_indices |
source_dim | Dimension of source entity |
target_dim | Dimension of target entity |
index_list | Indices of target entities (returned) |
num_indices | Number of indices of target entities (returned) |
operation_type | Specify either CN::INTERSECT (0) or CN::UNION (1) to get intersection or union of target entity lists over source entities |
rval | Error code indicating success or failure (returned) |
Definition at line 772 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.
conn1 | Connectivity array of first entity |
conn2 | Connectivity array of second entity |
num_vertices | Number of entries in conn1 and conn2 |
direct | If positive, entities have the same sense (returned) |
offset | Offset of conn2's first vertex in conn1 |
Definition at line 901 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 | ||
) |
void MBCN_ConnectivityMatchUint | ( | const unsigned int * | conn1, |
const unsigned int * | 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_Dimension | ( | const int | t, |
int * | rval | ||
) |
return the topological entity dimension
Definition at line 704 of file CN.cpp.
{ *rval = CN::Dimension( (EntityType)t ); }
void MBCN_EntityTypeFromName | ( | const char * | name, |
int * | rval | ||
) |
void MBCN_EntityTypeName | ( | const int | this_type, |
char * | rval, | ||
int | rval_len | ||
) |
return the string type name for this type
Definition at line 689 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 | ) |
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.
this_type | Type of entity for which sub-entity connectivity is being queried |
num_verts | Number of nodes defining entity |
Definition at line 956 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.
this_type | Type of entity for which sub-entity connectivity is being queried |
num_verts | Number of nodes defining entity |
Definition at line 966 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.
this_type | Type of entity for which sub-entity connectivity is being queried |
num_verts | Number of nodes defining entity |
mid_nodes | If 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 987 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.
this_type | Type of entity for which sub-entity connectivity is being queried |
num_verts | Number of nodes defining entity |
Definition at line 976 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
this_type | Type of entity being queried |
num_verts | Number of vertices for the entity being queried |
subfacet_dim | Dimension of sub-entity being queried |
subfacet_index | Index of sub-entity being queried |
Definition at line 1014 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.
elem_type | Type of entity being queried |
num_nodes | The number of nodes in the element connectivity |
ho_node_index | The position of the HO node in the connectivity list (zero based) |
parent_dim | Dimension of sub-entity high-order node resolves (returned) |
parent_index | Index of sub-entity high-order node resolves (returned) |
Definition at line 1001 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 716 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.
parent_type | The type of parent element |
child_type | The type of child element |
child_index | The index of the child element |
opposite_index | The index of the opposite element |
Definition at line 884 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 | ) |
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
parent_type | Entity type of parent entity |
child_conn_indices | Child connectivity to query, specified as indices into the connectivity list of the parent. |
child_num_verts | Number of values in child_conn_indices |
child_dim | Dimension of child entity being queried |
side_no | Side number of child entity (returned) |
sense | Sense of child entity with respect to order in child_conn (returned) |
offset | Offset of child_conn with respect to canonical ordering data (returned) |
Definition at line 799 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 811 of file CN.cpp.
References moab::side_number().
{ 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 835 of file CN.cpp.
References moab::side_number().
{ 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 823 of file CN.cpp.
References moab::side_number().
{ 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 847 of file CN.cpp.
References moab::side_number().
{ 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 859 of file CN.cpp.
References moab::side_number().
{ 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.
this_type | Type of entity for which sub-entity type is being queried |
sub_dimension | Topological dimension of sub-entity whose type is being queried |
index | Index of sub-entity whose type is being queried |
Definition at line 726 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.
this_type | Type of entity for which sub-entity connectivity is being queried |
sub_dimension | Dimension of sub-entity |
sub_index | Index of sub-entity |
sub_entity_conn | Connectivity of sub-entity (returned to calling function) |
Definition at line 738 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 710 of file CN.cpp.
{ *rval = CN::VerticesPerEntity( (EntityType)t ); }