[cig-commits] commit: Make the p and v prolong operators read in properly from input file.

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


changeset:   49:bd73db81aabc
user:        Walter Landry <wlandry at caltech.edu>
date:        Wed Jan 12 15:58:58 2011 -0800
files:       StokesFACOps.I StokesFACOps.h StokesFACSolver.I StokesFACSolver.h StokesFACSolver/StokesFACSolver.C StokesFACSolver/getFromInput.C example_inputs/const_refine.2d.input
description:
Make the p and v prolong operators read in properly from input file.


diff -r 13bda96c5b6d -r bd73db81aabc StokesFACOps.I
--- a/StokesFACOps.I	Tue Jan 11 22:31:43 2011 -0800
+++ b/StokesFACOps.I	Wed Jan 12 15:58:58 2011 -0800
@@ -195,18 +195,32 @@ void StokesFACOps::setCoarseFineDiscreti
  */
 
 SAMRAI_INLINE_KEYWORD
-void StokesFACOps::setProlongationMethod(
+void StokesFACOps::set_P_ProlongationMethod(
    const std::string& prolongation_method) {
 #ifdef DEBUG_CHECK_ASSERTIONS
    if (d_hierarchy) {
       TBOX_ERROR(
-         d_object_name << ": Cannot change prolongation method\n"
+         d_object_name << ": Cannot change p prolongation method\n"
          <<
          "while operator state is initialized because that\n"
          << "causes a corruption in the state.\n");
    }
 #endif
    p_prolongation_method = prolongation_method;
+}
+
+SAMRAI_INLINE_KEYWORD
+void StokesFACOps::set_V_ProlongationMethod(
+   const std::string& prolongation_method) {
+#ifdef DEBUG_CHECK_ASSERTIONS
+   if (d_hierarchy) {
+      TBOX_ERROR(
+         d_object_name << ": Cannot change v prolongation method\n"
+         <<
+         "while operator state is initialized because that\n"
+         << "causes a corruption in the state.\n");
+   }
+#endif
    v_prolongation_method = prolongation_method;
 }
 
diff -r 13bda96c5b6d -r bd73db81aabc StokesFACOps.h
--- a/StokesFACOps.h	Tue Jan 11 22:31:43 2011 -0800
+++ b/StokesFACOps.h	Wed Jan 12 15:58:58 2011 -0800
@@ -109,7 +109,7 @@ namespace solv {
  * coarse_solver_max_iterations = 10 // see setCoarsestLevelSolverMaxIterations()
  * smoothing_choice = "redblack"     // see setSmoothingChoice()
  * cf_discretization = "Ewing"       // see setCoarseFineDiscretization()
- * prolongation_method = "LINEAR_REFINE" // see setProlongationMethod()
+ * prolongation_method = "P_REFINE" // see setProlongationMethod()
  * hypre_solver = { ... }            // tbox::Database for initializing Hypre solver
  * @endverbatim
  */
@@ -247,7 +247,11 @@ public:
     *        discretization method.
     */
    void
-   setProlongationMethod(
+   set_P_ProlongationMethod(
+      const std::string& prolongation_method);
+
+   void
+   set_V_ProlongationMethod(
       const std::string& prolongation_method);
 
 #ifdef HAVE_HYPRE
diff -r 13bda96c5b6d -r bd73db81aabc StokesFACSolver.I
--- a/StokesFACSolver.I	Tue Jan 11 22:31:43 2011 -0800
+++ b/StokesFACSolver.I	Wed Jan 12 15:58:58 2011 -0800
@@ -43,10 +43,17 @@ void StokesFACSolver::setCConstant(
 }
 
 SAMRAI_INLINE_KEYWORD
-void StokesFACSolver::setProlongationMethod(
-   const std::string& prolongation_method)
+void StokesFACSolver::set_P_ProlongationMethod(
+   const std::string& p_prolongation_method)
 {
-   d_fac_ops.setProlongationMethod(prolongation_method);
+   d_fac_ops.set_P_ProlongationMethod(p_prolongation_method);
+}
+
+SAMRAI_INLINE_KEYWORD
+void StokesFACSolver::set_V_ProlongationMethod(
+   const std::string& v_prolongation_method)
+{
+   d_fac_ops.set_V_ProlongationMethod(v_prolongation_method);
 }
 
 SAMRAI_INLINE_KEYWORD
diff -r 13bda96c5b6d -r bd73db81aabc StokesFACSolver.h
--- a/StokesFACSolver.h	Tue Jan 11 22:31:43 2011 -0800
+++ b/StokesFACSolver.h	Wed Jan 12 15:58:58 2011 -0800
@@ -422,7 +422,11 @@ public:
     * @param prolongation_method String selecting the coarse-fine discretization method.
     */
    void
-   setProlongationMethod(
+   set_P_ProlongationMethod(
+      const std::string& prolongation_method);
+
+   void
+   set_V_ProlongationMethod(
       const std::string& prolongation_method);
 
    /*!
diff -r 13bda96c5b6d -r bd73db81aabc StokesFACSolver/StokesFACSolver.C
--- a/StokesFACSolver/StokesFACSolver.C	Tue Jan 11 22:31:43 2011 -0800
+++ b/StokesFACSolver/StokesFACSolver.C	Wed Jan 12 15:58:58 2011 -0800
@@ -92,7 +92,7 @@ namespace SAMRAI {
 // #else
       setCoarsestLevelSolverChoice("redblack");
       setCoarsestLevelSolverTolerance(1e-8);
-      setCoarsestLevelSolverMaxIterations(500);
+      setCoarsestLevelSolverMaxIterations(10);
 // #endif
 
       /*
diff -r 13bda96c5b6d -r bd73db81aabc StokesFACSolver/getFromInput.C
--- a/StokesFACSolver/getFromInput.C	Tue Jan 11 22:31:43 2011 -0800
+++ b/StokesFACSolver/getFromInput.C	Wed Jan 12 15:58:58 2011 -0800
@@ -62,9 +62,13 @@ namespace SAMRAI {
           std::string s = database->getString("coarse_fine_discretization");
           setCoarseFineDiscretization(s);
         }
-        if (database->isString("prolongation_method")) {
-          std::string s = database->getString("prolongation_method");
-          setProlongationMethod(s);
+        if (database->isString("p_prolongation_method")) {
+          std::string s = database->getString("p_prolongation_method");
+          set_P_ProlongationMethod(s);
+        }
+        if (database->isString("v_prolongation_method")) {
+          std::string s = database->getString("v_prolongation_method");
+          set_V_ProlongationMethod(s);
         }
         if (database->isString("coarse_solver_choice")) {
           std::string s = database->getString("coarse_solver_choice");
diff -r 13bda96c5b6d -r bd73db81aabc example_inputs/const_refine.2d.input
--- a/example_inputs/const_refine.2d.input	Tue Jan 11 22:31:43 2011 -0800
+++ b/example_inputs/const_refine.2d.input	Wed Jan 12 15:58:58 2011 -0800
@@ -34,14 +34,14 @@ FACStokes {
     enable_logging = TRUE   // Bool flag to switch logging on/off
     max_cycles = 20         // Max number of FAC cycles to use
     residual_tol = 1e-8     // Residual tolerance to solve for
-    num_pre_sweeps = 0      // Number of presmoothing sweeps to use
+    num_pre_sweeps = 5      // Number of presmoothing sweeps to use
     num_post_sweeps = 5     // Number of postsmoothing sweeps to use
     p_prolongation_method = "P_REFINE" // Type of refinement
       					  // used in prolongation.
                                           // Suggested values are
                                           // "LINEAR_REFINE"
                                           // "CONSTANT_REFINE"
-    v_prolongation_method = "CONSERVATIVE_LINEAR_REFINE" // Type of refinement
+    v_prolongation_method = "V_REFINE" // Type of refinement
       					  // used in prolongation.
                                           // Suggested values are
                                           // "LINEAR_REFINE"
@@ -84,7 +84,7 @@ CartesianGridGeometry {
   //                        domain is periodic.  Zero indicates not
   //                        periodic, non-zero value indicates periodicity.
   //                        [0]
-  domain_boxes = [(0,0), (7,7)]
+  domain_boxes = [(0,0), (3,3)]
   x_lo         = 0, 0
   x_up         = 1, 1
 }
@@ -92,9 +92,10 @@ StandardTagAndInitialize {
 StandardTagAndInitialize {
   tagging_method = "REFINE_BOXES"
   RefineBoxes {
-    level_0 = [(0,0),(7,7)]
-    level_1 = [(0,0),(15,15)]
-    level_2 = [(0,0),(31,31)]
+    level_0 = [(0,0),(3,3)]
+    level_1 = [(0,0),(7,7)]
+    level_2 = [(0,0),(15,15)]
+    level_3 = [(0,0),(31,31)]
     //etc.
   }
 }
@@ -125,7 +126,7 @@ PatchHierarchy {
    //              [level 0 entry]
    //   etc....                       
    // }
-   max_levels = 3
+   max_levels = 4
    ratio_to_coarser {
       level_1            = 2, 2
       level_2            = 2, 2



More information about the CIG-COMMITS mailing list