]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
include 1d results
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 6 Jul 2006 13:34:41 +0000 (13:34 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 6 Jul 2006 13:34:41 +0000 (13:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@13344 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-4/doc/results.dox
deal.II/examples/step-4/step-4.cc

index cfd3be1c1f0eead44c83a5fc1bf5b8c229d2a672..d0870b877b426e01986a05fe6f856459afe7bb85 100644 (file)
@@ -7,6 +7,11 @@ may vary by one or two, depending on your computer, since this is
 often dependent on the round-off accuracy of floating point
 operations, which differs between processors):
 @code
+Solving problem in 1 space dimensions.
+   Number of active cells: 16
+   Total number of cells: 31
+   Number of degrees of freedom: 17
+   16 CG iterations needed to obtain convergence.
 Solving problem in 2 space dimensions.
    Number of active cells: 256
    Total number of cells: 341
@@ -18,18 +23,22 @@ Solving problem in 3 space dimensions.
    Number of degrees of freedom: 4913
    30 CG iterations needed to obtain convergence.
 @endcode
-It is obvious that in three spatial dimensions the number of cells and
-therefore also the number of degrees of freedom is
-much higher. What cannot be seen here, is that besides this higher
+It is obvious that the number of cells and
+therefore also the number of degrees of freedom increases exponentially with
+the space dimension. What cannot be seen here, is that besides this increase in
 number of rows and columns in the matrix, there are also significantly
-more entries per row of the matrix in three space
+more entries per row of the matrix in higher space
 dimensions. Together, this leads to a much higher numerical effort for
 solving the system of equation, which you can feel when you actually
-run the program.
+run the program. Therefore, it is really helful to develop a program in two dimensions
+and transfer it to three dimensions by the mechanism studied in this step. By the way,
+one dimensional examples are usually not sufficiently general to serve as a basis for
+three dimensions.
 
 
 
-The program produces two files: <code>solution-2d.gmv</code> and
+The program produces three files: <code>solution-1d.gmv</code>,
+ <code>solution-2d.gmv</code> and
 <code>solution-3d.gmv</code>, which can be viewed using the program
 GMV (in case you do not have that program, you can easily change the
 output format in the program to something which you can view more
@@ -98,6 +107,20 @@ solutions values. 3D grids are difficult to visualize, which can be
 seen here already, even though the grid is not even locally refined.
 
 
+For completeness, we add the graphical output of the one dimensional run:
+
+<TABLE WIDTH="60%" ALIGN="center">
+  <tr>
+    <td ALIGN="center">
+      @image html step-4.solution-1d.png
+    </td>
+
+    <td ALIGN="center">
+      @image html step-4.grid-1d.png
+    </td>
+  </tr>
+</table>
+
 
 
 <a name="extensions"></a>
index ed4161fa22aee09a21f55f6fc63e8e34b5676ab1..afb3663ae20af2b7957d3eb7d24f580fc96daf8c 100644 (file)
@@ -620,9 +620,10 @@ void LaplaceProblem<dim>::output_results () const
 
   data_out.build_patches ();
 
-  std::ofstream output (dim == 2 ?
+  std::ofstream output (dim == 1 ? "solution-1d.gmv"
+                       : (dim == 2 ?
                        "solution-2d.gmv" :
-                       "solution-3d.gmv");
+                       "solution-3d.gmv"));
   data_out.write_gmv (output);
 }
 
@@ -650,14 +651,12 @@ void LaplaceProblem<dim>::run ()
                                  // @sect3{The <code>main</code> function}
 
                                 // And this is the main function. It also
-                                // looks mostly like in step-3, but if you
-                                // look at the code below, note how we first
+                                // looks mostly like in step-3, we first
                                 // create a variable of type
-                                // <code>LaplaceProblem@<2@></code> (forcing the
-                                // compiler to compile the class template
-                                // with <code>dim</code> replaced by <code>2</code>) and run a
-                                // 2d simulation, and then we do the whole
-                                // thing over in 3d.
+                                // <code>LaplaceProblem@<1@></code> compiling the class template
+                                // with <code>dim</code> replaced by <code>1</code>) and run a
+                                 // 1d simulation. Then, we do the whole
+                                // thing over in 2d and 3d.
                                 //
                                 // In practice, this is probably not what you
                                 // would do very frequently (you probably

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.