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

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue Jun 17 13:18:17 CDT 2008


Author: tautges
Date: 2008-06-17 13:18:17 -0500 (Tue, 17 Jun 2008)
New Revision: 1903

Modified:
   MOAB/trunk/tools/mbcoupler/MBCoupler.cpp
   MOAB/trunk/tools/mbcoupler/MBCoupler.hpp
Log:
Couple of changes to variable names for clarity.


Modified: MOAB/trunk/tools/mbcoupler/MBCoupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/MBCoupler.cpp	2008-06-17 16:50:10 UTC (rev 1902)
+++ MOAB/trunk/tools/mbcoupler/MBCoupler.cpp	2008-06-17 18:18:17 UTC (rev 1903)
@@ -26,7 +26,7 @@
 
     // initialize tuple lists to indicate not initialized
   mappedPts = NULL;
-  sourcePts = NULL;
+  targetPts = NULL;
 }
 
   /* destructor
@@ -46,8 +46,10 @@
   tuple_list_init_max(&target_pts, 2, 0, 0, 3, 3*num_points);
 
     // for each point, find box(es) containing the point, 
-    // appending results to tuple_list; keep local points separately
-  std::vector<unsigned int> local_pts;
+    // appending results to tuple_list; 
+    // keep local points separately, in local_pts, which has pairs
+    // of <local_index, mapped_index>, where mapped_index is the index
+    // into the mappedPts tuple list
   int threen = 0;
   for (int i = 0; i < 3*num_points; i+=3) {
     for (;;/*  <marco - loop over boxes> */ ) {
@@ -82,9 +84,8 @@
     // source_pts.vi[3*i+1] = index of point i on sending proc
     // source_pts.vi[3*i+2] = index of mapped point (-1 if not mapped)
     //
-    // Also, mapping builds local tuple_list local_pts:
+    // Also, mapping builds local tuple_list mappedPts:
     // mappedPts->n = # mapped points
-    // mappedPts->vi[i] = index of point i on local proc
     // mappedPts->vul[i] = local handle of mapped entity
     // mappedPts->vr[3*i..3*i+2] = natural coordinates in mapped entity
 
@@ -92,7 +93,7 @@
   tuple_list source_pts;
   mappedPts = new tuple_list;
   tuple_list_init_max(&source_pts, 3, 0, 0, 0, target_pts.n);
-  tuple_list_init_max(mappedPts, 1, 0, 1, 3, target_pts.n);
+  tuple_list_init_max(mappedPts, 0, 0, 1, 3, target_pts.n);
 
   for (unsigned i = 0; i < target_pts.n; i++) {
       // find leaf node(s) in local kdtree containing point i
@@ -114,7 +115,7 @@
     // perform scatter/gather to send proc/index tuples back to procs
   gs_transfer(1, &source_pts, 0, myPc->proc_config().crystal_router());
 
-    // store proc/index tuples in sourcePts, and/or pass back to application;
+    // store proc/index tuples in targetPts, and/or pass back to application;
     // the tuple this gets stored to looks like:
     // tl.n = # mapped points
     // tl.vi[3*i] = remote proc mapping point
@@ -129,8 +130,8 @@
   for (unsigned int i = 0; i < source_pts.n; i++) 
     if (-1 != source_pts.vi[3*i+2]) num_pts++;
 
-  sourcePts = new tuple_list;
-  tuple_list *tl_tmp = sourcePts;
+  targetPts = new tuple_list;
+  tuple_list *tl_tmp = targetPts;
   if (!store_local) tl_tmp = tl;
   tuple_list_init_max(tl_tmp, 3, 0, 0, 0, num_pts);
   tl_tmp->n = num_pts;

Modified: MOAB/trunk/tools/mbcoupler/MBCoupler.hpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/MBCoupler.hpp	2008-06-17 16:50:10 UTC (rev 1902)
+++ MOAB/trunk/tools/mbcoupler/MBCoupler.hpp	2008-06-17 18:18:17 UTC (rev 1903)
@@ -150,14 +150,30 @@
      */
   MBRange myRange;
 
-    /* \brief Tuple list of locally mapped points
+    /* \brief List of locally mapped tuples
+     * Tuples contain the following:
+     * n = # mapped points
+     * vul[i] = local handle of mapped entity
+     * vr[3*i..3*i+2] = natural coordinates in mapped entity
      */
   tuple_list *mappedPts;
   
-    /* \brief Tuple list of source points
+    /* \brief Tuple list of target points
+     * Tuples contain the following:
+     * n = # source points
+     * vi[3*i] = remote proc mapping target point
+     * vi[3*i+1] = local index of target point
+     * vi[3*i+2] = remote index of target point
      */
-  tuple_list *sourcePts;
-  
+  tuple_list *targetPts;
+
+    /* \brief Locally mapped points
+     * Points whose source and target are both local; these
+     * points consist of two indices, <target_index, mapped_index>,
+     * where target_index is the index in the target points array
+     * and mapped_index is the corresponding index into mappedPts
+     */
+  std::vector<unsigned int> localMappedPts;
 };
 
 #endif




More information about the moab-dev mailing list