[MOAB-dev] r4281 - MOAB/trunk/tools/mbcoupler

acaceres at mcs.anl.gov acaceres at mcs.anl.gov
Thu Nov 18 16:25:45 CST 2010


Author: acaceres
Date: 2010-11-18 16:25:45 -0600 (Thu, 18 Nov 2010)
New Revision: 4281

Modified:
   MOAB/trunk/tools/mbcoupler/Coupler.cpp
Log:
fixed some bugs that showed up when the source and target meshes used
different partitions. 


Modified: MOAB/trunk/tools/mbcoupler/Coupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/Coupler.cpp	2010-11-18 20:44:49 UTC (rev 4280)
+++ MOAB/trunk/tools/mbcoupler/Coupler.cpp	2010-11-18 22:25:45 UTC (rev 4281)
@@ -6,7 +6,9 @@
 #include "moab/CN.hpp"
 #include "iMesh_extensions.h"
 #include "iostream"
+#include <stdio.h>
 
+
 extern "C" 
 {
 #include "types.h"
@@ -67,7 +69,6 @@
   Range local_ents;
   AdaptiveKDTree::Settings settings;
   settings.candidatePlaneSet = AdaptiveKDTree::SUBDIVISION;
-  allBoxes.resize(6*myPc->proc_config().proc_size());
 
     //get entities on the local part
   ErrorCode result = myPc->get_part_entities(local_ents, 3);
@@ -109,6 +110,13 @@
                               &allBoxes[0], 6, MPI_DOUBLE, 
                               myPc->proc_config().proc_comm());
 
+
+  /*  std::ostringstream blah;
+  for(int i=0; i<allBoxes.size(); i++)
+  blah << allBoxes[i] << " ";
+  std::cout<<blah.str()<<"\n";*/
+
+
 #ifndef NDEBUG
   double min[3] = {0,0,0}, max[3] = {0,0,0};
   unsigned int dep;
@@ -178,11 +186,12 @@
       {
           // if in this proc's box, will send to proc to test further
           // check size, grow if we're at max
-        if (target_pts.n == target_pts.max)
+        if (target_pts.n == target_pts.max) 
           tuple_list_grow(&target_pts);
   
         target_pts.vi[2*target_pts.n] = j;
         target_pts.vi[2*target_pts.n+1] = i/3;
+
         target_pts.vr[3*target_pts.n] = xyz[i];
         target_pts.vr[3*target_pts.n+1] = xyz[i+1];
         target_pts.vr[3*target_pts.n+2] = xyz[i+2];
@@ -239,23 +248,38 @@


More information about the moab-dev mailing list