]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make the number of time steps between mesh refinement a parameter.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 13 Feb 2011 22:37:10 +0000 (22:37 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 13 Feb 2011 22:37:10 +0000 (22:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@23351 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-32/step-32.cc
deal.II/examples/step-32/step-32.prm

index b971f40ac28992967f29544405a5bf7f2f6f37d2..cc5339806017c25968368d2dfb5b85800c028e46 100644 (file)
@@ -861,6 +861,8 @@ class BoussinesqFlowProblem
        bool         generate_graphical_output;
        unsigned int graphical_output_interval;
 
+       unsigned int adaptive_refinement_interval;
+
        double stabilization_alpha;
        double stabilization_c_R;
        double stabilization_beta;
@@ -971,6 +973,7 @@ BoussinesqFlowProblem<dim>::Parameters::Parameters ()
                end_time (1e8),
                initial_global_refinement (2),
                initial_adaptive_refinement (2),
+               adaptive_refinement_interval (10),
                stabilization_alpha (2),
                stabilization_c_R (0.11),
                stabilization_beta (0.078)
@@ -995,6 +998,10 @@ declare_parameters (ParameterHandler &prm)
                     Patterns::Integer (0),
                     "The number of adaptive refinement steps performed after "
                     "initial global refinement.");
+  prm.declare_entry ("Time steps between mesh refinement", "10",
+                    Patterns::Integer (10),
+                    "The number of time steps after which the mesh is to be "
+                    "adapted based on computed error indicators.");
   prm.declare_entry ("Generate graphical output", "false",
                     Patterns::Bool (),
                     "Whether graphical output is to be generated or not. "
@@ -1034,6 +1041,8 @@ parse_parameters (ParameterHandler &prm)
   initial_global_refinement   = prm.get_integer ("Initial global refinement");
   initial_adaptive_refinement = prm.get_integer ("Initial adaptive refinement");
 
+  adaptive_refinement_interval= prm.get_integer ("Time steps between mesh refinement");
+
   generate_graphical_output   = prm.get_bool ("Generate graphical output");
   graphical_output_interval   = prm.get_integer ("Time steps between graphical output");
 
@@ -3532,7 +3541,9 @@ void BoussinesqFlowProblem<dim>::run (const std::string parameter_filename)
          goto start_time_iteration;
        }
       else
-       if ((timestep_number > 0) && (timestep_number % 10 == 0))
+       if ((timestep_number > 0)
+           &&
+           (timestep_number % parameters.adaptive_refinement_interval == 0))
          refine_mesh (parameters.initial_global_refinement +
                       parameters.initial_adaptive_refinement);
 
@@ -3566,12 +3577,12 @@ void BoussinesqFlowProblem<dim>::run (const std::string parameter_filename)
          TrilinosWrappers::MPI::Vector
            distributed_old_old_temperature_solution (temperature_rhs);
          distributed_old_old_temperature_solution.reinit(old_old_temperature_solution, false, true);
-         
+
 
          distributed_temperature_solution.sadd (1.+time_step/old_time_step,
                                                 -time_step/old_time_step,
                                                 distributed_old_old_temperature_solution);
-         temperature_solution.reinit(distributed_temperature_solution, false, true);     
+         temperature_solution.reinit(distributed_temperature_solution, false, true);
        }
     }
   while (time <= parameters.end_time * EquationData::year_in_seconds);
index 3ddcd8521a0de44ddd5bb09961d103bcbbcae73e..b8777bc30a9a0bdb1d72ef2b3d51b775c77b8e7c 100644 (file)
@@ -11,6 +11,10 @@ set Initial adaptive refinement         = 2
 # before the problem is first solved there.
 set Initial global refinement           = 1
 
+# The number of time steps after which the mesh is to be adapted based on
+# computed error indicators.
+set Time steps between mesh refinement  = 10
+
 # Whether graphical output is to be generated or not. You may not want to get
 # graphical output if the number of processors is large.
 set Generate graphical output           = false

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.