[cig-commits] commit: Get rid of p_id and v_id and restructure relax to update all of the

Mercurial hg at geodynamics.org
Fri Feb 25 14:13:46 PST 2011


changeset:   29:99b1a4090021
user:        Walter Landry <wlandry at caltech.edu>
date:        Thu Jan 06 19:36:35 2011 -0800
files:       Makefile StokesFACOps.I StokesFACOps.h StokesFACOps/StokesFACOps.C StokesFACOps/checkInputPatchDataIndices.C StokesFACOps/initializeOperatorState.C StokesFACOps/redOrBlackSmoothingOnPatch.C StokesFACOps/relax.C StokesFACSolver/initializeSolverState.C
description:
Get rid of p_id and v_id and restructure relax to update all of the
ghost zones.  Seems to work in parallel


diff -r 4c5d30cbc5d4 -r 99b1a4090021 Makefile
--- a/Makefile	Thu Jan 06 19:34:12 2011 -0800
+++ b/Makefile	Thu Jan 06 19:36:35 2011 -0800
@@ -43,7 +43,6 @@ CXX_OBJS      = main.o FACStokes/FACStok
 	StokesFACOps/initializeOperatorState.o \
 	StokesFACOps/postprocessOneCycle.o \
 	StokesFACOps/prolongErrorAndCorrect.o \
-	StokesFACOps/redOrBlackSmoothingOnPatch.o \
 	StokesFACOps/relax.o \
 	StokesFACOps/restrictResidual.o \
 	StokesFACOps/restrictSolution.o \
