From 236a2b95102ce1a4a756bc803325dfe658ba1921 Mon Sep 17 00:00:00 2001 From: young Date: Fri, 18 Jan 2013 19:35:15 +0000 Subject: [PATCH] Update step-36 to output the number of iterations taken by the solver. git-svn-id: https://svn.dealii.org/trunk@28134 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-36/doc/results.dox | 13 +++++++------ deal.II/examples/step-36/step-36.cc | 20 ++++++++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/deal.II/examples/step-36/doc/results.dox b/deal.II/examples/step-36/doc/results.dox index a24f0d6bab..02e756fd9c 100644 --- a/deal.II/examples/step-36/doc/results.dox +++ b/deal.II/examples/step-36/doc/results.dox @@ -21,14 +21,15 @@ examples/\step-36> make run ============================ Running \step-36 Number of active cells: 1024 Number of degrees of freedom: 1089 + Solver converged in 67 iterations. - Eigenvalue 0 : 4.93877 - Eigenvalue 1 : 12.3707 - Eigenvalue 2 : 12.3707 - Eigenvalue 3 : 19.8027 - Eigenvalue 4 : 24.837 + Eigenvalue 0 : 4.93877 + Eigenvalue 1 : 12.3707 + Eigenvalue 2 : 12.3707 + Eigenvalue 3 : 19.8027 + Eigenvalue 4 : 24.837 -Job done. @endcode These eigenvalues are exactly the ones that + Job done. @endcode These eigenvalues are exactly the ones that correspond to pairs $(m,n)=(1,1)$, $(1,2)$ and $(2,1)$, $(2,2)$, and $(3,1)$. A visualization of the corresponding eigenfunctions would look like this: diff --git a/deal.II/examples/step-36/step-36.cc b/deal.II/examples/step-36/step-36.cc index 8ade9f3521..bce17c5bb5 100644 --- a/deal.II/examples/step-36/step-36.cc +++ b/deal.II/examples/step-36/step-36.cc @@ -68,7 +68,7 @@ namespace Step36 private: void make_grid_and_dofs (); void assemble_system (); - void solve (); + unsigned int solve (); void output_results () const; Triangulation triangulation; @@ -110,6 +110,7 @@ namespace Step36 fe (1), dof_handler (triangulation) { +//TODO investigate why the minimum number of refinement steps required to obtain the correct eigenvalue degeneracies is 6 parameters.declare_entry ("Global mesh refinement steps", "5", Patterns::Integer (0, 20), "The number of times the 1-cell coarse mesh should " @@ -295,7 +296,7 @@ namespace Step36 // the kind of solver we want. Here we choose the Krylov-Schur solver of // SLEPc, a pretty fast and robust choice for this kind of problem: template - void EigenvalueProblem::solve () + unsigned int EigenvalueProblem::solve () { // We start here, as we normally do, by assigning convergence control we @@ -338,6 +339,9 @@ namespace Step36 // equality is usually nearly true). for (unsigned int i=0; i