[MOAB-dev] r5663 - in MOAB/trunk: src src/moab/point_locater tools

rhl6856 at mcs.anl.gov rhl6856 at mcs.anl.gov
Fri Aug 3 13:37:20 CDT 2012


Author: rhl6856
Date: 2012-08-03 13:37:20 -0500 (Fri, 03 Aug 2012)
New Revision: 5663

Modified:
   MOAB/trunk/src/AdaptiveKDTree.cpp
   MOAB/trunk/src/moab/point_locater/element_tree.hpp
   MOAB/trunk/src/moab/point_locater/point_locater.hpp
   MOAB/trunk/tools/point_search.cpp
Log:
towards optimizing elt tree. profiling coupler

Modified: MOAB/trunk/src/AdaptiveKDTree.cpp
===================================================================
--- MOAB/trunk/src/AdaptiveKDTree.cpp	2012-08-03 18:37:19 UTC (rev 5662)
+++ MOAB/trunk/src/AdaptiveKDTree.cpp	2012-08-03 18:37:20 UTC (rev 5663)
@@ -28,6 +28,7 @@
 #include <assert.h>
 #include <algorithm>
 #include <limits>
+#include <iostream>
 
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #  include <float.h>
@@ -2117,13 +2118,27 @@
   get_tree_iterator( root, iter );
   iter.step_to_first_leaf(AdaptiveKDTreeIter::LEFT);
   min_depth = max_depth = iter.depth();
+  
+  int num_of_elements = 0, max, min;
+  moab()->get_number_entities_by_handle( iter.handle(), num_of_elements);
+  max = min= num_of_elements;
+  int k = 0;
   while (MB_SUCCESS == iter.step()) {
+    int temp = 0;
+    moab()->get_number_entities_by_handle( iter.handle(), temp);
+    num_of_elements += temp;
+    max = std::max( max, temp);
+    min = std::min( min, temp);
     if (iter.depth() > max_depth)
       max_depth = iter.depth();
     else if (iter.depth() < min_depth)
       min_depth = iter.depth();
+    ++k;
   }
-  
+  std::cout << std::endl << "# of leafs: " << k+1 << std::endl;
+  std::cout << std::endl << "max #: " << max << std::endl;
+  std::cout << std::endl << "min #: " << min << std::endl;
+  std::cout << std::endl << "# of elements " << k+1 << std::endl;
   return MB_SUCCESS;
 }
           

Modified: MOAB/trunk/src/moab/point_locater/element_tree.hpp
===================================================================
--- MOAB/trunk/src/moab/point_locater/element_tree.hpp	2012-08-03 18:37:19 UTC (rev 5662)
+++ MOAB/trunk/src/moab/point_locater/element_tree.hpp	2012-08-03 18:37:20 UTC (rev 5663)
@@ -16,6 +16,7 @@
 #include <bitset>
 #include <numeric>
 #include <cmath>
+#include <tr1/unordered_map>


More information about the moab-dev mailing list