[MOAB-dev] commit/MOAB: tautges: Fixing mcnpmit, not sure how I missed this one before.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Sep 17 10:55:28 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/624e99f27373/
Changeset:   624e99f27373
Branch:      master
User:        tautges
Date:        2013-09-17 17:55:11
Summary:     Fixing mcnpmit, not sure how I missed this one before.

Affected #:  1 file

diff --git a/tools/mcnpmit/main.cpp b/tools/mcnpmit/main.cpp
index 7eb0011..eca4b85 100644
--- a/tools/mcnpmit/main.cpp
+++ b/tools/mcnpmit/main.cpp
@@ -12,6 +12,7 @@
 #include "MBTagConventions.hpp"
 #include "moab/AdaptiveKDTree.hpp"
 #include "moab/GeomUtil.hpp"
+#include "moab/FileOptions.hpp"
 #include "../tools/mbcoupler/ElemUtil.hpp"
 
 #define MBI mb_instance()
@@ -61,8 +62,6 @@ int main(int argc, char **argv) {
   moab::ErrorCode                MBresult;
   moab::AdaptiveKDTree           kdtree(MBI);
   moab::EntityHandle             root;
-  moab::AdaptiveKDTree::Settings settings;
-  settings.candidatePlaneSet = moab::AdaptiveKDTree::SUBDIVISION;
 
   MBI->tag_get_handle("CoordTag", 1, moab::MB_TYPE_INTEGER, coord_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT);
   MBI->tag_get_handle("RotationTag", 16, moab::MB_TYPE_DOUBLE, rotation_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
@@ -89,8 +88,9 @@ int main(int argc, char **argv) {
     
   }
   else {
-    std::cout << "Building KD-Tree..." << std::endl;      
-    MBresult = kdtree.build_tree( MCNP -> elem_handles, root, &settings);
+    std::cout << "Building KD-Tree..." << std::endl;
+    moab::FileOptions opts("CANDIDATE_PLANE_SET=SUBDIVISION");
+    MBresult = kdtree.build_tree( MCNP -> elem_handles, &root, &opts);
     if (MBresult == moab::MB_SUCCESS) {
 
       MBI->tag_set_data(coord_tag, &root, 1, &(MCNP->coord_system));
@@ -178,9 +178,6 @@ int main(int argc, char **argv) {
 
   bool found = false;
 
-  moab::AdaptiveKDTreeIter    treeiter;
-  kdtree.get_tree_iterator( root, treeiter );
-
   // MBRange verts;
   std::vector<moab::EntityHandle> verts;
   moab::Range range;
@@ -198,8 +195,6 @@ int main(int argc, char **argv) {
 //  double davg = 0.0;
 //  unsigned int    nmax = 0, nmin = 1000000000 ;
 
-  int status_freq = int(num_pts/100);
-
   for (unsigned int i = 0; i < (unsigned int) num_pts; i++) {
 
     // if (i%status_freq == 0)
@@ -228,7 +223,8 @@ int main(int argc, char **argv) {
     testvc[2] = transformed_pt[2];
 
     // Find the leaf containing the point
-    MBresult = kdtree.leaf_containing_point( root, transformed_pt, treeiter);
+    moab::EntityHandle tree_node;
+    MBresult = kdtree.point_search(transformed_pt, tree_node);
     if (moab::MB_SUCCESS != MBresult) {
       double x, y, z;
       if (CARTESIAN == coord_sys) {
@@ -250,7 +246,7 @@ int main(int argc, char **argv) {
     }
 
     range.clear();
-    MBresult = MBI -> get_entities_by_type( treeiter.handle(), moab::MBHEX, range );
+    MBresult = MBI -> get_entities_by_type(tree_node, moab::MBHEX, range );
     assert(MBresult == moab::MB_SUCCESS);
 
     // davg += (double) range.size();

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list