[aspect-devel] Benchmark

Wolfgang Bangerth bangerth at math.tamu.edu
Thu Jul 3 08:31:03 PDT 2014


Hi Iris,

> The code now runs in parallel and I have written a bit about it.

Very nice. With one more round of small changes I'll be happy to add this to 
the manual. The changes are related to this:


> The final
> version of the plugin, the figures and my writings are attached. A problem
> that I solved very ungraciously is that the same parameter "Viscosity
> parameter" has to be inserted twice by the user in the input file in both the
> Material Model and the Gravity Model. This might be something that could be
> improved in the .cc file, because it would be more user friendly, but I do not
> know how to do that.

It's actually quite simple once you realize that what you thought are the 
doors to your jail cell are not locked :-)

In your .cc file, you have these two pieces of code:
     void
     BursteddeMaterial<dim>::declare_parameters (ParameterHandler &prm)
     {
       prm.enter_subsection("Material model");
       {
         prm.enter_subsection("Burstedde");
         {
           prm.declare_entry ("Viscosity parameter", "0",
                              Patterns::Double (0),
                              "Viscosity in the Burstedde.");
         }
         prm.leave_subsection();
       }
       prm.leave_subsection();
     }
and
     void
     BursteddeGravity<dim>::declare_parameters (ParameterHandler &prm)
     {
       prm.enter_subsection("Gravity model");
       {
         prm.enter_subsection("BursteddeGravity");
         {
           prm.declare_entry ("Viscosity parameter", "0",
                              Patterns::Double (0),
                              "Viscosity in the Burstedde.");
         }
         prm.leave_subsection ();
       }
       prm.leave_subsection ();
     }

You do this because you think that material parameters need to go into the 
parameter subsection "Material model" and gravity parameters into the "Gravity 
model" subsection. For parameters that are part of the Aspect distribution, 
this is good practice, but for parameters only accessible when you load a 
particular plugin, there is really no particular reason to do this. How about 
this:

     void
     BursteddeMaterial<dim>::declare_parameters (ParameterHandler &prm)
     {
       // create a global section in the parameter file for parameters
       // that describe this benchmark. note that we declare them here
       // in the material model, but other kinds of plugins (e.g., the gravity
       // model below) may also read these parameters even though they do not
       // declare them
       prm.enter_subsection("Burstedde benchmark");
       {
         prm.declare_entry ("Viscosity parameter", "0",
                            Patterns::Double (0),
                            "Viscosity in the Burstedde.");
       }
       prm.leave_subsection();
     }
and
     void
     BursteddeGravity<dim>::declare_parameters (ParameterHandler &prm)
     {
       // nothing to declare here. this plugin will, however, read parameters
       // declared by the material model in the "Burstedde benchmark" section
     }

Best
  W.


-- 
------------------------------------------------------------------------
Wolfgang Bangerth               email:            bangerth at math.tamu.edu
                                 www: http://www.math.tamu.edu/~bangerth/



More information about the Aspect-devel mailing list