[cig-commits] commit: Sync the rhs since that is needed for computing the p update in the

Mercurial hg at geodynamics.org
Fri Feb 25 14:15:36 PST 2011


changeset:   63:44d212390ac9
user:        Walter Landry <wlandry at caltech.edu>
date:        Fri Jan 14 15:43:08 2011 -0800
files:       StokesFACOps/smoothErrorByRedBlack.C
description:
Sync the rhs since that is needed for computing the p update in the
ghost zone correctly, and thus the v update in the regular box.

Also fix the logic so that the p update does happen in ghost zones.


diff -r ad8ff79e9bac -r 44d212390ac9 StokesFACOps/smoothErrorByRedBlack.C
--- a/StokesFACOps/smoothErrorByRedBlack.C	Fri Jan 14 15:36:03 2011 -0800
+++ b/StokesFACOps/smoothErrorByRedBlack.C	Fri Jan 14 15:43:08 2011 -0800
@@ -58,6 +58,12 @@ void SAMRAI::solv::StokesFACOps::smoothE
     p_rhs_id(residual.getComponentDescriptorIndex(0)),
     v_id(solution.getComponentDescriptorIndex(1)),
     v_rhs_id(residual.getComponentDescriptorIndex(1));
+
+  /* Only need to sync the rhs once. This sync is needed because
+     calculating a new pressure update requires computing in the ghost
+     region so that the update for the velocity inside the box will be
+     correct. */
+  xeqScheduleGhostFillNoCoarse(p_rhs_id,v_rhs_id,ln);
 
   checkInputPatchDataIndices();
 
@@ -122,6 +128,10 @@ void SAMRAI::solv::StokesFACOps::smoothE
               double dx = *(geom->getDx());
               double dy = *(geom->getDx());
 
+              hier::Box pgbox=p->getGhostBox();
+              hier::Box prgbox=p_rhs->getGhostBox();
+              hier::Box vgbox=v->getGhostBox();
+
               for(int j=pbox.lower(1); j<=pbox.upper(1)+1; ++j)
                 {
                   /* Do the red-black skip */
@@ -140,8 +150,30 @@ void SAMRAI::solv::StokesFACOps::smoothE
                       ++right[0];
                       --left[0];
 
+                      // tbox::plog << "smooth "
+                      //            << i << " "
+                      //            << j << " "
+                      //            << pbox.lower(0) << " "
+                      //            << pbox.upper(0) << " "
+                      //            << pbox.lower(1) << " "
+                      //            << pbox.upper(1) << " ";
+                      //            // << pgbox.lower(0) << " "
+                      //            // << pgbox.upper(0) << " "
+                      //            // << pgbox.lower(1) << " "
+                      //            // << pgbox.upper(1) << " "
+                      //            // << prgbox.lower(0) << " "
+                      //            // << prgbox.upper(0) << " "
+                      //            // << prgbox.lower(1) << " "
+                      //            // << prgbox.upper(1) << " "
+                      //            // << vgbox.lower(0) << " "
+                      //            // << vgbox.upper(0) << " "
+                      //            // << vgbox.lower(1) << " "
+                      //            // << vgbox.upper(1) << " ";
                       /* Update p */
-                      if(i!=pbox.upper(0)+1 && j!=pbox.upper(1)+1)
+                      if((!(i==pbox.upper(0)+1
+                            && geom->getTouchesRegularBoundary(0,1))
+                           && !(j==pbox.upper(1)+1
+                                && geom->getTouchesRegularBoundary(1,1))))
                         {
                           double dvx_dx=
                             ((*v)(pdat::SideIndex(center,pdat::SideIndex::X,
@@ -162,6 +194,12 @@ void SAMRAI::solv::StokesFACOps::smoothE
 
                           (*p)(center)+=
                             viscosity*delta_R_continuity*theta_continuity;
+
+                          // tbox::plog << "p "
+                          //            << (*p)(center) << " "
+                          //            << (*p_rhs)(center) << " "
+                          //            << dvx_dx << " "
+                          //            << dvy_dy << " ";
                         }
 
                       /* Update vx */
@@ -247,6 +285,9 @@ void SAMRAI::solv::StokesFACOps::smoothE
                                                    pdat::SideIndex::Lower))+=
                                 delta_Rx*theta_momentum/C_vx;
                             }
+                          // tbox::plog << "vx "
+                          //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                          //                          pdat::SideIndex::Lower)) << " ";
                         }
 
                       /* Update vy */
@@ -330,7 +371,12 @@ void SAMRAI::solv::StokesFACOps::smoothE
                                                    pdat::SideIndex::Lower))+=
                                 delta_Ry*theta_momentum/C_vy;
                             }
+
+                          // tbox::plog << "vy "
+                          //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                          //                          pdat::SideIndex::Lower)) << " ";
                         }
+                      // tbox::plog << "\n";
                     }
                 }
             }



More information about the CIG-COMMITS mailing list