[MOAB-dev] r1272 - MOAB/trunk

tautges at mcs.anl.gov tautges at mcs.anl.gov
Thu Sep 13 11:13:20 CDT 2007


Author: tautges
Date: 2007-09-13 11:13:20 -0500 (Thu, 13 Sep 2007)
New Revision: 1272

Modified:
   MOAB/trunk/MBCore.cpp
   MOAB/trunk/MBTypes.h
   MOAB/trunk/README
   MOAB/trunk/RELEASE_NOTES
   MOAB/trunk/ReadParallel.cpp
   MOAB/trunk/TagServer.cpp
   MOAB/trunk/TagServer.hpp
   MOAB/trunk/internals_test.cpp
Log:
ReadParallel.cpp: filter entities better so that it keeps
lower-dimensional entities adj to partition entities, and sets
containing sets containing kept entities

Updated RELEASE_NOTES for v2 - v3 changes

Changed MB_TAG_LAST to be equal to MB_TAG_MESH, following Jason's
suggestion; also reverted changes to TagServer for extra switch cases
accordingly.

Tests pass as before.



Modified: MOAB/trunk/MBCore.cpp
===================================================================
--- MOAB/trunk/MBCore.cpp	2007-09-13 14:29:07 UTC (rev 1271)
+++ MOAB/trunk/MBCore.cpp	2007-09-13 16:13:20 UTC (rev 1272)
@@ -1589,7 +1589,7 @@
 MBErrorCode MBCore::tag_get_type(const MBTag tag_handle, MBTagType &tag_type) const
 {
   tag_type = PROP_FROM_TAG_HANDLE(tag_handle);
-  return tag_type < MB_TAG_LAST ? MB_SUCCESS : MB_TAG_NOT_FOUND;
+  return tag_type < MB_TAG_LAST+1 ? MB_SUCCESS : MB_TAG_NOT_FOUND;
 }
 
   //! get handles for all tags defined

Modified: MOAB/trunk/MBTypes.h
===================================================================
--- MOAB/trunk/MBTypes.h	2007-09-13 14:29:07 UTC (rev 1271)
+++ MOAB/trunk/MBTypes.h	2007-09-13 16:13:20 UTC (rev 1272)
@@ -58,7 +58,7 @@
   MB_TAG_SPARSE,  /**< tags stored in (entity handle, tag value) pairs */
   MB_TAG_DENSE,   /**< tags stored in vectors directly on entity sequences, cheaper for tags which go on lots of entities */ 
   MB_TAG_MESH, 
