]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Polish testcase a bit.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 14 Dec 2006 17:03:20 +0000 (17:03 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 14 Dec 2006 17:03:20 +0000 (17:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@14241 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 8cca3c9577b35a3199e0372279e863565ffd1068..06fcb387c0d2ea73f92a1f97a7753b6a444f108c 100644 (file)
@@ -1769,10 +1769,13 @@ class RightHandSide : public Function<dim>
 
 template <int dim>
 double
-RightHandSide<dim>::value (const Point<dim>   &/*p*/,
+RightHandSide<dim>::value (const Point<dim>   &p,
                           const unsigned int  /*component*/) const
 {
-  return 1.;
+  double product = 1;
+  for (unsigned int d=0; d<dim; ++d)
+    product *= (p[d]+1);
+  return product;
 }
 
 
@@ -1797,15 +1800,6 @@ void
 run_simulation (LaplaceSolver::Base<dim>                     &solver,
                const std::list<Evaluation::EvaluationBase<dim> *> &postprocessor_list)
 {
-                                  // We will give an indicator of the
-                                  // step we are presently computing,
-                                  // in order to keep the user
-                                  // informed that something is still
-                                  // happening, and that the program
-                                  // is not in an endless loop. This
-                                  // is the head of this status line:
-  std::cout << "Refinement cycle: ";
-
                                   // Then start a loop which only
                                   // terminates once the number of
                                   // degrees of freedom is larger
@@ -1815,17 +1809,8 @@ run_simulation (LaplaceSolver::Base<dim>                     &solver,
                                   // your program).
   for (unsigned int step=0; true; ++step)
     {
-                                      // Then give the <code>alive</code>
-                                      // indication for this
-                                      // iteration. Note that the
-                                      // <code>std::flush</code> is needed to
-                                      // have the text actually
-                                      // appear on the screen, rather
-                                      // than only in some buffer
-                                      // that is only flushed the
-                                      // next time we issue an
-                                      // end-line.
-      std::cout << step << " " << std::flush;
+      std::cout << "Refinement cycle: "
+               << step << " " << std::endl;
 
                                       // Now solve the problem on the
                                       // present grid, and run the
@@ -1843,7 +1828,7 @@ run_simulation (LaplaceSolver::Base<dim>                     &solver,
        {
          (*i)->set_refinement_cycle (step);
          solver.postprocess (**i);
-       };
+       }
 
 
                                       // Now check whether more
@@ -1854,7 +1839,9 @@ run_simulation (LaplaceSolver::Base<dim>                     &solver,
        solver.refine_grid ();
       else
        break;
-    };
+
+      std::cout << std::endl;
+    }
 
                                   // Finally end the line in which we
                                   // displayed status reports:

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.