]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Introduce one more change from step-31.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 16 Apr 2009 14:18:31 +0000 (14:18 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 16 Apr 2009 14:18:31 +0000 (14:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@18628 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 90c7d45fc7cf190dd6612976e595ac103fd59876..a96de625ed75b3f0748fce64b821dd60d26ab86e 100644 (file)
@@ -297,7 +297,7 @@ class BoussinesqFlowProblem
     void build_stokes_preconditioner ();
     void assemble_stokes_system ();
     void assemble_temperature_matrix ();
-    void assemble_temperature_system ();
+    void assemble_temperature_system (const double maximal_velocity);
     void project_temperature_field ();
     double get_maximal_velocity () const;
     std::pair<double,double> get_extrapolated_temperature_range () const;
@@ -1089,7 +1089,7 @@ void BoussinesqFlowProblem<dim>::assemble_temperature_matrix ()
 
 
 template <int dim>
-void BoussinesqFlowProblem<dim>::assemble_temperature_system ()
+void BoussinesqFlowProblem<dim>::assemble_temperature_system (const double maximal_velocity)
 {
   const bool use_bdf2_scheme = (timestep_number != 0);
 
@@ -1153,7 +1153,6 @@ void BoussinesqFlowProblem<dim>::assemble_temperature_system ()
   std::vector<double>                  phi_T       (dofs_per_cell);
   std::vector<Tensor<1,dim> >          grad_phi_T  (dofs_per_cell);
   
-  const double global_u_infty = get_maximal_velocity();
   const std::pair<double,double>
     global_T_range = get_extrapolated_temperature_range();
 
@@ -1212,7 +1211,7 @@ void BoussinesqFlowProblem<dim>::assemble_temperature_system ()
                               old_velocity_values,
                               old_old_velocity_values,
                               gamma_values,
-                              global_u_infty,
+                              maximal_velocity,
                               global_T_range.second - global_T_range.first,
                               cell->diameter());
        
@@ -1397,19 +1396,19 @@ void BoussinesqFlowProblem<dim>::solve ()
 
   computing_timer.enter_section ("   Assemble temperature rhs");
 
-  old_time_step = time_step;    
+  old_time_step = time_step;
+  const double maximal_velocity = get_maximal_velocity();
   time_step = 1./(1.6*dim*std::sqrt(1.*dim)) /
              temperature_degree *
              GridTools::minimal_cell_diameter(triangulation) /
-              std::max (get_maximal_velocity(), 0.01);
+              std::max (maximal_velocity, 0.01);
   
   pcout << "   " << "Time step: " << time_step
        << std::endl;  
 
   temperature_solution = old_temperature_solution;
 
-
-  assemble_temperature_system ();
+  assemble_temperature_system (maximal_velocity);
 
   computing_timer.exit_section ();
 

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.