-  MB_TAG_LAST};
+  MB_TAG_LAST=MB_TAG_MESH};
 
 /** Specify data type for tags. */
 enum MBDataType {

Modified: MOAB/trunk/README
===================================================================
--- MOAB/trunk/README	2007-09-13 14:29:07 UTC (rev 1271)
+++ MOAB/trunk/README	2007-09-13 16:13:20 UTC (rev 1272)
@@ -77,6 +77,7 @@
 1.00 (2/1/04): Initial release (woo-hoo!)
 
 Implementation:
+3.00 (9/1/07): Move to Argonne, various assorted changes
 2.00 (11/1/06): LOTS of bug fixes & improvements
 1.00 (2/1/04): Initial release
 

Modified: MOAB/trunk/RELEASE_NOTES
===================================================================
--- MOAB/trunk/RELEASE_NOTES	2007-09-13 14:29:07 UTC (rev 1271)
+++ MOAB/trunk/RELEASE_NOTES	2007-09-13 16:13:20 UTC (rev 1272)
@@ -1,5 +1,28 @@
 Version beta: 
+- Fixed bug in get_entities_by_type_and_tag for cases with non-zero
+input set which has or doesn't have entities
 
+Version 3.0.0 (SVN tag 3.0.0):
+- Updated QVDual to work with new versions of VTK and removed
+dependence on graphviz
+- Move ITAPS/TSTT interface implementation into tools/iMesh and make
+it work with configure system
+- Implement new version number system
+- Incorporate DagMC library (does fast facet-based
+ray tracing) into tools/dagmc
+- Prefer g++ to pgCC in configure scripts
+- Many improvements in kd tree functionality, performance
+- Move entity sets to be stored in sequences, better performance &
+functionality
+- Improved various file writers/readers, including:
+. Better performance of HDF5 file reader
+. Configuration with/without HDF5, netcdf
+. Vtk writer improvements
+- Added functions to MBInterface to get memory usage of MOAB
+- Fixes to various MBCN functions for 64-bit builds
+- Small changes to #defines of some tag names in MBTagConventions.hpp
+
+
 Version 2.00 (CVS tag version_200):
 - New MBInterface method to get blocked coordinate data for vertices.
 - Speed up reading of entity sets in .h5m files.

Modified: MOAB/trunk/ReadParallel.cpp
===================================================================
--- MOAB/trunk/ReadParallel.cpp	2007-09-13 14:29:07 UTC (rev 1271)
+++ MOAB/trunk/ReadParallel.cpp	2007-09-13 16:13:20 UTC (rev 1272)
@@ -5,6 +5,7 @@
 #include "MBError.hpp"
 #include "MBReaderWriterSet.hpp"
 #include "MBParallelComm.hpp"
+#include "MBCN.hpp"
 
 #define RR if (MB_SUCCESS != result) return result
 
@@ -175,15 +176,21 @@
     // merge partition ents into pre-existing entities
   exist_ents.merge(partition_ents);
   
-    // gather adjacent verts and add to existing ents
+    // gather adjacent ents of lower dimension and add to existing ents
   MBRange tmp_ents;
-  MBRange::iterator bit = exist_ents.lower_bound(MBEDGE),
-    eit = exist_ents.upper_bound(MBENTITYSET);
-  MBRange from_ents(*bit, *eit);
-  from_ents = from_ents.intersect(exist_ents);
-  result = mbImpl->get_adjacencies(from_ents, 0, false, tmp_ents, 
-                                   MBInterface::UNION); RR;
-  exist_ents.merge(tmp_ents);
+  for (int dim = 2; dim >= 0; dim--) {
+    MBEntityType lower_type = MBVERTEX, upper_type = MBENTITYSET;
+    while (MBMAXTYPE != lower_type && MBCN::Dimension(lower_type) < dim+1) lower_type++;
+    
+    MBRange::iterator bit = exist_ents.lower_bound(lower_type),
+      eit = exist_ents.upper_bound(upper_type);
+    MBRange from_ents(*bit, *eit);
+    from_ents = from_ents.intersect(exist_ents);
+    tmp_ents.clear();
+    result = mbImpl->get_adjacencies(from_ents, dim, false, tmp_ents, 
+                                     MBInterface::UNION); RR;
+    exist_ents.merge(tmp_ents);
+  }
   
     // subtract from all ents to get deletable ents
   all_ents = all_ents.subtract(exist_ents);
@@ -193,7 +200,7 @@
   result = mbImpl->get_entities_by_type(0, MBENTITYSET, all_sets);
   for (MBRange::iterator rit = all_sets.begin(); rit != all_sets.end(); rit++) {
     tmp_ents.clear();
-    result = mbImpl->get_entities_by_handle(*rit, tmp_ents); RR;
+    result = mbImpl->get_entities_by_handle(*rit, tmp_ents, true); RR;
     tmp_ents = tmp_ents.intersect(exist_ents);
     
       // if the intersection is empty, set is deletable

Modified: MOAB/trunk/TagServer.cpp
===================================================================
--- MOAB/trunk/TagServer.cpp	2007-09-13 14:29:07 UTC (rev 1271)
+++ MOAB/trunk/TagServer.cpp	2007-09-13 16:13:20 UTC (rev 1272)
@@ -155,9 +155,6 @@
     case MB_TAG_MESH:
       result = MB_SUCCESS;
       break;
-    case MB_TAG_LAST:
-      assert(false);
-      break;
   }
   
   if (MB_SUCCESS != result)
@@ -189,9 +186,6 @@
     case MB_TAG_MESH:
       status = MB_SUCCESS;
       break;
-    case MB_TAG_LAST:
-      assert(false);
-      break;
   }
   
   mTagTable[tag_type][tag_idx].invalidate();
@@ -272,8 +266,6 @@
       return mDenseData->set_data(id, entity_handle, data);
     case MB_TAG_MESH:
       return MB_FAILURE;
-    case MB_TAG_LAST:
-      return MB_FAILURE;
   }
   return MB_FAILURE;
 }
@@ -430,10 +422,6 @@
     case MB_TAG_MESH:
       result = MB_FAILURE;
       break;
-    case MB_TAG_LAST:
-      assert(false);
-      result = MB_FAILURE;
-      break;
   }
 
   // if we couldn't get a value
