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

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


Author: tautges
Date: 2008-06-17 13:33:38 -0500 (Tue, 17 Jun 2008)
New Revision: 1904

Modified:
   MOAB/trunk/tools/mbcoupler/MBCoupler.cpp
   MOAB/trunk/tools/mbcoupler/MBCoupler.hpp
Log:
Skeleton of interpolate function, also a few more name changes for clarity.


Modified: MOAB/trunk/tools/mbcoupler/MBCoupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/MBCoupler.cpp	2008-06-17 18:18:17 UTC (rev 1903)
+++ MOAB/trunk/tools/mbcoupler/MBCoupler.cpp	2008-06-17 18:33:38 UTC (rev 1904)
@@ -133,7 +133,7 @@
   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);
+  tuple_list_init_max(tl_tmp, 3, 0, 0, 1, num_pts);
   tl_tmp->n = num_pts;
   for (unsigned int i = 0; i < source_pts.n; i++) {
     if (-1 != source_pts.vi[3*i+2]) {
@@ -148,7 +148,7 @@
 
     // copy into tl if passed in and storing locally
   if (tl && store_local) {
-    tuple_list_init_max(tl, 3, 0, 0, 0, num_pts);
+    tuple_list_init_max(tl, 3, 0, 0, 1, num_pts);
     memcpy(tl->vi, tl_tmp->vi, 3*sizeof(int));
     tl->n = tl_tmp->n;
   }
@@ -164,16 +164,24 @@
                                    bool normalize) 
 {
   if (LINEAR_FE != method) return MB_FAILURE;
+
+  tuple_list *tl_tmp = (tl ? tl : targetPts);
   
-    // if no tl, gather procs/indices of locations being interpolated
-
     // scatter/gather interpolation points
+  gs_transfer(1, tl_tmp, 0, myPc->proc_config().crystal_router());
 
-    // perform interpolation on local source mesh
+    // perform interpolation on local source mesh; put results into
+    // tl_tmp->vr[i]
 
+    // interpolate locally mapped points too, putting results directly 
+    // into interp_vals
+
     // normalize interpolation
 
     // scatter/gather interpolation data
+  gs_transfer(1, tl_tmp, 0, myPc->proc_config().crystal_router());
+  for (unsigned int i = 0; i < tl_tmp->n; i++)
+    interp_vals[tl_tmp->vi[3*i+1]] = tl_tmp->vr[i];
 
     // done
   return MB_SUCCESS;

Modified: MOAB/trunk/tools/mbcoupler/MBCoupler.hpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/MBCoupler.hpp	2008-06-17 18:18:17 UTC (rev 1903)
+++ MOAB/trunk/tools/mbcoupler/MBCoupler.hpp	2008-06-17 18:33:38 UTC (rev 1904)
@@ -158,12 +158,13 @@
      */
   tuple_list *mappedPts;
   
-    /* \brief Tuple list of target points
+    /* \brief Tuple list of target points and interpolated data
      * Tuples contain the following:
-     * n = # source points
+     * n = # target 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
+     * vr[i] = interpolated data (used by interpolate function)
      */
   tuple_list *targetPts;
 
@@ -174,6 +175,7 @@
      * and mapped_index is the corresponding index into mappedPts
      */
   std::vector<unsigned int> localMappedPts;
+
 };
 
 #endif




More information about the moab-dev mailing list