diff -r 4c5d30cbc5d4 -r 99b1a4090021 StokesFACOps.I
--- a/StokesFACOps.I	Thu Jan 06 19:34:12 2011 -0800
+++ b/StokesFACOps.I	Thu Jan 06 19:36:35 2011 -0800
@@ -84,22 +84,6 @@ void StokesFACOps::setFluxId(
 void StokesFACOps::setFluxId(
    int flux_id) {
    d_flux_id = flux_id;
-#ifdef DEBUG_CHECK_ASSERTIONS
-   checkInputPatchDataIndices();
-#endif
-}
-
-/*
- ********************************************************************
- * Set the patch data id for p and v.                               *
- ********************************************************************
- */
-
-SAMRAI_INLINE_KEYWORD
-void StokesFACOps::set_p_v(
-   int p, int v) {
-   p_id = p;
-   v_id = v;
 #ifdef DEBUG_CHECK_ASSERTIONS
    checkInputPatchDataIndices();
 #endif
diff -r 4c5d30cbc5d4 -r 99b1a4090021 StokesFACOps.h
--- a/StokesFACOps.h	Thu Jan 06 19:34:12 2011 -0800
+++ b/StokesFACOps.h	Thu Jan 06 19:36:35 2011 -0800
@@ -294,9 +294,6 @@ public:
    void
    setFluxId(
       int flux_id);
-
-   void
-   set_p_v(int p_id, int v_id);
 
    //@}
 
@@ -875,8 +872,6 @@ private:
     */
    int d_flux_id;
 
-  int p_id, v_id;
-
 #ifdef HAVE_HYPRE
    /*!
     * @brief HYPRE coarse-level solver object.
diff -r 4c5d30cbc5d4 -r 99b1a4090021 StokesFACOps/StokesFACOps.C
--- a/StokesFACOps/StokesFACOps.C	Thu Jan 06 19:34:12 2011 -0800
+++ b/StokesFACOps/StokesFACOps.C	Thu Jan 06 19:36:35 2011 -0800
@@ -98,8 +98,6 @@ namespace SAMRAI {
       d_coarse_solver_max_iterations(10),
       d_residual_tolerance_during_smoothing(-1.0),
       d_flux_id(-1),
-      p_id(-1),
-      v_id(-1),
 #ifdef HAVE_HYPRE
       d_hypre_solver(dim,
                      object_name + "::hypre_solver",
diff -r 4c5d30cbc5d4 -r 99b1a4090021 StokesFACOps/checkInputPatchDataIndices.C
--- a/StokesFACOps/checkInputPatchDataIndices.C	Thu Jan 06 19:34:12 2011 -0800
+++ b/StokesFACOps/checkInputPatchDataIndices.C	Thu Jan 06 19:36:35 2011 -0800
@@ -82,23 +82,6 @@ namespace SAMRAI {
 
         TBOX_ASSERT(flux_var);
       }
-
-      if (p_id != -1) {
-        tbox::Pointer<hier::Variable> var;
-        vdb.mapIndexToVariable(p_id, var);
-        tbox::Pointer<pdat::CellVariable<double> > p_var = var;
-
-        TBOX_ASSERT(p_var);
-      }
-
-      if (v_id != -1) {
-        tbox::Pointer<hier::Variable> var;
-        vdb.mapIndexToVariable(v_id, var);
-        tbox::Pointer<pdat::SideVariable<double> > v_var = var;
-
-        TBOX_ASSERT(v_var);
-      }
-
     }
 
   }
diff -r 4c5d30cbc5d4 -r 99b1a4090021 StokesFACOps/initializeOperatorState.C
--- a/StokesFACOps/initializeOperatorState.C	Thu Jan 06 19:34:12 2011 -0800
+++ b/StokesFACOps/initializeOperatorState.C	Thu Jan 06 19:36:35 2011 -0800
@@ -356,9 +356,15 @@ void SAMRAI::solv::StokesFACOps::initial
                    solution.getComponentDescriptorIndex(0),
                    d_ghostfill_nocoarse_refine_operator);
   p_nocoarse_refine_algorithm->
-    registerRefine(p_id,p_id,p_id,p_nocoarse_refine_operator);
+    registerRefine(solution.getComponentDescriptorIndex(0),
+                   solution.getComponentDescriptorIndex(0),
+                   solution.getComponentDescriptorIndex(0),
+                   p_nocoarse_refine_operator);
   v_nocoarse_refine_algorithm->
-    registerRefine(v_id,v_id,v_id,v_nocoarse_refine_operator);
+    registerRefine(solution.getComponentDescriptorIndex(1),
+                   solution.getComponentDescriptorIndex(1),
+                   solution.getComponentDescriptorIndex(1),
+                   v_nocoarse_refine_operator);
 
   for (int dest_ln = d_ln_min + 1; dest_ln <= d_ln_max; ++dest_ln) {
 
diff -r 4c5d30cbc5d4 -r 99b1a4090021 StokesFACOps/redOrBlackSmoothingOnPatch.C
--- a/StokesFACOps/redOrBlackSmoothingOnPatch.C	Thu Jan 06 19:34:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,596 +0,0 @@
-/*************************************************************************
- *
- * This file is part of the SAMRAI distribution.  For full copyright 
- * information, see COPYRIGHT and COPYING.LESSER. 
- *
- * Copyright:     (c) 1997-2010 Lawrence Livermore National Security, LLC
- * Description:   Operator class for cell-centered scalar Stokes using FAC 
- *
- ************************************************************************/
-#include "StokesFACOps.h"
-
-#include IOMANIP_HEADER_FILE
-
-#include "SAMRAI/hier/BoundaryBoxUtils.h"
-#include "SAMRAI/geom/CartesianGridGeometry.h"
-#include "SAMRAI/geom/CartesianPatchGeometry.h"
-#include "SAMRAI/hier/Index.h"
-#include "SAMRAI/hier/Variable.h"
-#include "SAMRAI/hier/VariableDatabase.h"
-#include "SAMRAI/pdat/CellDoubleConstantRefine.h"
-#include "SAMRAI/pdat/CellVariable.h"
-#include "SAMRAI/pdat/OutersideData.h"
-#include "SAMRAI/pdat/OutersideVariable.h"
-#include "SAMRAI/hier/PatchData.h"
-#include "SAMRAI/pdat/SideVariable.h"
-#include "SAMRAI/solv/FACPreconditioner.h"
-#include "StokesHypreSolver.h"
-#include "SAMRAI/tbox/Array.h"
-#include "SAMRAI/tbox/MathUtilities.h"
-#include "SAMRAI/tbox/StartupShutdownManager.h"
-#include "SAMRAI/tbox/Timer.h"
-#include "SAMRAI/tbox/TimerManager.h"
-#include "SAMRAI/tbox/Utilities.h"
-#include "SAMRAI/tbox/MathUtilities.h"
-#include "SAMRAI/xfer/CoarsenAlgorithm.h"
-#include "SAMRAI/xfer/CoarsenOperator.h"
-#include "SAMRAI/xfer/CoarsenSchedule.h"
-#include "SAMRAI/xfer/RefineAlgorithm.h"
-#include "SAMRAI/xfer/RefineOperator.h"
-#include "SAMRAI/xfer/RefineSchedule.h"
-#include "SAMRAI/xfer/PatchLevelFullFillPattern.h"
-
-namespace SAMRAI {
-  namespace solv {
-
-extern "C" {
-void F77_FUNC(rbgswithfluxmaxvardcvarsf2d, RBGSWITHFLUXMAXVARDCVARSF2D) (
-   const double* xflux,
-   const double* yflux,
-   const int* fluxgi,
-   const int* fluxgj,
-   const double* xdiff_coef,
-   const double* ydiff_coef,
-   const int* dcgi,
-   const int* dcgj,
-   const double* rhs,
-   const int* rhsgi,
-   const int* rhsgj,
-   const double* scalar_field,
-   const int* scalar_field_gi,
-   const int* scalar_field_gj,
-   double* soln,
-   const int* solngi,
-   const int* solngj,
-   const int* ifirst,
-   const int* ilast,
-   const int* jfirst,
-   const int* jlast,
-   const double* dx,
-   const int* offset,
-   const double* maxres);
-void F77_FUNC(rbgswithfluxmaxcondcvarsf2d, RBGSWITHFLUXMAXCONDCVARSF2D) (
-   const double* xflux,
-   const double* yflux,
-   const int* fluxgi,
-   const int* fluxgj,
-   const double & dc,
-   const double* rhs,
-   const int* rhsgi,
-   const int* rhsgj,
-   const double* scalar_field,
-   const int* scalar_field_gi,
-   const int* scalar_field_gj,
-   double* soln,
-   const int* solngi,
-   const int* solngj,
-   const int* ifirst,
-   const int* ilast,
-   const int* jfirst,
-   const int* jlast,
-   const double* dx,
-   const int* offset,
-   const double* maxres);
-void F77_FUNC(rbgswithfluxmaxvardcconsf2d, RBGSWITHFLUXMAXVARDCCONSF2D) (
-   const double* xflux,
-   const double* yflux,
-   const int* fluxgi,
-   const int* fluxgj,
-   const double* xdiff_coef,
-   const double* ydiff_coef,
-   const int* dcgi,
-   const int* dcgj,
-   const double* rhs,
-   const int* rhsgi,
-   const int* rhsgj,
-   const double & scalar_field,
-   double* soln,
-   const int* solngi,
-   const int* solngj,
-   const int* ifirst,
-   const int* ilast,
-   const int* jfirst,
-   const int* jlast,
-   const double* dx,
-   const int* offset,
-   const double* maxres);
-void F77_FUNC(rbgswithfluxmaxcondcconsf2d, RBGSWITHFLUXMAXCONDCCONSF2D) (
-   const double* xflux,
-   const double* yflux,
-   const int* fluxgi,
-   const int* fluxgj,
-   const double & dc,
-   const double* rhs,
-   const int* rhsgi,
-   const int* rhsgj,
-   const double & scalar_field,
-   double* soln,
-   const int* solngi,
-   const int* solngj,
-   const int* ifirst,
-   const int* ilast,
-   const int* jfirst,
-   const int* jlast,
-   const double* dx,
-   const int* offset,
-   const double* maxres);
-void F77_FUNC(rbgswithfluxmaxvardcvarsf3d, RBGSWITHFLUXMAXVARDCVARSF3D) (
-   const double* xflux,
-   const double* yflux,
-   const double* zflux,
-   const int* fluxgi,
-   const int* fluxgj,
-   const int* fluxgk,
-   const double* xdiff_coef,
-   const double* ydiff_coef,
-   const double* zdiff_coef,
-   const int* dcgi,
-   const int* dcgj,
-   const int* dcgk,
-   const double* rhs,
-   const int* rhsgi,
-   const int* rhsgj,
-   const int* rhsgk,
-   const double* scalar_field,
-   const int* scalar_field_gi,
-   const int* scalar_field_gj,
-   const int* scalar_field_gk,
-   double* soln,
-   const int* solngi,
-   const int* solngj,
-   const int* solngk,
-   const int* ifirst,
-   const int* ilast,
-   const int* jfirst,
-   const int* jlast,
-   const int* kfirst,
-   const int* klast,
-   const double* dx,
-   const int* offset,
-   const double* maxres);
-void F77_FUNC(rbgswithfluxmaxcondcvarsf3d, RBGSWITHFLUXMAXCONDCVARSF3D) (
-   const double* xflux,
-   const double* yflux,
-   const double* zflux,
-   const int* fluxgi,
-   const int* fluxgj,
-   const int* fluxgk,
-   const double & dc,
-   const double* rhs,
-   const int* rhsgi,
-   const int* rhsgj,
-   const int* rhsgk,
-   const double* scalar_field,
-   const int* scalar_field_gi,
-   const int* scalar_field_gj,
-   const int* scalar_field_gk,
-   double* soln,
-   const int* solngi,
-   const int* solngj,
-   const int* solngk,
-   const int* ifirst,
-   const int* ilast,
-   const int* jfirst,
-   const int* jlast,
-   const int* kfirst,
-   const int* klast,
-   const double* dx,
-   const int* offset,
-   const double* maxres);
-void F77_FUNC(rbgswithfluxmaxvardcconsf3d, RBGSWITHFLUXMAXVARDCCONSF3D) (
-   const double* xflux,
-   const double* yflux,
-   const double* zflux,
-   const int* fluxgi,
-   const int* fluxgj,
-   const int* fluxgk,
-   const double* xdiff_coef,
-   const double* ydiff_coef,
-   const double* zdiff_coef,
-   const int* dcgi,
-   const int* dcgj,
-   const int* dcgk,
-   const double* rhs,
-   const int* rhsgi,
-   const int* rhsgj,
-   const int* rhsgk,
-   const double & scalar_field,
-   double* soln,
-   const int* solngi,
-   const int* solngj,
-   const int* solngk,
-   const int* ifirst,
-   const int* ilast,
-   const int* jfirst,
-   const int* jlast,
-   const int* kfirst,
-   const int* klast,
-   const double* dx,
-   const int* offset,
-   const double* maxres);
-void F77_FUNC(rbgswithfluxmaxcondcconsf3d, RBGSWITHFLUXMAXCONDCCONSF3D) (
-   const double* xflux,
-   const double* yflux,
-   const double* zflux,
-   const int* fluxgi,
-   const int* fluxgj,
-   const int* fluxgk,
-   const double & dc,
-   const double* rhs,
-   const int* rhsgi,
-   const int* rhsgj,
-   const int* rhsgk,
-   const double & scalar_field,
-   double* soln,
-   const int* solngi,
-   const int* solngj,
-   const int* solngk,
-   const int* ifirst,
-   const int* ilast,
-   const int* jfirst,
-   const int* jlast,
-   const int* kfirst,
-   const int* klast,
-   const double* dx,
-   const int* offset,
-   const double* maxres);
-
-}
-    void StokesFACOps::redOrBlackSmoothingOnPatch(
-                                                  const hier::Patch& patch,
-                                                  const pdat::SideData<double>& flux_data,
-                                                  const pdat::CellData<double>& rhs_data,
-                                                  pdat::CellData<double>& soln_data,
-                                                  char red_or_black,
-                                                  double* p_maxres) const
-    {
-      TBOX_DIM_ASSERT_CHECK_DIM_ARGS4(d_dim, patch, flux_data, soln_data, rhs_data);
-      TBOX_ASSERT(red_or_black == 'r' || red_or_black == 'b');
-
-      const int offset = red_or_black == 'r' ? 0 : 1;
-      tbox::Pointer<geom::CartesianPatchGeometry> patch_geom =
-        patch.getPatchGeometry();
-      const hier::Box& box = patch.getBox();
-      const int* lower = &box.lower()[0];
-      const int* upper = &box.upper()[0];
-      const double* dx = patch_geom->getDx();
-
-      tbox::Pointer<pdat::CellData<double> > scalar_field_data;
-      double scalar_field_constant;
-      tbox::Pointer<pdat::SideData<double> > diffcoef_data;
-      double diffcoef_constant;
-
-      if (d_stokes_spec.cIsVariable()) {
-        scalar_field_data =
-          patch.getPatchData(d_stokes_spec.getCPatchDataId());
-      } else if (d_stokes_spec.cIsConstant()) {
-        scalar_field_constant = d_stokes_spec.getCConstant();
-      } else {
-        scalar_field_constant = 0.0;
-      }
-      if (d_stokes_spec.dIsVariable()) {
-        diffcoef_data = patch.getPatchData(d_stokes_spec.getDPatchDataId());
-      } else {
-        diffcoef_constant = d_stokes_spec.getDConstant();
-      }
-
-      double maxres = 0.0;
-      if (d_stokes_spec.dIsVariable() && d_stokes_spec.cIsVariable()) {
-        if (d_dim == tbox::Dimension(2)) {
-          F77_FUNC(rbgswithfluxmaxvardcvarsf2d, RBGSWITHFLUXMAXVARDCVARSF2D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              diffcoef_data->getPointer(0),
-                                                                              diffcoef_data->getPointer(1),
-                                                                              &diffcoef_data->getGhostCellWidth()[0],
-                                                                              &diffcoef_data->getGhostCellWidth()[1],
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              scalar_field_data->getPointer(),
-                                                                              &scalar_field_data->getGhostCellWidth()[0],
-                                                                              &scalar_field_data->getGhostCellWidth()[1],
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        } else if (d_dim == tbox::Dimension(3)) {
-          F77_FUNC(rbgswithfluxmaxvardcvarsf3d, RBGSWITHFLUXMAXVARDCVARSF3D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              flux_data.getPointer(2),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              &flux_data.getGhostCellWidth()[2],
-                                                                              diffcoef_data->getPointer(0),
-                                                                              diffcoef_data->getPointer(1),
-                                                                              diffcoef_data->getPointer(2),
-                                                                              &diffcoef_data->getGhostCellWidth()[0],
-                                                                              &diffcoef_data->getGhostCellWidth()[1],
-                                                                              &diffcoef_data->getGhostCellWidth()[2],
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              &rhs_data.getGhostCellWidth()[2],
-                                                                              scalar_field_data->getPointer(),
-                                                                              &scalar_field_data->getGhostCellWidth()[0],
-                                                                              &scalar_field_data->getGhostCellWidth()[1],
-                                                                              &scalar_field_data->getGhostCellWidth()[2],
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &soln_data.getGhostCellWidth()[2],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              &lower[2], &upper[2],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        }
-      } else if (d_stokes_spec.dIsVariable() && d_stokes_spec.cIsConstant()) {
-        if (d_dim == tbox::Dimension(2)) {
-          F77_FUNC(rbgswithfluxmaxvardcconsf2d, RBGSWITHFLUXMAXVARDCCONSF2D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              diffcoef_data->getPointer(0),
-                                                                              diffcoef_data->getPointer(1),
-                                                                              &diffcoef_data->getGhostCellWidth()[0],
-                                                                              &diffcoef_data->getGhostCellWidth()[1],
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              scalar_field_constant,
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        } else if (d_dim == tbox::Dimension(3)) {
-          F77_FUNC(rbgswithfluxmaxvardcconsf3d, RBGSWITHFLUXMAXVARDCCONSF3D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              flux_data.getPointer(2),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              &flux_data.getGhostCellWidth()[2],
-                                                                              diffcoef_data->getPointer(0),
-                                                                              diffcoef_data->getPointer(1),
-                                                                              diffcoef_data->getPointer(2),
-                                                                              &diffcoef_data->getGhostCellWidth()[0],
-                                                                              &diffcoef_data->getGhostCellWidth()[1],
-                                                                              &diffcoef_data->getGhostCellWidth()[2],
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              &rhs_data.getGhostCellWidth()[2],
-                                                                              scalar_field_constant,
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &soln_data.getGhostCellWidth()[2],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              &lower[2], &upper[2],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        }
-      } else if (d_stokes_spec.dIsVariable() && d_stokes_spec.cIsZero()) {
-        if (d_dim == tbox::Dimension(2)) {
-          F77_FUNC(rbgswithfluxmaxvardcconsf2d, RBGSWITHFLUXMAXVARDCCONSF2D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              diffcoef_data->getPointer(0),
-                                                                              diffcoef_data->getPointer(1),
-                                                                              &diffcoef_data->getGhostCellWidth()[0],
-                                                                              &diffcoef_data->getGhostCellWidth()[1],
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              0.0,
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        } else if (d_dim == tbox::Dimension(3)) {
-          F77_FUNC(rbgswithfluxmaxvardcconsf3d, RBGSWITHFLUXMAXVARDCCONSF3D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              flux_data.getPointer(2),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              &flux_data.getGhostCellWidth()[2],
-                                                                              diffcoef_data->getPointer(0),
-                                                                              diffcoef_data->getPointer(1),
-                                                                              diffcoef_data->getPointer(2),
-                                                                              &diffcoef_data->getGhostCellWidth()[0],
-                                                                              &diffcoef_data->getGhostCellWidth()[1],
-                                                                              &diffcoef_data->getGhostCellWidth()[2],
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              &rhs_data.getGhostCellWidth()[2],
-                                                                              0.0,
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &soln_data.getGhostCellWidth()[2],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              &lower[2], &upper[2],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        }
-      } else if (!d_stokes_spec.dIsVariable() && d_stokes_spec.cIsVariable()) {
-        if (d_dim == tbox::Dimension(2)) {
-          F77_FUNC(rbgswithfluxmaxcondcvarsf2d, RBGSWITHFLUXMAXCONDCVARSF2D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              diffcoef_constant,
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              scalar_field_data->getPointer(),
-                                                                              &scalar_field_data->getGhostCellWidth()[0],
-                                                                              &scalar_field_data->getGhostCellWidth()[1],
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        } else if (d_dim == tbox::Dimension(3)) {
-          F77_FUNC(rbgswithfluxmaxcondcvarsf3d, RBGSWITHFLUXMAXCONDCVARSF3D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              flux_data.getPointer(2),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              &flux_data.getGhostCellWidth()[2],
-                                                                              diffcoef_constant,
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              &rhs_data.getGhostCellWidth()[2],
-                                                                              scalar_field_data->getPointer(),
-                                                                              &scalar_field_data->getGhostCellWidth()[0],
-                                                                              &scalar_field_data->getGhostCellWidth()[1],
-                                                                              &scalar_field_data->getGhostCellWidth()[2],
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &soln_data.getGhostCellWidth()[2],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              &lower[2], &upper[2],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        }
-      } else if (!d_stokes_spec.dIsVariable() && d_stokes_spec.cIsConstant()) {
-        if (d_dim == tbox::Dimension(2)) {
-          F77_FUNC(rbgswithfluxmaxcondcconsf2d, RBGSWITHFLUXMAXCONDCCONSF2D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              diffcoef_constant,
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              scalar_field_constant,
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        } else if (d_dim == tbox::Dimension(3)) {
-          F77_FUNC(rbgswithfluxmaxcondcconsf3d, RBGSWITHFLUXMAXCONDCCONSF3D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              flux_data.getPointer(2),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              &flux_data.getGhostCellWidth()[2],
-                                                                              diffcoef_constant,
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              &rhs_data.getGhostCellWidth()[2],
-                                                                              scalar_field_constant,
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &soln_data.getGhostCellWidth()[2],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              &lower[2], &upper[2],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        }
-      } else if (!d_stokes_spec.dIsVariable() && d_stokes_spec.cIsZero()) {
-        if (d_dim == tbox::Dimension(2)) {
-          F77_FUNC(rbgswithfluxmaxcondcconsf2d, RBGSWITHFLUXMAXCONDCCONSF2D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              diffcoef_constant,
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              0.0,
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        } else if (d_dim == tbox::Dimension(3)) {
-          F77_FUNC(rbgswithfluxmaxcondcconsf3d, RBGSWITHFLUXMAXCONDCCONSF3D) (
-                                                                              flux_data.getPointer(0),
-                                                                              flux_data.getPointer(1),
-                                                                              flux_data.getPointer(2),
-                                                                              &flux_data.getGhostCellWidth()[0],
-                                                                              &flux_data.getGhostCellWidth()[1],
-                                                                              &flux_data.getGhostCellWidth()[2],
-                                                                              diffcoef_constant,
-                                                                              rhs_data.getPointer(),
-                                                                              &rhs_data.getGhostCellWidth()[0],
-                                                                              &rhs_data.getGhostCellWidth()[1],
-                                                                              &rhs_data.getGhostCellWidth()[2],
-                                                                              0.0,
-                                                                              soln_data.getPointer(),
-                                                                              &soln_data.getGhostCellWidth()[0],
-                                                                              &soln_data.getGhostCellWidth()[1],
-                                                                              &soln_data.getGhostCellWidth()[2],
-                                                                              &lower[0], &upper[0],
-                                                                              &lower[1], &upper[1],
-                                                                              &lower[2], &upper[2],
-                                                                              dx,
-                                                                              &offset, &maxres);
-        }
-      }
-
-      *p_maxres = maxres;
-    }
-
-  }
-}
diff -r 4c5d30cbc5d4 -r 99b1a4090021 StokesFACOps/relax.C
--- a/StokesFACOps/relax.C	Thu Jan 06 19:34:12 2011 -0800
+++ b/StokesFACOps/relax.C	Thu Jan 06 19:36:35 2011 -0800
@@ -40,6 +40,8 @@
 #include "SAMRAI/xfer/RefineSchedule.h"
 #include "SAMRAI/xfer/PatchLevelFullFillPattern.h"
 
+#include <unistd.h>
+
 /*
 ********************************************************************
 * Workhorse function to smooth error using red-black               *
@@ -65,9 +67,6 @@ void SAMRAI::solv::StokesFACOps::relax(S
   }
 #endif
   tbox::Pointer<hier::PatchLevel> level = d_hierarchy->getPatchLevel(ln);
-
-  // xeqScheduleGhostFillNoCoarse(data.getComponentDescriptorIndex(p_id), ln);
-  // xeqScheduleGhostFillNoCoarse(data.getComponentDescriptorIndex(v_id), ln);
 
   // if (ln > d_ln_min) {
   //   /*
@@ -102,6 +101,7 @@ void SAMRAI::solv::StokesFACOps::relax(S
     for(int rb=0;rb<2;++rb)
       {
         // Need to sync
+        tbox::plog << "syncing\n";
         xeqScheduleGhostFillNoCoarse(p_id,v_id,ln);
         for (hier::PatchLevel::Iterator pi(*level); pi; pi++) {
           tbox::Pointer<hier::Patch> patch = *pi;
@@ -121,188 +121,273 @@ void SAMRAI::solv::StokesFACOps::relax(S
           double dx = *(geom->getDx());
           double dy = *(geom->getDx());
 
-          for (pdat::CellIterator ic(pbox); ic; ic++)
+          for(int j=pbox.lower(1); j<=pbox.upper(1)+1; ++j)
             {
-              pdat::CellIndex center = ic();
               /* Do the red-black skip */
-              while((center[0]+center[1]+rb)%2!=0)
+              int i_min=pbox.lower(0) + (abs(pbox.lower(0) + j + rb))%2;
+              for(int i=i_min; i<=pbox.upper(0)+1; i+=2)
                 {
-                  ic++;
-                  if(!ic)
-                    break;
-                  center=ic();
-                }
-              if(!ic)
-                break;
+                  pdat::CellIndex center(tbox::Dimension(2));
+                  center[0]=i;
+                  center[1]=j;
 
-              pdat::CellIndex up(center), down(center), right(center),
-                left(center);
+                  pdat::CellIndex up(center), down(center), right(center),
+                    left(center);
 
-              ++up[1];
-              --down[1];
-              ++right[0];
-              --left[0];
+                  ++up[1];
+                  --down[1];
+                  ++right[0];
+                  --left[0];
 
-              /* Update p */
 
-              double dvx_dx=
-                ((*v)(pdat::SideIndex(center,pdat::SideIndex::X,
-                                      pdat::SideIndex::Upper))
-                 - (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
-                                        pdat::SideIndex::Lower)))/dx;
-              double dvy_dy=
-                ((*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                      pdat::SideIndex::Upper))
-                 - (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                        pdat::SideIndex::Lower)))/dy;
+                  // if(pbox.lower(1)>15)
+                  //   {
+                  //     pdat::SideIndex
+                  //       ttmp(pdat::SideIndex(center,pdat::SideIndex::X,
+                  //                            pdat::SideIndex::Lower));
+                  //     ttmp[0]=16;
+                  //     ttmp[1]=17;
+                  //     tbox::plog << "relax "
+                  //                << isweep << " "
+                  //                << rb << " "
+                  //                << center[0] << " "
+                  //                << center[1] << " "
+                  //                << pbox.lower(0) << " "
+                  //                << pbox.lower(1) << " "
+                  //                << pbox.upper(0) << " "
+                  //                << pbox.upper(1) << " "
+                  //                << (*v)(ttmp) << " "
+                  //                << &((*v)(ttmp)) << " "
+                  //                << "\n";
+                  //   }
 
-              double delta_R_continuity=(*p_rhs)(center) - dvx_dx - dvy_dy;
 
-              (*p)(center)+=viscosity*delta_R_continuity*theta_continuity;
 
-              /* Update vx */
-              /* If x==0 */
-              if(center[0]==pbox.lower(0)
-                 && geom->getTouchesRegularBoundary(0,0))
-                {
-                  (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
-                                       pdat::SideIndex::Lower))=0;
-                }
-              else
-                {
-                  double dp_dx, d2vx_dxx, d2vx_dyy, C_vx;
-                  /* If y==0 */
-                  if(center[1]==pbox.lower(1)
-                     && geom->getTouchesRegularBoundary(1,0))
+                  // tbox::plog << "relax "
+                  //            << isweep << " "
+                  //            << rb << " "
+                  //            << center[0] << " "
+                  //            << center[1] << " "
+                  //            << pbox.lower(0) << " "
+                  //            << pbox.lower(1) << " "
+                  //            << pbox.upper(0) << " "
+                  //            << pbox.upper(1) << " "
+                  //            << (*p)(center) << " "
+                  //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                  //                                    pdat::SideIndex::Lower)) << " "
+                  //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                  //                                    pdat::SideIndex::Upper)) << " "
+                  //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                  //                                    pdat::SideIndex::Lower)) << " "
+                  //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                  //                                    pdat::SideIndex::Upper))
+                  //            << " ";
+
+                  /* Update p */
+
+                  if(i!=pbox.upper(0)+1 && j!=pbox.upper(1)+1)
                     {
-                      d2vx_dyy=
-                        ((*v)(pdat::SideIndex(up,pdat::SideIndex::X,
-                                              pdat::SideIndex::Lower))
+                      double dvx_dx=
+                        ((*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                                              pdat::SideIndex::Upper))
                          - (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
-                                                pdat::SideIndex::Lower)))
-                        /(dy*dy);
-                      C_vx=-viscosity*(2/(dx*dx) + 1/(dy*dy));
+                                                pdat::SideIndex::Lower)))/dx;
+                      double dvy_dy=
+                        ((*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                                              pdat::SideIndex::Upper))
+                         - (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                                                pdat::SideIndex::Lower)))/dy;
+
+                      double delta_R_continuity=
+                        (*p_rhs)(center) - dvx_dx - dvy_dy;
+
+                      (*p)(center)+=
+                        viscosity*delta_R_continuity*theta_continuity;
                     }
-                  /* If y==max_y */
-                  else if(center[1]==pbox.upper(1)
-                          && geom->getTouchesRegularBoundary(1,1))
+
+                  /* Update vx */
+                  if(j!=pbox.upper(1)+1)
                     {
-                      d2vx_dyy=
-                        (-(*v)(pdat::SideIndex(center,pdat::SideIndex::X,
-                                               pdat::SideIndex::Lower))
-                         + (*v)(pdat::SideIndex(down,pdat::SideIndex::X,
-                                                pdat::SideIndex::Lower)))
-                        /(dy*dy);
-                      C_vx=-viscosity*(2/(dx*dx) + 1/(dy*dy));
+                      /* If x==0 */
+                      if((center[0]==pbox.lower(0)
+                          && geom->getTouchesRegularBoundary(0,0))
+                         || (center[0]==pbox.upper(0)+1
+                             && geom->getTouchesRegularBoundary(0,1)))
+                        {
+                          (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                                               pdat::SideIndex::Lower))=0;
+
+                          // tbox::plog << "vx x0 boundary ";
+                        }
+                      else
+                        {
+                          double dp_dx, d2vx_dxx, d2vx_dyy, C_vx;
+                          /* If y==0 */
+                          if(center[1]==pbox.lower(1)
+                             && geom->getTouchesRegularBoundary(1,0))
+                            {
+                              d2vx_dyy=
+                                ((*v)(pdat::SideIndex(up,pdat::SideIndex::X,
+                                                      pdat::SideIndex::Lower))
+                                 - (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                                                        pdat::SideIndex::Lower)))
+                                /(dy*dy);
+                              C_vx=-viscosity*(2/(dx*dx) + 1/(dy*dy));
+                              // tbox::plog << "vx y0 boundary ";
+                            }
+                          /* If y==max_y */
+                          else if(center[1]==pbox.upper(1)
+                                  && geom->getTouchesRegularBoundary(1,1))
+                            {
+                              d2vx_dyy=
+                                (-(*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                                                       pdat::SideIndex::Lower))
+                                 + (*v)(pdat::SideIndex(down,pdat::SideIndex::X,
+                                                        pdat::SideIndex::Lower)))
+                                /(dy*dy);
+                              C_vx=-viscosity*(2/(dx*dx) + 1/(dy*dy));
+                              // tbox::plog << "vx y1 boundary ";
+                            }
+                          else
+                            {
+                              d2vx_dyy=
+                                ((*v)(pdat::SideIndex(up,pdat::SideIndex::X,
+                                                      pdat::SideIndex::Lower))
+                                 - 2*(*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                                                          pdat::SideIndex::Lower))
+                                 + (*v)(pdat::SideIndex(down,pdat::SideIndex::X,
+                                                        pdat::SideIndex::Lower)))
+                                /(dy*dy);
+
+                              C_vx=-2*viscosity*(1/(dx*dx) + 1/(dy*dy));
+                              // tbox::plog << "vx "
+                              //            << (pdat::SideIndex(up,pdat::SideIndex::X,
+                              //                                pdat::SideIndex::Lower))[0] << " "
+                              //            << (pdat::SideIndex(up,pdat::SideIndex::X,
+                              //                                pdat::SideIndex::Lower))[1] << " "
+                              //            << (pdat::SideIndex(center,pdat::SideIndex::X,
+                              //                                pdat::SideIndex::Lower))[0] << " "
+                              //            << (pdat::SideIndex(center,pdat::SideIndex::X,
+                              //                                pdat::SideIndex::Lower))[1] << " "
+                              //            << (pdat::SideIndex(down,pdat::SideIndex::X,
+                              //                                pdat::SideIndex::Lower))[0] << " "
+                              //            << (pdat::SideIndex(down,pdat::SideIndex::X,
+                              //                                pdat::SideIndex::Lower))[1] << " "
+
+                              //            << (*v)(pdat::SideIndex(up,pdat::SideIndex::X,
+                              //                                    pdat::SideIndex::Lower)) << " "
+                              //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                              //                                    pdat::SideIndex::Lower)) << " "
+                              //            << (*v)(pdat::SideIndex(down,pdat::SideIndex::X,
+                              //                                    pdat::SideIndex::Lower)) << " ";
+
+                            }
+                          d2vx_dxx=((*v)(pdat::SideIndex(left,pdat::SideIndex::X,
+                                                         pdat::SideIndex::Lower))
+                                    - 2*(*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                                                             pdat::SideIndex::Lower))
+                                    + (*v)(pdat::SideIndex(right,pdat::SideIndex::X,
+                                                           pdat::SideIndex::Lower)))
+                            /(dx*dx);
+
+                          dp_dx=((*p)(center)-(*p)(left))/dx;
+                              
+                          double delta_Rx=
+                            (*v_rhs)(pdat::SideIndex(center,pdat::SideIndex::X,pdat::SideIndex::Lower))
+                            - viscosity*(d2vx_dxx + d2vx_dyy) + dp_dx;
+                          (*v)(pdat::SideIndex(center,pdat::SideIndex::X,pdat::SideIndex::Lower))+=
+                            delta_Rx*theta_momentum/C_vx;
+
+                          // tbox::plog << d2vx_dxx << " "
+                          //            << d2vx_dyy << " "
+                          //            << dp_dx << " "
+                          //            << delta_Rx << " ";
+                        }
                     }
