[MOAB-dev] r4082 - MOAB/trunk/src/io

bmsmith6 at wisc.edu bmsmith6 at wisc.edu
Wed Aug 11 14:44:12 CDT 2010


Author: bmsmith
Date: 2010-08-11 14:44:12 -0500 (Wed, 11 Aug 2010)
New Revision: 4082

Modified:
   MOAB/trunk/src/io/ReadNCDF.cpp
Log:
Rework confusing logic to match nodes
  If matching by id, use std::map
  If matching by proximity, use kdtree



Modified: MOAB/trunk/src/io/ReadNCDF.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNCDF.cpp	2010-08-11 17:50:09 UTC (rev 4081)
+++ MOAB/trunk/src/io/ReadNCDF.cpp	2010-08-11 19:44:12 UTC (rev 4082)
@@ -1843,92 +1843,103 @@
   if( strcmp (op, "set") && strcmp (op, " set"))
     return MB_NOT_IMPLEMENTED;
 
-  // Some accounting
-  int found = 0;
-  int lost = 0;
+  // Two methods of matching nodes (id vs. proximity)
+  const bool match_node_ids = true;
 
-  // Place cub verts in a kdtree.
+  // Get nodes in cubit file
   Range cub_verts;
   rval = mdbImpl->get_entities_by_type( cub_file_set, MBVERTEX, cub_verts );
   if(MB_SUCCESS != rval) return rval;
   std::cout << "  cub_file_set contains " << cub_verts.size() << " nodes." 
+	    << std::endl;
+
+  // Some accounting
+  std::cout << "  exodus file contains " << numberNodes_loading << " nodes." 
             << std::endl;
+  double max_magnitude = 0;
+  double average_magnitude = 0;
+  int found = 0;
+  int lost = 0;
+  std::map<int,EntityHandle> cub_verts_id_map;
   AdaptiveKDTree kdtree( mdbImpl, true );
   EntityHandle root;
-  AdaptiveKDTree::Settings settings;
-  settings.maxEntPerLeaf = 1;                                   
-  settings.candidateSplitsPerDir = 1;                
-  settings.candidatePlaneSet = AdaptiveKDTree::SUBDIVISION;
-  rval = kdtree.build_tree( cub_verts, root, &settings );      
-  if(MB_SUCCESS != rval) return rval;
-  AdaptiveKDTreeIter tree_iter;                                                     
-  rval = kdtree.get_tree_iterator( root, tree_iter );
-  if(MB_SUCCESS != rval) return rval;
 
-  double max_magnitude = 0;
-  double average_magnitude = 0;
-
-  // Find the matching cub node by id or proximity
-  const bool match_node_ids = true;
-
-  // We should not use cub verts unless they have been matched. Place in a map
+  // Should not use cub verts unless they have been matched. Place in a map
   // for fast handle_by_id lookup.


More information about the moab-dev mailing list