[cig-commits] commit: fix the adaptive criterion for the boundary.

Mercurial hg at geodynamics.org
Thu Jun 7 13:35:40 PDT 2012


changeset:   259:970b2637b218
user:        Sylvain Barbot <sbarbot at caltech.edu>
date:        Wed Apr 11 15:13:42 2012 -0700
files:       input/sinker.input src/FACStokes/applyGradientDetector.C
description:
fix the adaptive criterion for the boundary.


diff -r 39366675b6ee -r 970b2637b218 input/sinker.input
--- a/input/sinker.input	Tue Apr 10 16:52:35 2012 -0700
+++ b/input/sinker.input	Wed Apr 11 15:13:42 2012 -0700
@@ -28,7 +28,7 @@ FACStokes {
     // It owns the solver and contains the code to set up the solver.
     // The inputs for FACStokes is simply the inputs for the individual
     // parts owned by the FACStokes class.
-    adaption_threshold = 1.0e-2
+    adaption_threshold = 1.0e-1
     min_full_refinement_level = 3
 
     lambda_ijk= 2, 2
@@ -191,7 +191,7 @@ PatchHierarchy {
     //              [level 0 entry]
     //   etc....                       
     // }
-    max_levels = 6
+    max_levels = 5
     proper_nesting_buffer = 2, 2, 2, 2, 2, 2
     ratio_to_coarser {
         level_1            = 2, 2
diff -r 39366675b6ee -r 970b2637b218 src/FACStokes/applyGradientDetector.C
--- a/src/FACStokes/applyGradientDetector.C	Tue Apr 10 16:52:35 2012 -0700
+++ b/src/FACStokes/applyGradientDetector.C	Wed Apr 11 15:13:42 2012 -0700
@@ -47,6 +47,8 @@ void SAMRAI::FACStokes::applyGradientDet
       pdat::SideData<double>& v = *soln_side_data_;
       pdat::CellData<int>& tag_cell_data = *tag_cell_data_;
                               
+      tbox::Pointer<geom::CartesianPatchGeometry> geom = patch.getPatchGeometry();
+
       tag_cell_data.fill(0);
       for (pdat::CellIterator ci(patch.getBox()); ci; ci++)
         {
@@ -60,10 +62,23 @@ void SAMRAI::FACStokes::applyGradientDet
               const hier::Index ip(1,0), jp(0,1);
               const hier::Index pp[]={ip,jp};
 
+              if(cell_index[ix]==patch.getBox().lower(ix)
+                 && geom->getTouchesRegularBoundary(ix,0))
+	      {
+	      curve=std::max(curve,std::abs(v(x+pp[ix]+pp[ix])-2*v(x+pp[ix])+v(x)));
+	      } else if(cell_index[ix]==patch.getBox().upper(ix)
+                 && geom->getTouchesRegularBoundary(ix,1))
+	      {
+	      curve=std::max(curve,std::abs(v(x+pp[ix])-2*v(x)+v(x-pp[ix])));
+	      }
+	      else
+	      {
 	      curve=std::max(curve,std::abs(v(x+pp[ix]+pp[ix])-v(x+pp[ix])-v(x)+v(x-pp[ix])));
+	      }
 	    }
 	  }
-          tbox::plog << "estimate "
+          /*
+	   * tbox::plog << "estimate "
                      << cell_index << " "
                      << d_adaption_threshold << " "
                      << curve << " "
@@ -71,6 +86,7 @@ void SAMRAI::FACStokes::applyGradientDet
                      << (curve > d_adaption_threshold)
                      << " "
                      << "\n";
+		     */
 
           if (maxestimate < curve)
                maxestimate=curve;



More information about the CIG-COMMITS mailing list