From 4612820b8e2a72aadd9fa909793b3a2426780e0b Mon Sep 17 00:00:00 2001 From: kronbichler Date: Thu, 16 Apr 2009 14:18:31 +0000 Subject: [PATCH] Introduce one more change from step-31. git-svn-id: https://svn.dealii.org/trunk@18628 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-32/step-32.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index 90c7d45fc7..a96de625ed 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -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 get_extrapolated_temperature_range () const; @@ -1089,7 +1089,7 @@ void BoussinesqFlowProblem::assemble_temperature_matrix () template -void BoussinesqFlowProblem::assemble_temperature_system () +void BoussinesqFlowProblem::assemble_temperature_system (const double maximal_velocity) { const bool use_bdf2_scheme = (timestep_number != 0); @@ -1153,7 +1153,6 @@ void BoussinesqFlowProblem::assemble_temperature_system () std::vector phi_T (dofs_per_cell); std::vector > grad_phi_T (dofs_per_cell); - const double global_u_infty = get_maximal_velocity(); const std::pair global_T_range = get_extrapolated_temperature_range(); @@ -1212,7 +1211,7 @@ void BoussinesqFlowProblem::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::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 (); -- 2.39.5