@@ -585,7 +573,7 @@
 MBTag TagServer::get_handle(const char *tag_name) const
 {
   if (tag_name && *tag_name)
-    for (int i = 0; i < MB_TAG_LAST; ++i) 
+    for (int i = 0; i < MB_TAG_LAST+1; ++i) 
       for (MBTagId j = 0; j < mTagTable[i].size(); ++j) 
         if (mTagTable[i][j].is_valid() && mTagTable[i][j].get_name() == tag_name)
           return TAG_HANDLE_FROM_ID( j + 1, (MBTagType)i );
@@ -595,7 +583,7 @@
 
 MBErrorCode TagServer::get_tags(std::vector<MBTag> &all_tags)
 {
-  for (int i = 0; i < MB_TAG_LAST; ++i) 
+  for (int i = 0; i < MB_TAG_LAST+1; ++i) 
     for (MBTagId j = 0; j < mTagTable[i].size(); ++j) 
       if (mTagTable[i][j].is_valid())
         all_tags.push_back( TAG_HANDLE_FROM_ID( j + 1, (MBTagType)i ) );
@@ -621,7 +609,7 @@
 
 MBErrorCode TagServer::get_mesh_tags( std::vector<MBTag>& all_tags ) const
 {
-  for (int i = 0; i < MB_TAG_LAST; ++i) 
+  for (int i = 0; i < MB_TAG_LAST+1; ++i) 
     for (MBTagId j = 0; j < mTagTable[i].size(); ++j) 
       if (mTagTable[i][j].is_valid() && mTagTable[i][j].get_mesh_value())
         all_tags.push_back( TAG_HANDLE_FROM_ID( j + 1, (MBTagType)i ) );
@@ -691,8 +679,6 @@
       return MB_FAILURE;
     case MB_TAG_MESH:
       return MB_FAILURE;
-    case MB_TAG_LAST:
-      return MB_FAILURE;
   }
   
   return MB_TAG_NOT_FOUND;
@@ -735,9 +721,6 @@
     case MB_TAG_MESH:
       result = MB_TYPE_OUT_OF_RANGE;
       break;
-    case MB_TAG_LAST:
-      result = MB_TYPE_OUT_OF_RANGE;
-      break;
   }
   
   return result;
@@ -763,9 +746,6 @@
     case MB_TAG_MESH:
       result = MB_TYPE_OUT_OF_RANGE;
       break;
-    case MB_TAG_LAST:
-      result = MB_TYPE_OUT_OF_RANGE;
-      break;
   }
   
   return result;
@@ -793,9 +773,6 @@
     case MB_TAG_MESH:
       result = MB_TYPE_OUT_OF_RANGE;
       break;
-    case MB_TAG_LAST:
-      result = MB_TYPE_OUT_OF_RANGE;
-      break;
   }
 
   return result;
@@ -825,9 +802,6 @@
     case MB_TAG_MESH:
       result = MB_TYPE_OUT_OF_RANGE;
       break;
-    case MB_TAG_LAST:
-      result = MB_TYPE_OUT_OF_RANGE;
-      break;
   }
 
   return result;
@@ -923,8 +897,6 @@
       return mBitServer->get_number_entities(id, type, num_entities);
     case MB_TAG_MESH:
       return MB_TYPE_OUT_OF_RANGE;
-    case MB_TAG_LAST:
-      return MB_TYPE_OUT_OF_RANGE;
   }
   return MB_TAG_NOT_FOUND;
 }
@@ -944,8 +916,6 @@
       return mBitServer->get_number_entities(range, id, type, num_entities);
     case MB_TAG_MESH:
       return MB_TYPE_OUT_OF_RANGE;
-    case MB_TAG_LAST:
-      return MB_TYPE_OUT_OF_RANGE;
   }
   return MB_TAG_NOT_FOUND;
 }
@@ -969,8 +939,6 @@
       break;
     case MB_TAG_MESH:
       break;
-    case MB_TAG_LAST:
-      break;
   }
 
     // add in size of entry in mTagTable
@@ -998,8 +966,6 @@
       break;
     case MB_TAG_MESH:
       break;
-    case MB_TAG_LAST:
-      break;
   }
   
     // size of entry in mTagTable map

Modified: MOAB/trunk/TagServer.hpp
===================================================================
--- MOAB/trunk/TagServer.hpp	2007-09-13 14:29:07 UTC (rev 1271)
+++ MOAB/trunk/TagServer.hpp	2007-09-13 16:13:20 UTC (rev 1272)
@@ -277,7 +277,7 @@
   //! Table of tag ids and tag information
   //! Primary (array) index is tag type.  
   //! Secondary (std::vector) index is tag id less one (tag ids begin with 1).
-  std::vector<TagInfo> mTagTable[MB_TAG_LAST];
+  std::vector<TagInfo> mTagTable[MB_TAG_LAST+1];
 
   //! container for storing the sparse data and tag ids
   SparseTagSuperCollection* mSparseData;

Modified: MOAB/trunk/internals_test.cpp
===================================================================
--- MOAB/trunk/internals_test.cpp	2007-09-13 14:29:07 UTC (rev 1271)
+++ MOAB/trunk/internals_test.cpp	2007-09-13 16:13:20 UTC (rev 1272)
@@ -61,7 +61,7 @@
   const unsigned cpus[] = { 1, 4, 16, 5, 20 };
   const int num_cpus = sizeof(cpus)/sizeof(cpus[0]);
   unsigned errors = 0, tests = 0;
-  const int num_prop = MB_TAG_LAST;
+  const int num_prop = MB_TAG_LAST+1;
   
   ++tests;
   if (MB_TAG_LAST > num_prop) {




More information about the moab-dev mailing list