[MOAB-dev] r3668 - in MOAB/trunk: src src/io src/moab src/oldinc tools/mbcoupler tools/mbzoltan
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Thu Mar 18 13:25:44 CDT 2010
Author: kraftche
Date: 2010-03-18 13:25:44 -0500 (Thu, 18 Mar 2010)
New Revision: 3668
Modified:
MOAB/trunk/src/CN.cpp
MOAB/trunk/src/MeshTopoUtil.cpp
MOAB/trunk/src/ReadUtil.cpp
MOAB/trunk/src/Skinner.cpp
MOAB/trunk/src/io/ReadSms.cpp
MOAB/trunk/src/moab/CN.hpp
MOAB/trunk/src/oldinc/MBCN.hpp
MOAB/trunk/tools/mbcoupler/Coupler.cpp
MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
Log:
s/MB_MAX_SUB_ENTITIES/moab::MAX_SUB_ENTITIES/ and s/MB_MAX_SUB_ENTITY_VERTICES/moab::MAX_SUB_ENTITY_VERTICES/, update MBCN.hpp compat header appropriately, and add non-namespaced DimensionPair to MBCN.hpp
Modified: MOAB/trunk/src/CN.cpp
===================================================================
--- MOAB/trunk/src/CN.cpp 2010-03-18 18:05:02 UTC (rev 3667)
+++ MOAB/trunk/src/CN.cpp 2010-03-18 18:25:44 UTC (rev 3668)
@@ -95,7 +95,7 @@
const short* corners = mConnectivityMap[this_topo][sub_dimension-1].conn[sub_index];
std::copy( corners, corners+num_sub_entity_nodes, sub_entity_conn );
- int sub_sub_corners[MB_MAX_SUB_ENTITY_VERTICES];
+ int sub_sub_corners[MAX_SUB_ENTITY_VERTICES];
int side, sense, offset;
for (int dim = 1; dim <= sub_dimension; ++dim) {
if (!(ho_bits & (1<<dim)))
@@ -129,7 +129,7 @@
const int sub_index,
void *sub_entity_conn, int &num_sub_vertices)
{
- static int sub_indices[MB_MAX_SUB_ENTITY_VERTICES];
+ static int sub_indices[MAX_SUB_ENTITY_VERTICES];
SubEntityVertexIndices(parent_type, sub_dimension, sub_index, sub_indices);
@@ -980,9 +980,9 @@
const int indices_per_ent,
const int num_entries)
{
- T tmp_conn[MB_MAX_SUB_ENTITIES];
- assert(indices_per_ent <= CN::permuteVec[t][dim][MB_MAX_SUB_ENTITIES]);
- if (indices_per_ent > CN::permuteVec[t][dim][MB_MAX_SUB_ENTITIES]) return 1;
+ T tmp_conn[MAX_SUB_ENTITIES];
+ assert(indices_per_ent <= CN::permuteVec[t][dim][MAX_SUB_ENTITIES]);
+ if (indices_per_ent > CN::permuteVec[t][dim][MAX_SUB_ENTITIES]) return 1;
short int *tvec = CN::permuteVec[t][dim];
T *pvec = conn;
for (int j = 0; j < num_entries; j++) {
@@ -1002,9 +1002,9 @@
const int indices_per_ent,
const int num_entries)
{
- T tmp_conn[MB_MAX_SUB_ENTITIES];
- assert(indices_per_ent <= CN::revPermuteVec[t][dim][MB_MAX_SUB_ENTITIES]);
- if (indices_per_ent > CN::revPermuteVec[t][dim][MB_MAX_SUB_ENTITIES]) return 1;
+ T tmp_conn[MAX_SUB_ENTITIES];
+ assert(indices_per_ent <= CN::revPermuteVec[t][dim][MAX_SUB_ENTITIES]);
+ if (indices_per_ent > CN::revPermuteVec[t][dim][MAX_SUB_ENTITIES]) return 1;
short int *tvec = CN::revPermuteVec[t][dim];
T *pvec = conn;
for (int j = 0; j < num_entries; j++) {
Modified: MOAB/trunk/src/MeshTopoUtil.cpp
===================================================================
--- MOAB/trunk/src/MeshTopoUtil.cpp 2010-03-18 18:05:02 UTC (rev 3667)
+++ MOAB/trunk/src/MeshTopoUtil.cpp 2010-03-18 18:25:44 UTC (rev 3668)
@@ -468,8 +468,8 @@
if (bridge_dim < from_dim) {
// looping over each sub-entity of dimension bridge_dim...
- EntityHandle bridge_verts[MB_MAX_SUB_ENTITIES];
- int bridge_indices[MB_MAX_SUB_ENTITIES];
+ EntityHandle bridge_verts[MAX_SUB_ENTITIES];
+ int bridge_indices[MAX_SUB_ENTITIES];
for (int i = 0; i < CN::NumSubEntities(from_type, bridge_dim); i++) {
// get the vertices making up this sub-entity
Modified: MOAB/trunk/src/ReadUtil.cpp
===================================================================
--- MOAB/trunk/src/ReadUtil.cpp 2010-03-18 18:05:02 UTC (rev 3667)
+++ MOAB/trunk/src/ReadUtil.cpp 2010-03-18 18:25:44 UTC (rev 3668)
@@ -280,7 +280,7 @@
{
// get dimension of bounding entities
int bound_dim = CN::Dimension(TYPE_FROM_HANDLE(bound_ents[0]));
- int indices[MB_MAX_SUB_ENTITY_VERTICES];
+ int indices[MAX_SUB_ENTITY_VERTICES];
const EntityHandle *connect;
std::vector<EntityHandle> tmp_connect;
Modified: MOAB/trunk/src/Skinner.cpp
===================================================================
--- MOAB/trunk/src/Skinner.cpp 2010-03-18 18:05:02 UTC (rev 3667)
+++ MOAB/trunk/src/Skinner.cpp 2010-03-18 18:25:44 UTC (rev 3668)
@@ -397,7 +397,7 @@
// if (dum_sub_elems.empty()) {
// // need to create one
// EntityHandle tmphndl=0;
-// int indices[MB_MAX_SUB_ENTITY_VERTICES];
+// int indices[MAX_SUB_ENTITY_VERTICES];
// EntityType new_type;
// int num_new_nodes;
// CN::SubEntityNodeIndices( type, num_nodes, mTargetDim, i, new_type, num_new_nodes, indices );
@@ -435,7 +435,7 @@
if(match == 0)
{
EntityHandle tmphndl=0;
- int indices[MB_MAX_SUB_ENTITY_VERTICES];
+ int indices[MAX_SUB_ENTITY_VERTICES];
EntityType new_type;
int num_new_nodes;
CN::SubEntityNodeIndices( type, num_nodes, mTargetDim, i, new_type, num_new_nodes, indices );
@@ -762,7 +762,7 @@
if(match == 0)
{
EntityHandle tmphndl=0;
- int indices[MB_MAX_SUB_ENTITY_VERTICES];
+ int indices[MAX_SUB_ENTITY_VERTICES];
EntityType new_type;
int num_new_nodes;
CN::SubEntityNodeIndices( type, conn.size(), 1, i, new_type, num_new_nodes, indices );
Modified: MOAB/trunk/src/io/ReadSms.cpp
===================================================================
--- MOAB/trunk/src/io/ReadSms.cpp 2010-03-18 18:05:02 UTC (rev 3667)
+++ MOAB/trunk/src/io/ReadSms.cpp 2010-03-18 18:25:44 UTC (rev 3668)
@@ -376,8 +376,8 @@
// *******************************
// Read Regions
// *******************************
- int sense[MB_MAX_SUB_ENTITIES];
- bound_verts.resize(MB_MAX_SUB_ENTITIES);
+ int sense[MAX_SUB_ENTITIES];
+ bound_verts.resize(MAX_SUB_ENTITIES);
std::vector<EntityHandle> regions;
if (file_id_tag)
Modified: MOAB/trunk/src/moab/CN.hpp
===================================================================
--- MOAB/trunk/src/moab/CN.hpp 2010-03-18 18:05:02 UTC (rev 3667)
+++ MOAB/trunk/src/moab/CN.hpp 2010-03-18 18:25:44 UTC (rev 3668)
@@ -40,12 +40,13 @@
namespace moab {
-// the maximum number n-1 dimension adjacencies a element may have
-#define MB_MAX_SUB_ENTITIES 12
+enum {
+ //! the maximum number n-1 dimension adjacencies a element may have
+ MAX_SUB_ENTITIES = 12,
+ //! the maximum number of nodes an n-1 dimensional element may have
+ MAX_SUB_ENTITY_VERTICES = 9
+};
-// the maximum number of nodes an n-1 dimensional element may have
-#define MB_MAX_SUB_ENTITY_VERTICES 9
-
typedef std::pair<EntityType, EntityType> DimensionPair;
class CN
@@ -88,13 +89,13 @@
short int num_sub_elements;
// Number of nodes in each sub-element of this dimension
- short int num_corners_per_sub_element[MB_MAX_SUB_ENTITIES];
+ short int num_corners_per_sub_element[MAX_SUB_ENTITIES];
// Type of each sub-element
- EntityType target_type[MB_MAX_SUB_ENTITIES];
+ EntityType target_type[MAX_SUB_ENTITIES];
// Connectivity of each of the sub-elements
- short int conn[MB_MAX_SUB_ENTITIES][MB_MAX_SUB_ENTITY_VERTICES];
+ short int conn[MAX_SUB_ENTITIES][MAX_SUB_ENTITY_VERTICES];
};
// mConnectivityMap[i=entity type][j=0,1,2]:
@@ -112,10 +113,10 @@
struct UpConnMap
{
// Number of higher-dimensional entities using each sub-entity
- short int num_targets_per_source_element[MB_MAX_SUB_ENTITIES];
+ short int num_targets_per_source_element[MAX_SUB_ENTITIES];
// Higher-dimensional entities using each sub-entity
- short int targets_per_source_element[MB_MAX_SUB_ENTITIES][MB_MAX_SUB_ENTITIES];
+ short int targets_per_source_element[MAX_SUB_ENTITIES][MAX_SUB_ENTITIES];
};
// Reverse canonical numbering, duplicates data in mConnectivityMap, but
@@ -128,8 +129,8 @@
static const unsigned char midNodesPerType[MBMAXTYPE][MAX_NODES_PER_ELEMENT+1];
//! Permutation and reverse permutation vectors
- static short int permuteVec[MBMAXTYPE][3][MB_MAX_SUB_ENTITIES+1];
- static short int revPermuteVec[MBMAXTYPE][3][MB_MAX_SUB_ENTITIES+1];
+ static short int permuteVec[MBMAXTYPE][3][MAX_SUB_ENTITIES+1];
+ static short int revPermuteVec[MBMAXTYPE][3][MAX_SUB_ENTITIES+1];
//! this const vector defines the starting and ending EntityType for
//! each dimension, e.g. TypeDimensionMap[2] returns a pair of EntityTypes
@@ -578,7 +579,7 @@
that_vec[pvec[i]] = i;
}
- this_vec[MB_MAX_SUB_ENTITIES] = that_vec[MB_MAX_SUB_ENTITIES] = num_entries;
+ this_vec[MAX_SUB_ENTITIES] = that_vec[MAX_SUB_ENTITIES] = num_entries;
}
//! Reset permutation or reverse permutation vector
@@ -589,12 +590,12 @@
return;
}
- for (unsigned int i = 0; i < MB_MAX_SUB_ENTITIES; i++) {
+ for (unsigned int i = 0; i < MAX_SUB_ENTITIES; i++) {
revPermuteVec[t][dim][i] = permuteVec[t][dim][i] = i;
}
- revPermuteVec[t][dim][MB_MAX_SUB_ENTITIES] =
- permuteVec[t][dim][MB_MAX_SUB_ENTITIES] = MB_MAX_SUB_ENTITIES+1;
+ revPermuteVec[t][dim][MAX_SUB_ENTITIES] =
+ permuteVec[t][dim][MAX_SUB_ENTITIES] = MAX_SUB_ENTITIES+1;
}
} // namespace moab
Modified: MOAB/trunk/src/oldinc/MBCN.hpp
===================================================================
--- MOAB/trunk/src/oldinc/MBCN.hpp 2010-03-18 18:05:02 UTC (rev 3667)
+++ MOAB/trunk/src/oldinc/MBCN.hpp 2010-03-18 18:25:44 UTC (rev 3668)
@@ -5,5 +5,8 @@
#include "moab/CN.hpp"
typedef moab::CN MBCN;
+using moab::DimensionPair;
+#define MB_MAX_SUB_ENTITIES moab::MAX_SUB_ENTITIES;
+#define MB_MAX_SUB_ENTITY_VERTICES moab::MAX_SUB_ENTITY_VERTICES;
#endif
Modified: MOAB/trunk/tools/mbcoupler/Coupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/Coupler.cpp 2010-03-18 18:05:02 UTC (rev 3667)
+++ MOAB/trunk/tools/mbcoupler/Coupler.cpp 2010-03-18 18:25:44 UTC (rev 3668)
@@ -464,7 +464,7 @@
const double xi[8] = {-1,1,1,-1,-1,1,1,-1};
const double etha[8] = {-1,-1,1,1,-1,-1,1,1};
const double mu[8] = {-1,-1,-1,-1,1,1,1,1};
- double vfields[MB_MAX_SUB_ENTITIES*MB_MAX_SUB_ENTITY_VERTICES];
+ double vfields[MAX_SUB_ENTITIES*MAX_SUB_ENTITY_VERTICES];
// get the tag values at the vertices
const EntityHandle *connect;
Modified: MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
===================================================================
--- MOAB/trunk/tools/mbzoltan/MBZoltan.cpp 2010-03-18 18:05:02 UTC (rev 3667)
+++ MOAB/trunk/tools/mbzoltan/MBZoltan.cpp 2010-03-18 18:25:44 UTC (rev 3668)
@@ -359,7 +359,7 @@
Range adjs;
// can use a fixed-size array 'cuz the number of lower-dimensional neighbors is limited
// by MBCN
- int neighbors[5*MB_MAX_SUB_ENTITIES];
+ int neighbors[5*MAX_SUB_ENTITIES];
double avg_position[3];
int moab_id;
@@ -379,7 +379,7 @@
// get the graph vertex ids of those
if (!adjs.empty()) {
- assert(adjs.size() < 5*MB_MAX_SUB_ENTITIES);
+ assert(adjs.size() < 5*MAX_SUB_ENTITIES);
result = mbImpl->tag_get_data(gid, adjs, neighbors); RR;
}
More information about the moab-dev
mailing list