[MOAB-dev] r5654 - MOAB/trunk/src/moab/point_locater

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


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

Added:
   MOAB/trunk/src/moab/point_locater/initialize_tree.hpp
   MOAB/trunk/src/moab/point_locater/nat_param.hpp
Modified:
   MOAB/trunk/src/moab/point_locater/point_locater.hpp
Log:
point locater nonsense

Added: MOAB/trunk/src/moab/point_locater/initialize_tree.hpp
===================================================================
--- MOAB/trunk/src/moab/point_locater/initialize_tree.hpp	                        (rev 0)
+++ MOAB/trunk/src/moab/point_locater/initialize_tree.hpp	2012-08-03 18:37:13 UTC (rev 5654)
@@ -0,0 +1,71 @@
+#ifndef INIT_TREE_HPP
+#define INIT_TREE_HPP
+//TODO: refactor out to AdaptiveKDTree
+ErrorCode initialize_tree(){
+  Range local_ents;
+  typename Tree::Settings settings;
+  settings.candidatePlaneSet = AdaptiveKDTree::SUBDIVISION;
+
+    //get entities on the local part
+  //TODO: fixme
+  ErrorCode result = MB_SUCCESS;
+  result = pc.get_part_entities( local_ents, 3);
+  else local_ents = range;
+
+  if (MB_SUCCESS != result || local_ents.empty()) {
+    std::cout << "Problems getting source entities" 
+	      << std::endl;
+    return result;
+  }
+
+    // build the tree for local processor
+  for (int i = 0; i < num_iterations; i++) {
+    tree = Tree( &impl);
+    result = tree.build_tree( local_ents, local_root, &settings);
+    if (MB_SUCCESS != result) {
+      std::cout << "Problems building tree";
+      if (num_iterations != i) {
+     	settings.maxEntPerLeaf *= 2;
+        std::cout << "; increasing elements/leaf to " 
+                  << settings.maxEntPerLeaf << std::endl;;
+      }
+      else {
+        std::cout << "; exiting" << std::endl;
+        return result;
+      }
+    }
+    else
+      break; // get out of tree building
+  }
+  
+  boxes.resize(6*pc.proc_config().proc_size());
+
+  unsigned int rank = (pc ? pc.proc_config().proc_rank() : 0);
+  result = tree.get_tree_box( local_root, 
+		  		 &boxes[6*rank], 
+				 &boxes[6*rank+3]);


More information about the moab-dev mailing list