-                  else
+
+                  /* Update vy */
+                  if(i!=pbox.upper(0)+1)
                     {
-                      d2vx_dyy=
-                        ((*v)(pdat::SideIndex(up,pdat::SideIndex::X,
-                                              pdat::SideIndex::Lower))
-                         - 2*(*v)(pdat::SideIndex(center,pdat::SideIndex::X,
-                                                  pdat::SideIndex::Lower))
-                         + (*v)(pdat::SideIndex(down,pdat::SideIndex::X,
-                                                pdat::SideIndex::Lower)))
-                        /(dy*dy);
+                      /* If y==0 */
+                      if((center[1]==pbox.lower(1)
+                          && geom->getTouchesRegularBoundary(1,0))
+                         || (center[1]==pbox.upper(1)+1
+                             && geom->getTouchesRegularBoundary(1,1)))
+                        {
+                          (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                                               pdat::SideIndex::Lower))=0;
+                        }
+                      else
+                        {
+                          double dp_dy, d2vy_dxx, d2vy_dyy, C_vy;
+                          /* If x==0 */
+                          if(center[0]==pbox.lower(0)
+                             && geom->getTouchesRegularBoundary(0,0))
+                            {
+                              d2vy_dxx=
+                                ((*v)(pdat::SideIndex(right,pdat::SideIndex::Y,
+                                                      pdat::SideIndex::Lower))
+                                 - (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                                                        pdat::SideIndex::Lower)))
+                                /(dx*dx);
+                              C_vy=-viscosity*(1/(dx*dx) + 2/(dy*dy));
+                            }
+                          /* If x==max_x */
+                          else if(center[0]==pbox.upper(0)
+                                  && geom->getTouchesRegularBoundary(0,1))
+                            {
+                              d2vy_dxx=
+                                ((*v)(pdat::SideIndex(left,pdat::SideIndex::Y,
+                                                      pdat::SideIndex::Lower))
+                                 - (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                                                        pdat::SideIndex::Lower)))
+                                /(dx*dx);
+                              C_vy=-viscosity*(1/(dx*dx) + 2/(dy*dy));
+                            }
+                          else
+                            {
+                              d2vy_dxx=
+                                ((*v)(pdat::SideIndex(left,pdat::SideIndex::Y,
+                                                      pdat::SideIndex::Lower))
+                                 - 2*(*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                                                          pdat::SideIndex::Lower))
+                                 + (*v)(pdat::SideIndex(right,pdat::SideIndex::Y,
+                                                        pdat::SideIndex::Lower)))
+                                /(dx*dx);
 
