]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Rename main classes to Step5 and Step6.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Aug 2011 16:25:07 +0000 (16:25 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Aug 2011 16:25:07 +0000 (16:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@24100 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-5/doc/results.dox
deal.II/examples/step-5/step-5.cc
deal.II/examples/step-6/doc/results.dox
deal.II/examples/step-6/step-6.cc

index 7e0adf1d30f2974c6725eb8c5895b884f5d6cd4d..4a2e30bd5c0f31ebe7cc7b7757d4655901c1a09e 100644 (file)
@@ -156,7 +156,7 @@ called from <code>main()</code> (stackframe 1). In realistic programs,
 there would be many more functions in between these two. For example,
 we might have made the mistake in the <code>assemble_system</code>
 function, in which case stack frame 1 would be
-<code>LaplaceProblem::assemble_system</code>, stack frame 2
-would be <code>LaplaceProblem::run</code>, and stack frame 3
+<code>Step5::assemble_system</code>, stack frame 2
+would be <code>Step5::run</code>, and stack frame 3
 would be <code>main()</code> &mdash; you get the idea.
 
index f9594b10135eebfaa19312c8446898902b15c22a..3394ad71bc7976110439484bb4504e86b256a8a7 100644 (file)
@@ -61,7 +61,7 @@
 using namespace dealii;
 
 
-                                 // @sect3{The <code>LaplaceProblem</code> class template}
+                                 // @sect3{The <code>Step5</code> class template}
 
                                 // The main class is mostly as in the
                                 // previous example. The most visible
@@ -74,10 +74,10 @@ using namespace dealii;
                                 // <code>setup_system</code>. Apart from this,
                                 // everything is as before.
 template <int dim>
-class LaplaceProblem
+class Step5
 {
   public:
-    LaplaceProblem ();
+    Step5 ();
     void run ();
 
   private:
@@ -354,20 +354,20 @@ void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
 }
 
 
-                                 // @sect3{The <code>LaplaceProblem</code> class implementation}
+                                 // @sect3{The <code>Step5</code> class implementation}
 
-                                 // @sect4{LaplaceProblem::LaplaceProblem}
+                                 // @sect4{Step5::Step5}
 
                                 // This function is as before.
 template <int dim>
-LaplaceProblem<dim>::LaplaceProblem () :
+Step5<dim>::Step5 () :
                 fe (1),
                dof_handler (triangulation)
 {}
 
 
 
-                                 // @sect4{LaplaceProblem::setup_system}
+                                 // @sect4{Step5::setup_system}
 
                                 // This is the function
                                 // <code>make_grid_and_dofs</code> from the
@@ -375,7 +375,7 @@ LaplaceProblem<dim>::LaplaceProblem () :
                                 // generation of the grid. Everything
                                 // else is unchanged:
 template <int dim>
-void LaplaceProblem<dim>::setup_system ()
+void Step5<dim>::setup_system ()
 {
   dof_handler.distribute_dofs (fe);
 
@@ -395,7 +395,7 @@ void LaplaceProblem<dim>::setup_system ()
 
 
 
-                                 // @sect4{LaplaceProblem::assemble_system}
+                                 // @sect4{Step5::assemble_system}
 
                                 // As in the previous examples, this
                                 // function is not changed much with
@@ -429,7 +429,7 @@ void LaplaceProblem<dim>::setup_system ()
                                 // are completely unchanged from
                                 // before:
 template <int dim>
-void LaplaceProblem<dim>::assemble_system ()
+void Step5<dim>::assemble_system ()
 {
   QGauss<dim>  quadrature_formula(2);
 
@@ -581,7 +581,7 @@ void LaplaceProblem<dim>::assemble_system ()
 }
 
 
-                                 // @sect4{LaplaceProblem::solve}
+                                 // @sect4{Step5::solve}
 
                                 // The solution process again looks
                                 // mostly like in the previous
@@ -633,7 +633,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                 // declared, and the CG solver will
                                 // do the rest for us:
 template <int dim>
-void LaplaceProblem<dim>::solve ()
+void Step5<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              solver (solver_control);
@@ -650,7 +650,7 @@ void LaplaceProblem<dim>::solve ()
 }
 
 
-                                 // @sect4{LaplaceProblem::output_results and setting output flags}
+                                 // @sect4{Step5::output_results and setting output flags}
 
                                 // Writing output to a file is mostly
                                 // the same as for the previous
@@ -660,7 +660,7 @@ void LaplaceProblem<dim>::solve ()
                                 // filename for each refinement
                                 // cycle.
 template <int dim>
-void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
+void Step5<dim>::output_results (const unsigned int cycle) const
 {
   DataOut<dim> data_out;
 
@@ -796,7 +796,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
 
 
-                                 // @sect4{LaplaceProblem::run}
+                                 // @sect4{Step5::run}
 
                                 // The second to last thing in this
                                 // program is the definition of the
@@ -837,7 +837,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
                                 // triangulation with the data in the
                                 // file:
 template <int dim>
-void LaplaceProblem<dim>::run ()
+void Step5<dim>::run ()
 {
   GridIn<dim> grid_in;
   grid_in.attach_triangulation (triangulation);
@@ -952,7 +952,7 @@ int main ()
 {
   deallog.depth_console (0);
 
-  LaplaceProblem<2> laplace_problem_2d;
+  Step5<2> laplace_problem_2d;
   laplace_problem_2d.run ();
 
                                   // Finally, we have promised to
index 64a04e2b4006df4cae66b4af1bff0c2c588f0e55..2ed4ac63d4cca8c6e76ffd404a1d3b5258929db8 100644 (file)
@@ -111,7 +111,7 @@ from the optimal square.
 
 
 For completeness, we show what happens if the code we commented about
-in the destructor of the <code>LaplaceProblem</code> class is omitted
+in the destructor of the <code>Step6</code> class is omitted
 from this example.
 
 @code
@@ -132,7 +132,7 @@ Stacktrace:
 #1  /u/bangerth/p/deal.II/1/deal.II/lib/libdeal_II_2d.g.so: FiniteElement<2>::~FiniteElement()
 #2  ./step-6: FE_Poly<TensorProductPolynomials<2>, 2>::~FE_Poly()
 #3  ./step-6: FE_Q<2>::~FE_Q()
-#4  ./step-6: LaplaceProblem<2>::~LaplaceProblem()
+#4  ./step-6: Step6<2>::~Step6()
 #5  ./step-6: main
 --------------------------------------------------------
 make: *** [run] Aborted
@@ -142,13 +142,14 @@ make: *** [run] Aborted
 
 From the above error message, we conclude that an object of type
 <code>10DoFHandlerILi2EE</code> is still using the object of type
-<code>4FE_QILi2EE</code>. These are of course "mangled" names for
+<code>4FE_QILi2EE</code>. These are of course <a
+href="http://en.wikipedia.org/wiki/Name_mangling">"mangled" names</a> for 
 <code>DoFHandler</code> and <code>FE_Q</code>. The mangling works as
 follows: the first number indicates the number of characters of the
 template class, i.e. 10 for <code>DoFHandler</code> and 4
 for<code>FE_Q</code>; the rest of the text is then template
 arguments. From this we can already glean a little bit who's the
-culprit here, and who the victim.:
+culprit here, and who the victim:
 The one object that still uses the finite element is the
 <code>dof_handler</code> object.
 
@@ -158,7 +159,7 @@ The stacktrace gives an indication of where the problem happened. We
 see that the exception was triggered in the
 destructor of the <code>FiniteElement</code> class that was called
 through a few more functions from the destructor of the
-<code>LaplaceProblem</code> class, exactly where we have commented out
+<code>Step6</code> class, exactly where we have commented out
 the call to <code>DoFHandler::clear()</code>.
 
 
index 9132e5ff772d5d9d1a08f58e04e3dedd0c601f30..657a12ade466d455070d5a060d38ede95175c7de 100644 (file)
@@ -3,7 +3,7 @@
 
 /*    $Id$       */
 /*                                                                */
-/*    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2010 by the deal.II authors */
+/*    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2010, 2011 by the deal.II authors */
 /*                                                                */
 /*    This file is subject to QPL and may not be  distributed     */
 /*    without copyright and license information. Please refer     */
 using namespace dealii;
 
 
-                                 // @sect3{The <code>LaplaceProblem</code> class template}
+                                 // @sect3{The <code>Step6</code> class template}
 
                                 // The main class is again almost
                                 // unchanged. Two additions, however,
@@ -122,11 +122,11 @@ using namespace dealii;
                                 // clear when we discuss its
                                 // implementation.
 template <int dim>
-class LaplaceProblem
+class Step6
 {
   public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
+    Step6 ();
+    ~Step6 ();
 
     void run ();
 
@@ -214,9 +214,9 @@ void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
 }
 
 
-                                 // @sect3{The <code>LaplaceProblem</code> class implementation}
+                                 // @sect3{The <code>Step6</code> class implementation}
 
-                                 // @sect4{LaplaceProblem::LaplaceProblem}
+                                 // @sect4{Step6::Step6}
 
                                 // The constructor of this class is
                                 // mostly the same as before, but
@@ -228,14 +228,14 @@ void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
                                 // the desired polynomial degree
                                 // (here <code>2</code>):
 template <int dim>
-LaplaceProblem<dim>::LaplaceProblem ()
+Step6<dim>::Step6 ()
                :
                dof_handler (triangulation),
                 fe (2)
 {}
 
 
-                                 // @sect4{LaplaceProblem::~LaplaceProblem}
+                                 // @sect4{Step6::~Step6}
 
                                 // Here comes the added destructor of
                                 // the class. The reason why we want
@@ -325,7 +325,7 @@ LaplaceProblem<dim>::LaplaceProblem ()
                                 // exactly the behavior sketched
                                 // above. The reason is that member
                                 // variables of the
-                                // <code>LaplaceProblem</code> class are
+                                // <code>Step6</code> class are
                                 // destructed bottom-up (i.e. in
                                 // reverse order of their declaration
                                 // in the class), as always in
@@ -361,13 +361,13 @@ LaplaceProblem<dim>::LaplaceProblem ()
                                 // destructor, to the end of the
                                 // results section of this example.
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem ()
+Step6<dim>::~Step6 ()
 {
   dof_handler.clear ();
 }
 
 
-                                 // @sect4{LaplaceProblem::setup_system}
+                                 // @sect4{Step6::setup_system}
 
                                 // The next function is setting up
                                 // all the variables that describe
@@ -406,7 +406,7 @@ LaplaceProblem<dim>::~LaplaceProblem ()
                                 // call will take care of this,
                                 // however:
 template <int dim>
-void LaplaceProblem<dim>::setup_system ()
+void Step6<dim>::setup_system ()
 {
   dof_handler.distribute_dofs (fe);
 
@@ -507,7 +507,7 @@ void LaplaceProblem<dim>::setup_system ()
   system_matrix.reinit (sparsity_pattern);
 }
 
-                                 // @sect4{LaplaceProblem::assemble_system}
+                                 // @sect4{Step6::assemble_system}
 
                                 // Next, we have to assemble the
                                 // matrix again. There are no code
@@ -550,7 +550,7 @@ void LaplaceProblem<dim>::setup_system ()
                                 // code and nothing that you have to
                                 // worry about.
 template <int dim>
-void LaplaceProblem<dim>::assemble_system ()
+void Step6<dim>::assemble_system ()
 {
   const QGauss<dim>  quadrature_formula(3);
 
@@ -662,7 +662,7 @@ void LaplaceProblem<dim>::assemble_system ()
 
 
 
-                                 // @sect4{LaplaceProblem::solve}
+                                 // @sect4{Step6::solve}
 
                                 // We continue with gradual
                                 // improvements. The function that
@@ -693,7 +693,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                 // find at the end of this function:
 
 template <int dim>
-void LaplaceProblem<dim>::solve ()
+void Step6<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              solver (solver_control);
@@ -708,7 +708,7 @@ void LaplaceProblem<dim>::solve ()
 }
 
 
-                                 // @sect4{LaplaceProblem::refine_grid}
+                                 // @sect4{Step6::refine_grid}
 
                                 // Instead of global refinement, we
                                 // now use a slightly more elaborate
@@ -824,7 +824,7 @@ void LaplaceProblem<dim>::solve ()
                                 // doubles to represent error
                                 // indicators.
 template <int dim>
-void LaplaceProblem<dim>::refine_grid ()
+void Step6<dim>::refine_grid ()
 {
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
 
@@ -912,7 +912,7 @@ void LaplaceProblem<dim>::refine_grid ()
 }
 
 
-                                 // @sect4{LaplaceProblem::output_results}
+                                 // @sect4{Step6::output_results}
 
                                 // At the end of computations on each
                                 // grid, and just before we continue
@@ -966,7 +966,7 @@ void LaplaceProblem<dim>::refine_grid ()
                                 // generation of file names for that
                                 // case):
 template <int dim>
-void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
+void Step6<dim>::output_results (const unsigned int cycle) const
 {
   Assert (cycle < 10, ExcNotImplemented());
 
@@ -982,7 +982,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
 
 
-                                 // @sect4{LaplaceProblem::run}
+                                 // @sect4{Step6::run}
 
                                 // The final function before
                                 // <code>main()</code> is again the main
@@ -1034,7 +1034,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
                                 // The rest of the loop looks as
                                 // before:
 template <int dim>
-void LaplaceProblem<dim>::run ()
+void Step6<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<8; ++cycle)
     {
@@ -1147,7 +1147,7 @@ int main ()
     {
       deallog.depth_console (0);
 
-      LaplaceProblem<2> laplace_problem_2d;
+      Step6<2> laplace_problem_2d;
       laplace_problem_2d.run ();
     }
                                   // ...and if this should fail, try

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.