]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Do something that may not be strictly necessary but helpful in
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Sep 2011 23:54:52 +0000 (23:54 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Sep 2011 23:54:52 +0000 (23:54 +0000)
avoiding future errors.

git-svn-id: https://svn.dealii.org/trunk@24376 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 6dec1fb27b5cf8191497a34d0aff7a4e76411af9..f1087f528a82586451ccd72b52d1663988c5312a 100644 (file)
@@ -1852,14 +1852,34 @@ void BoussinesqFlowProblem<dim>::project_temperature_field ()
   cg.solve (temperature_mass_matrix, solution, rhs, preconditioner_mass);
 
   temperature_constraints.distribute (solution);
-
-//  old_temperature_solution = solution;
+                                  // Having so computed the current
+                                  // temperature field, let us set
+                                  // the member variable that holds
+                                  // the temperature nodes. Strictly
+                                  // speaking, we really only need to
+                                  // set
+                                  // <code>old_temperature_solution</code>
+                                  // since the first thing we will do
+                                  // is to compute the Stokes
+                                  // solution that only requires the
+                                  // previous time step's temperature
+                                  // field. That said, nothing good
+                                  // can come from not initializing
+                                  // the other vectors as well
+                                  // (especially since it's a
+                                  // relatively cheap operation and
+                                  // we only have to do it once at
+                                  // the beginning of the program) if
+                                  // we ever want to extend our
+                                  // numerical method or physical
+                                  // model, and so we initialize
+                                  // <code>temperature_solution</code>
+                                  // and
+                                  // <code>old_old_temperature_solution</code>
+                                  // as well:
+  temperature_solution.reinit(solution, false, true);
   old_temperature_solution.reinit(solution, false, true);
-  // this is good enough: no need to set
-  // current temperature since we need this
-  // field only for computing the next stokes
-  // system, which depends on the temperature
-  // of the *previous* time step
+  old_old_temperature_solution.reinit(solution, false, true);
 }
 
 

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.