-                      C_vx=-2*viscosity*(1/(dx*dx) + 1/(dy*dy));
+                              C_vy=-2*viscosity*(1/(dx*dx) + 1/(dy*dy));
+                            }
+                          d2vy_dyy=((*v)(pdat::SideIndex(up,pdat::SideIndex::Y,
+                                                         pdat::SideIndex::Lower))
+                                    - 2*(*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                                                             pdat::SideIndex::Lower))
+                                    + (*v)(pdat::SideIndex(down,pdat::SideIndex::Y,
+                                                           pdat::SideIndex::Lower)))
+                            /(dy*dy);
+
+                          dp_dy=((*p)(center)-(*p)(down))/dy;
+                              
+                          double delta_Ry=
+                            (*v_rhs)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                                                     pdat::SideIndex::Lower))
+                            - viscosity*(d2vy_dxx + d2vy_dyy) + dp_dy;
+                          (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                                               pdat::SideIndex::Lower))+=
+                            delta_Ry*theta_momentum/C_vy;
+                        }
+
+                      // tbox::plog << (*p)(center) << " "
+                      //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                      //                                    pdat::SideIndex::Lower)) << " "
+                      //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::X,
+                      //                                    pdat::SideIndex::Upper)) << " "
+                      //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                      //                                    pdat::SideIndex::Lower)) << " "
+                      //            << (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
+                      //                                    pdat::SideIndex::Upper)) << " "
+                      //            << "\n";
+
                     }
