[cig-commits] commit: Set up a linear gradient for the pressure initial guess

Mercurial hg at geodynamics.org
Wed Apr 27 20:54:54 PDT 2011


changeset:   219:2d6328e26891
tag:         tip
user:        Walter Landry <wlandry at caltech.edu>
date:        Wed Apr 27 20:53:38 2011 -0700
files:       src/FACStokes/solveStokes.C
description:
Set up a linear gradient for the pressure initial guess


diff -r 1cf36349d166 -r 2d6328e26891 src/FACStokes/solveStokes.C
--- a/src/FACStokes/solveStokes.C	Wed Apr 27 01:38:11 2011 -0700
+++ b/src/FACStokes/solveStokes.C	Wed Apr 27 20:53:38 2011 -0700
@@ -46,7 +46,19 @@ int SAMRAI::FACStokes::solveStokes()
       tbox::Pointer<hier::Patch> patch = *ip;
       tbox::Pointer<pdat::CellData<double> >
         p = patch->getPatchData(p_id);
-      p->fill(0.0);
+
+      tbox::Pointer<geom::CartesianPatchGeometry>
+        geom = patch->getPatchGeometry();
+      hier::Box pbox = p->getBox();
+      for(pdat::CellIterator ci(p->getGhostBox()); ci; ci++)
+        {
+          pdat::CellIndex c=ci();
+          double y=geom->getXLower()[1]
+            + geom->getDx()[1]*(c[1]-pbox.lower()[1] + 0.5);
+          (*p)(c)=-y;
+        }
+      // p->fill(0.0);
+
       tbox::Pointer<pdat::SideData<double> >
         v = patch->getPatchData(v_id);
       v->fill(0.0);



More information about the CIG-COMMITS mailing list