[MOAB-dev] r5982 - in MOAB/trunk: src src/io src/moab test

tautges at mcs.anl.gov tautges at mcs.anl.gov
Thu Feb 7 13:40:08 CST 2013


Author: tautges
Date: 2013-02-07 13:40:08 -0600 (Thu, 07 Feb 2013)
New Revision: 5982

Modified:
   MOAB/trunk/src/AdaptiveKDTree.cpp
   MOAB/trunk/src/GeomUtil.cpp
   MOAB/trunk/src/io/IODebugTrack.cpp
   MOAB/trunk/src/io/ReadNC.cpp
   MOAB/trunk/src/io/ReadNCDF.cpp
   MOAB/trunk/src/io/WriteSLAC.cpp
   MOAB/trunk/src/moab/AdaptiveKDTree.hpp
   MOAB/trunk/test/adaptive_kd_tree_tests.cpp
Log:
Removing the ability of AdaptiveKDTree to have multiple trees per object.
Fixing a number of 'narrowing conversion' warnings from newer version of gcc.

Passes all tests, serial and parallel.



Modified: MOAB/trunk/src/AdaptiveKDTree.cpp
===================================================================
--- MOAB/trunk/src/AdaptiveKDTree.cpp	2013-02-07 14:45:20 UTC (rev 5981)
+++ MOAB/trunk/src/AdaptiveKDTree.cpp	2013-02-07 19:40:08 UTC (rev 5982)
@@ -153,6 +153,8 @@
   std::string root_name(tagname);
   root_name += "_box";
   MAKE_TAG( root_name, MB_TAG_SPARSE, MB_TYPE_DOUBLE, 6, rootTag, 0 )
+
+  myRoot = 0;
 }
 
 ErrorCode AdaptiveKDTree::get_split_plane( EntityHandle entity,
@@ -178,16 +180,10 @@
 {
   if (!cleanUpTrees)
     return;
-    
-  while (!createdTrees.empty()) {
-    EntityHandle tree = createdTrees.back();
-      // make sure this is a tree (rather than some other, stale handle)
-    const void* data_ptr = 0;
-    ErrorCode rval = moab()->tag_get_by_ptr( rootTag, &tree, 1, &data_ptr );
-    if (MB_SUCCESS == rval)
-      rval = delete_tree( tree );
-    if (MB_SUCCESS != rval)
-      createdTrees.pop_back();
+  
+  if (myRoot) {
+    delete_tree( myRoot );
+    myRoot = 0;
   }
 }
 
@@ -200,7 +196,7 @@
   r2 = moab()->tag_set_data( axisTag , &entity, 1, &plane.norm  );
   return MB_SUCCESS == r1 ? r2 : r1;
 #elif defined(MB_AD_KD_TREE_USE_TWO_DOUBLE_TAG)
-  double values[2] = { plane.coord, plane.norm };
+  double values[2] = { plane.coord, static_cast<double>(plane.norm) };
   return moab()->tag_set_data( planeTag, &entity, 1, values );
 #else
   return moab()->tag_set_data( planeTag, &entity, 1, &plane );
@@ -233,6 +229,8 @@
                                            const double box_max[3],
                                            EntityHandle& root_handle )
 {
+  if (myRoot) return MB_FAILURE;
+  
   ErrorCode rval = moab()->create_meshset( meshSetFlags, root_handle );
   if (MB_SUCCESS != rval)


More information about the moab-dev mailing list