-                  d2vx_dxx=((*v)(pdat::SideIndex(left,pdat::SideIndex::X,
-                                                 pdat::SideIndex::Lower))
-                            - 2*(*v)(pdat::SideIndex(center,pdat::SideIndex::X,
-                                                     pdat::SideIndex::Lower))
-                            + (*v)(pdat::SideIndex(right,pdat::SideIndex::X,
-                                                   pdat::SideIndex::Lower)))
-                    /(dx*dx);
-
-                  dp_dx=((*p)(center)-(*p)(left))/dx;
-                              
-                  double delta_Rx=
-                    (*v_rhs)(pdat::SideIndex(center,pdat::SideIndex::X,pdat::SideIndex::Lower))
-                    - viscosity*(d2vx_dxx + d2vx_dyy) + dp_dx;
-                  (*v)(pdat::SideIndex(center,pdat::SideIndex::X,pdat::SideIndex::Lower))+=
-                    delta_Rx*theta_momentum/C_vx;
-                }
-              /* If x==max_x */
-              if(center[0]==pbox.upper(0)
-                 && geom->getTouchesRegularBoundary(0,1))
-                {
-                  (*v)(pdat::SideIndex(center,pdat::SideIndex::X,pdat::SideIndex::Upper))=0;
-                }
-
-              /* Update vy */
-              /* If y==0 */
-              if(center[1]==pbox.lower(1)
-                 && geom->getTouchesRegularBoundary(1,0))
-                {
-                  (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                       pdat::SideIndex::Lower))=0;
-                }
-              else
-                {
-                  double dp_dy, d2vy_dxx, d2vy_dyy, C_vy;
-                  /* If x==0 */
-                  if(center[0]==pbox.lower(0)
-                     && geom->getTouchesRegularBoundary(0,0))
-                    {
-                      d2vy_dxx=
-                        ((*v)(pdat::SideIndex(right,pdat::SideIndex::Y,
-                                               pdat::SideIndex::Lower))
-                         - (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                             pdat::SideIndex::Lower)))
-                        /(dx*dx);
-                      C_vy=-viscosity*(1/(dx*dx) + 2/(dy*dy));
-                    }
-                  /* If x==max_x */
-                  else if(center[0]==pbox.upper(0)
-                          && geom->getTouchesRegularBoundary(0,1))
-                    {
-                      d2vy_dxx=
-                        ((*v)(pdat::SideIndex(left,pdat::SideIndex::Y,
-                                            pdat::SideIndex::Lower))
-                         - (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                             pdat::SideIndex::Lower)))
-                        /(dx*dx);
-                      C_vy=-viscosity*(1/(dx*dx) + 2/(dy*dy));
-                    }
-                  else
-                    {
-                      d2vy_dxx=
-                        ((*v)(pdat::SideIndex(left,pdat::SideIndex::Y,
-                                            pdat::SideIndex::Lower))
-                         - 2*(*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                               pdat::SideIndex::Lower))
-                         + (*v)(pdat::SideIndex(right,pdat::SideIndex::Y,
-                                             pdat::SideIndex::Lower)))
-                        /(dx*dx);
-
-                      C_vy=-2*viscosity*(1/(dx*dx) + 1/(dy*dy));
-                    }
-                  d2vy_dyy=((*v)(pdat::SideIndex(up,pdat::SideIndex::Y,
-                                                 pdat::SideIndex::Lower))
-                            - 2*(*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                                     pdat::SideIndex::Lower))
-                            + (*v)(pdat::SideIndex(down,pdat::SideIndex::Y,
-                                                   pdat::SideIndex::Lower)))
-                    /(dy*dy);
-
-                  dp_dy=((*p)(center)-(*p)(down))/dy;
-                              
-                  double delta_Ry=
-                    (*v_rhs)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                             pdat::SideIndex::Lower))
-                    - viscosity*(d2vy_dxx + d2vy_dyy) + dp_dy;
-                  (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                       pdat::SideIndex::Lower))+=
-                    delta_Ry*theta_momentum/C_vy;
-                }
-              /* If y==max_y */
-              if(center[1]==pbox.upper(1)
-                 && geom->getTouchesRegularBoundary(1,1))
-                {
-                  (*v)(pdat::SideIndex(center,pdat::SideIndex::Y,
-                                       pdat::SideIndex::Upper))=0;
                 }
             }
         }
diff -r 4c5d30cbc5d4 -r 99b1a4090021 StokesFACSolver/initializeSolverState.C
--- a/StokesFACSolver/initializeSolverState.C	Thu Jan 06 19:34:12 2011 -0800
+++ b/StokesFACSolver/initializeSolverState.C	Thu Jan 06 19:36:35 2011 -0800
@@ -89,8 +89,6 @@ namespace SAMRAI {
                                      s_weight_id[d_dim.getValue() - 1],
                                      d_ln_min,
                                      d_ln_max);
-      d_fac_ops.set_p_v(p,v);
-
 
       if (d_bc_object == &d_simple_bc) {
         d_simple_bc.setHierarchy(d_hierarchy,



More information about the CIG-COMMITS mailing list