[cig-commits] [commit] master: Replay Joey Durkin's second set of changes. (b9ccc15)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Aug 4 14:45:24 PDT 2014


Repository : https://github.com/geodynamics/aspect

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/3811725812cafa918bbabc2515f52af7857aad31...9a8086507e7ed22ed2a4d13771930e4ae6bc3a7d

>---------------------------------------------------------------

commit b9ccc150103d1dd40399ff424d004cec32226cfe
Author: Wolfgang Bangerth <bangerth at math.tamu.edu>
Date:   Thu Jul 24 16:41:00 2014 -0500

    Replay Joey Durkin's second set of changes.
    
    Something had gone wrong with these patches and they ended up deleting and re-creating a lot of files. This commit simply applies all functional changes that were part of the commit gone wrong.


>---------------------------------------------------------------

b9ccc150103d1dd40399ff424d004cec32226cfe
 include/aspect/geometry_model/spherical_shell.h    |  5 ++--
 .../aspect/initial_conditions/spherical_shell.h    | 15 ++++++++--
 source/geometry_model/spherical_shell.cc           |  8 +++---
 source/initial_conditions/spherical_shell.cc       | 33 ++++++----------------
 4 files changed, 28 insertions(+), 33 deletions(-)

diff --git a/include/aspect/geometry_model/spherical_shell.h b/include/aspect/geometry_model/spherical_shell.h
index 1d55cb5..c4af9c7 100644
--- a/include/aspect/geometry_model/spherical_shell.h
+++ b/include/aspect/geometry_model/spherical_shell.h
@@ -134,10 +134,9 @@ namespace aspect
         double phi;
 
         /**
-         * Number of tangential mesh cells when the initial global 
-         * refinement is set to zero.
+         * Number of tangential mesh cells in the initial, coarse mesh.
          */
-         int cell_count;
+         int n_cells_along_circumference;
 
     };
   }
diff --git a/include/aspect/initial_conditions/spherical_shell.h b/include/aspect/initial_conditions/spherical_shell.h
index 0b0405d..08be7fc 100644
--- a/include/aspect/initial_conditions/spherical_shell.h
+++ b/include/aspect/initial_conditions/spherical_shell.h
@@ -63,7 +63,19 @@ namespace aspect
         double initial_temperature (const Point<dim> &position) const;
      
       private:
-        int lemniscate_number; 
+         /**
+         *   The angular mode is the number of perturbations to
+         *   apply to the spherical shell. Historically, this was
+         *   permanently set to 6 (hence the class name SphericalHexagonalPerturbation)
+         *   The default is 6 in order to provide backwards compatibility.
+         *   
+         *   The rotation offset describes the number of degrees to rotate the perturbation
+         *   counterclockwise. Setting the rotation offset to 0 will cause one of the perturbations
+         *   to point north/up. Rotation offset is set to -45 degrees by default in order to provide
+         *   backwards compatibility.
+         **/ 
+       
+        int angular_mode; 
         double rotation_offset;   
   
     };
@@ -112,7 +124,6 @@ namespace aspect
         double sigma;
         double sign;
         unsigned int npoint;
-        //int lemniscate_number;
         std::string initial_geotherm_table;
 
         std::vector<double> radial_position;
diff --git a/source/geometry_model/spherical_shell.cc b/source/geometry_model/spherical_shell.cc
index de1b39d..0a5b8e2 100644
--- a/source/geometry_model/spherical_shell.cc
+++ b/source/geometry_model/spherical_shell.cc
@@ -42,7 +42,7 @@ namespace aspect
                                       Point<dim>(),
                                       R0,
                                       R1,
-                                      (dim==3) ? 8*cell_count : cell_count,
+                                      (dim==3) ? 8*n_cells_along_circumference : n_cells_along_circumference,
                                       true);
         }
       else if (phi == 90)
@@ -187,10 +187,10 @@ namespace aspect
                              "Opening angle in degrees of the section of the shell "
                              "that we want to build. Units: degrees.");
          
-          prm.declare_entry ("Cell count", "12",
+          prm.declare_entry ("Cells along circumference", "12",
                               Patterns::Integer (),
                               "The number of tangential cells that are "
-                              "created when initial global refinement is zero."); 
+                              "created in the coarse mesh."); 
 
         }
         prm.leave_subsection();
@@ -211,7 +211,7 @@ namespace aspect
           R0  = prm.get_double ("Inner radius");
           R1  = prm.get_double ("Outer radius");
           phi = prm.get_double ("Opening angle");
