From d5875d5a620f0dcb7accb729c4482dd56000e182 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 6 Jul 2006 13:44:43 +0000 Subject: [PATCH] remove 1d again git-svn-id: https://svn.dealii.org/trunk@13345 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-4/doc/results.dox | 35 +++++-------------------- deal.II/examples/step-4/step-4.cc | 22 +++++++--------- 2 files changed, 15 insertions(+), 42 deletions(-) diff --git a/deal.II/examples/step-4/doc/results.dox b/deal.II/examples/step-4/doc/results.dox index d0870b877b..cfd3be1c1f 100644 --- a/deal.II/examples/step-4/doc/results.dox +++ b/deal.II/examples/step-4/doc/results.dox @@ -7,11 +7,6 @@ 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 @@ -23,22 +18,18 @@ Solving problem in 3 space dimensions. Number of degrees of freedom: 4913 30 CG iterations needed to obtain convergence. @endcode -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 +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 number of rows and columns in the matrix, there are also significantly -more entries per row of the matrix in higher space +more entries per row of the matrix in three 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. 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. +run the program. -The program produces three files: solution-1d.gmv, - solution-2d.gmv and +The program produces two files: solution-2d.gmv and solution-3d.gmv, 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 @@ -107,20 +98,6 @@ 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: - - - - - - - -
- @image html step-4.solution-1d.png - - @image html step-4.grid-1d.png -
- diff --git a/deal.II/examples/step-4/step-4.cc b/deal.II/examples/step-4/step-4.cc index afb3663ae2..d6ff4ec32a 100644 --- a/deal.II/examples/step-4/step-4.cc +++ b/deal.II/examples/step-4/step-4.cc @@ -620,10 +620,9 @@ void LaplaceProblem::output_results () const data_out.build_patches (); - std::ofstream output (dim == 1 ? "solution-1d.gmv" - : (dim == 2 ? + std::ofstream output (dim == 2 ? "solution-2d.gmv" : - "solution-3d.gmv")); + "solution-3d.gmv"); data_out.write_gmv (output); } @@ -651,12 +650,14 @@ void LaplaceProblem::run () // @sect3{The main function} // And this is the main function. It also - // looks mostly like in step-3, we first + // looks mostly like in step-3, but if you + // look at the code below, note how we first // create a variable of type - // LaplaceProblem@<1@> compiling the class template - // with dim replaced by 1) and run a - // 1d simulation. Then, we do the whole - // thing over in 2d and 3d. + // LaplaceProblem@<2@> (forcing the + // compiler to compile the class template + // with dim replaced by 2) and run a + // 2d simulation, and then we do the whole + // thing over in 3d. // // In practice, this is probably not what you // would do very frequently (you probably @@ -723,11 +724,6 @@ void LaplaceProblem::run () int main () { deallog.depth_console (0); - { - LaplaceProblem<1> laplace_problem_1d; - laplace_problem_1d.run (); - } - { LaplaceProblem<2> laplace_problem_2d; laplace_problem_2d.run (); -- 2.39.5