[cig-commits] commit: Make sure to sync v before coarsening because v coarsening uses ghost zones.

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


changeset:   59:1794b3745807
user:        Walter Landry <wlandry at caltech.edu>
date:        Fri Jan 14 11:33:51 2011 -0800
files:       FACStokes/FACStokes.C StokesFACOps/restrictResidual.C StokesFACOps/restrictSolution.C StokesFACOps/xeqScheduleGhostFillNoCoarse.C
description:
Make sure to sync v before coarsening because v coarsening uses ghost zones.


diff -r 34cdb1c9286e -r 1794b3745807 FACStokes/FACStokes.C
--- a/FACStokes/FACStokes.C	Fri Jan 14 11:12:07 2011 -0800
+++ b/FACStokes/FACStokes.C	Fri Jan 14 11:33:51 2011 -0800
@@ -79,10 +79,8 @@ namespace SAMRAI {
     tbox::Pointer<pdat::CellVariable<double> >
       p_rhs(new pdat::CellVariable<double>(dim,object_name
                                            + ":p right hand side"));
-                                          
     p_rhs_id = vdb->registerVariableAndContext(p_rhs,d_context,
-                                               hier::IntVector(dim, 0)
-                                               /* ghost cell width is 0 */);
+                                               hier::IntVector(dim, 0));
 
     tbox::Pointer<pdat::SideVariable<double> >
       v(new pdat::SideVariable<double>(dim, object_name + ":v", 1));
@@ -94,8 +92,10 @@ namespace SAMRAI {
       v_rhs(new pdat::SideVariable<double>(dim,object_name
                                            + ":v right hand side"));
     v_rhs_id = vdb->registerVariableAndContext(v_rhs,d_context,
-                                               hier::IntVector(dim, 0)
-                                               /* ghost cell width is 0 */);
+                                               hier::IntVector(dim, 1)
+                                               /* ghost cell width is
+                                                  1 for coarsening
+                                                  operator */);
 
     /*
      * Specify an implementation of solv::RobinBcCoefStrategy for the
diff -r 34cdb1c9286e -r 1794b3745807 StokesFACOps/restrictResidual.C
--- a/StokesFACOps/restrictResidual.C	Fri Jan 14 11:12:07 2011 -0800
+++ b/StokesFACOps/restrictResidual.C	Fri Jan 14 11:33:51 2011 -0800
@@ -53,11 +53,15 @@ void SAMRAI::solv::StokesFACOps::restric
 {
   t_restrict_residual->start();
 
-  xeqScheduleRRestriction(d.getComponentDescriptorIndex(0),
-                          s.getComponentDescriptorIndex(0),
-                          d.getComponentDescriptorIndex(1),
-                          s.getComponentDescriptorIndex(1),
-                          dest_ln);
+  int p_src(s.getComponentDescriptorIndex(0)),
+    p_dst(d.getComponentDescriptorIndex(0)),
+    v_src(s.getComponentDescriptorIndex(1)),
+    v_dst(d.getComponentDescriptorIndex(1));
+
+  /* Need to do a sync because the coarsening for v uses ghost zones */
+  xeqScheduleGhostFillNoCoarse(-1,v_src,dest_ln+1);
+
+  xeqScheduleRRestriction(p_dst,p_src,v_dst,v_src,dest_ln);
 
   t_restrict_residual->stop();
 }
diff -r 34cdb1c9286e -r 1794b3745807 StokesFACOps/restrictSolution.C
--- a/StokesFACOps/restrictSolution.C	Fri Jan 14 11:12:07 2011 -0800
+++ b/StokesFACOps/restrictSolution.C	Fri Jan 14 11:33:51 2011 -0800
@@ -55,21 +55,23 @@ void SAMRAI::solv::StokesFACOps::restric
 {
   t_restrict_solution->start();
 
-  xeqScheduleURestriction(d.getComponentDescriptorIndex(0),
-                          s.getComponentDescriptorIndex(0),
-                          d.getComponentDescriptorIndex(1),
-                          s.getComponentDescriptorIndex(1),
-                          dest_ln);
+  int p_src(s.getComponentDescriptorIndex(0)),
+    p_dst(d.getComponentDescriptorIndex(0)),
+    v_src(s.getComponentDescriptorIndex(1)),
+    v_dst(d.getComponentDescriptorIndex(1));
+
+  /* Need to do a sync because the coarsening for v uses ghost zones. */
+  xeqScheduleGhostFillNoCoarse(-1,v_src,dest_ln+1);
+
+  xeqScheduleURestriction(p_dst,p_src,v_dst,v_src,dest_ln);
 
   // d_bc_helper.setHomogeneousBc(false);
   // d_bc_helper.setTargetDataId(d.getComponentDescriptorIndex(0));
 
   if (dest_ln == d_ln_min) {
-    xeqScheduleGhostFillNoCoarse(d.getComponentDescriptorIndex(0),
-                                 d.getComponentDescriptorIndex(1), dest_ln);
+    xeqScheduleGhostFillNoCoarse(p_dst,v_dst,dest_ln);
   } else {
-    xeqScheduleGhostFill(d.getComponentDescriptorIndex(0),
-                         d.getComponentDescriptorIndex(1), dest_ln);
+    xeqScheduleGhostFill(p_dst,v_dst,dest_ln);
   }
 
   t_restrict_solution->stop();
diff -r 34cdb1c9286e -r 1794b3745807 StokesFACOps/xeqScheduleGhostFillNoCoarse.C
--- a/StokesFACOps/xeqScheduleGhostFillNoCoarse.C	Fri Jan 14 11:12:07 2011 -0800
+++ b/StokesFACOps/xeqScheduleGhostFillNoCoarse.C	Fri Jan 14 11:33:51 2011 -0800
@@ -45,6 +45,7 @@ void SAMRAI::solv::StokesFACOps::xeqSche
                                                               int dest_ln)
 {
   /* p */
+  if(p_id!=-1)
   {
     if (!p_nocoarse_refine_schedules[dest_ln]) {
       TBOX_ERROR("Expected cell schedule not found.");



More information about the CIG-COMMITS mailing list