-          cell_count = prm.get_integer ("Cell count");
+          n_cells_along_circumference = prm.get_integer ("Cells along circumference");
         }
         prm.leave_subsection();
       }
diff --git a/source/initial_conditions/spherical_shell.cc b/source/initial_conditions/spherical_shell.cc
index 51843e1..6339416 100644
--- a/source/initial_conditions/spherical_shell.cc
+++ b/source/initial_conditions/spherical_shell.cc
@@ -62,8 +62,6 @@ namespace aspect
          http://www.wolframalpha.com/input/?i=plot+%28%282*sqrt%28x^2%2By^2%29-1%29%2B0.2*%282*sqrt%28x^2%2By^2%29-1%29*%281-%282*sqrt%28x^2%2By^2%29-1%29%29*sin%286*atan2%28x%2Cy%29%29%29%2C+x%3D-1+to+1%2C+y%3D-1+to+1
       */
     
-      const double PI = 3.1415926535897932384626433832795028841971693993751058;
-
       
       const double scale = ((dim==3)
                             ?
@@ -74,7 +72,7 @@ namespace aspect
       const double phi   = std::atan2(position(0),position(1));
       const double s_mod = s
                            +
-                           0.2 * s * (1-s) * std::sin(lemniscate_number*phi +(PI/2 + rotation_offset)) * scale;
+                           0.2 * s * (1-s) * std::sin(angular_mode*phi +(90 + 2*rotation_offset)*numbers::PI/180 ) * scale;
 
       return (this->get_boundary_temperature().maximal_temperature()*(s_mod)
               +
@@ -171,8 +169,6 @@ namespace aspect
         return (InterpolVal + Perturbation)*dT;
     }
 
-
-
     template <int dim>
     void
     SphericalHexagonalPerturbation<dim>::declare_parameters (ParameterHandler &prm)
@@ -182,15 +178,15 @@ namespace aspect
         prm.enter_subsection("Spherical hexagonal perturbation");
         {
 
-          prm.declare_entry ("Lemniscate number", "6",
+          prm.declare_entry ("Angular mode", "6",
                               Patterns::Integer (),
                               "The number of convection cells to perturb the system with.");   
 
-         prm.declare_entry  ("Rotation offset", "0",
+         prm.declare_entry  ("Rotation offset", "-45",
                               Patterns::Double (),
-                              "Amount to rotate the lemniscate in radians."
-                              "Default places a petal due north.");    
- 
+                              "Amount of clockwise rotation in degrees to apply to"
+                              "the perturbations. Default is set to -45 in order"
+                              "to provide backwards compatibility.");    
         }
         prm.leave_subsection ();
       }
@@ -205,23 +201,14 @@ namespace aspect
       {
         prm.enter_subsection("Spherical hexagonal perturbation");
         {
-          lemniscate_number = prm.get_integer ("Lemniscate number");
+          angular_mode = prm.get_integer ("Angular mode");
           rotation_offset = prm.get_double  ("Rotation offset");
-
         }
         prm.leave_subsection ();
       }
       prm.leave_subsection ();
     }
 
-
-
-
-
-
-
-
-
     template <int dim>
     void
     SphericalGaussianPerturbation<dim>::declare_parameters (ParameterHandler &prm)
@@ -230,7 +217,6 @@ namespace aspect
       {
         prm.enter_subsection("Spherical gaussian perturbation");
         {       
- 
           prm.declare_entry ("Angle", "0e0",
                              Patterns::Double (0),
                              "The angle where the center of the perturbation is placed.");
@@ -258,7 +244,6 @@ namespace aspect
       prm.leave_subsection ();
     }
 
-
     template <int dim>
     void
     SphericalGaussianPerturbation<dim>::parse_parameters (ParameterHandler &prm)
@@ -267,7 +252,6 @@ namespace aspect
       {
         prm.enter_subsection("Spherical gaussian perturbation");
         {
-          //lemniscate_number = prm.get_integer ("Lemniscate number");
           angle = prm.get_double ("Angle");
           depth = prm.get_double ("Non-dimensional depth");
           amplitude  = prm.get_double ("Amplitude");
@@ -292,7 +276,8 @@ namespace aspect
                                        "An initial temperature field in which the temperature "
                                        "is perturbed following an N-fold pattern in a specified "
                                        "direction from an otherwise spherically symmetric "
-                                       "state.")
+                                       "state. The class's name comes from previous versions"
+                                       "when the only opiton was N=6")
 
     ASPECT_REGISTER_INITIAL_CONDITIONS(SphericalGaussianPerturbation,
                                        "spherical gaussian perturbation",



More information about the CIG-COMMITS mailing list