From: bangerth Date: Thu, 5 Oct 2006 02:36:32 +0000 (+0000) Subject: Small last fixes X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5da4d7fb0f3c977a2e73f2bbba7268a6614b51bb;p=dealii-svn.git Small last fixes git-svn-id: https://svn.dealii.org/trunk@13980 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-23/doc/intro.dox b/deal.II/examples/step-23/doc/intro.dox index 98d7b63baf..de59cf8f97 100644 --- a/deal.II/examples/step-23/doc/intro.dox +++ b/deal.II/examples/step-23/doc/intro.dox @@ -352,7 +352,7 @@ conserve the energy, whereas neither the forward nor the backward Euler scheme do. -

Who are Courant, Friedrichs, and Levy?

+

Who are Courant, Friedrichs, and Lewy?

One of the reasons why the wave equation is nasty to solve numerically is that explicit time discretizations are only stable if the time step is small diff --git a/deal.II/examples/step-23/doc/results.dox b/deal.II/examples/step-23/doc/results.dox index 5a952d0472..bffa727292 100644 --- a/deal.II/examples/step-23/doc/results.dox +++ b/deal.II/examples/step-23/doc/results.dox @@ -89,7 +89,8 @@ If you want to explore a bit, try out some of the following things:
  • More complicated domains or more refined meshes. Remember that the time step needs to be bounded by the mesh width, so changing the mesh should - always involve also changing the time step. + always involve also changing the time step. We will come back to this issue + in @ref step_24 "step-24".
  • Variable coefficients: In real media, the wave speed is often variable. In particular, the "real" wave equation in realistic media would diff --git a/deal.II/examples/step-23/step-23.cc b/deal.II/examples/step-23/step-23.cc index c6c8100970..4e8e48d969 100644 --- a/deal.II/examples/step-23/step-23.cc +++ b/deal.II/examples/step-23/step-23.cc @@ -131,18 +131,19 @@ // system_rhs will be // used for whatever right hand side // vector we have when solving one of - // the two linear systems we have to - // solve in each time step. These - // will be solved in the two - // functions solve_u and + // the two linear systems in each + // time step. These will be solved in + // the two functions + // solve_u and // solve_v. // // Finally, the variable // theta is used to // indicate the parameter $\theta$ // that is used to define which time - // stepping scheme to use. The rest - // is self-explanatory. + // stepping scheme to use, as + // explained in the introduction. The + // rest is self-explanatory. template class WaveEquation { @@ -180,16 +181,19 @@ class WaveEquation // @sect3{Equation data} - // Before we go on filling in the details of - // the main class, let us define the equation - // data corresponding to the problem, - // i.e. initial and boundary values for both - // the solution $u$ as well as its time - // derivative $v$, as well as a right hand - // side class. We do so using classes derived - // from the Function class template that has - // been used many times before, so the - // following should not be a surprise. + // Before we go on filling in the + // details of the main class, let us + // define the equation data + // corresponding to the problem, + // i.e. initial and boundary values + // for both the solution $u$ and its + // time derivative $v$, as well as a + // right hand side class. We do so + // using classes derived from the + // Function class template that has + // been used many times before, so + // the following should not be a + // surprise. // // Let's start with initial values // and choose zero for both the value @@ -346,7 +350,7 @@ double BoundaryValuesV::value (const Point &p, // Let's start with the constructor (for an // explanation of the choice of time step, // see the section on Courant, Friedrichs, - // and Levy in the introduction): + // and Lewy in the introduction): template WaveEquation::WaveEquation () : fe (1), @@ -358,12 +362,15 @@ WaveEquation::WaveEquation () : // @sect4{WaveEquation::setup_system} - // The next function is the one that sets up - // the mesh, DoFHandler, and matrices and - // vectors at the beginning of the program, - // i.e. before the first time step. The first - // few lines are pretty much standard if - // you've read at least to step-6: + // The next function is the one that + // sets up the mesh, DoFHandler, and + // matrices and vectors at the + // beginning of the program, + // i.e. before the first time + // step. The first few lines are + // pretty much standard if you've + // read through the tutorial programs + // at least up to step-6: template void WaveEquation::setup_system () { @@ -372,7 +379,7 @@ void WaveEquation::setup_system () std::cout << "Number of active cells: " << triangulation.n_active_cells() - << std::endl; + << std::endl; dof_handler.distribute_dofs (fe); @@ -410,20 +417,24 @@ void WaveEquation::setup_system () // memory on it several times. // // After initializing all of these - // matrices, we call library functions that - // build the Laplace and mass matrices. All - // they need is a DoFHandler object and a - // quadrature formula object that is to be - // used for numerical integration. Note - // that in many respect these functions are - // better than what we would usually do in - // application programs, as these functions - // for example automatically parallelize - // building the matrices if multiple - // processors are available in a - // machine. When we have both of these - // matrices, we form the third one by - // copying and adding the first two in + // matrices, we call library + // functions that build the Laplace + // and mass matrices. All they need + // is a DoFHandler object and a + // quadrature formula object that + // is to be used for numerical + // integration. Note that in many + // respects these functions are + // better than what we would + // usually do in application + // programs, for example because + // they automatically parallelize + // building the matrices if + // multiple processors are + // available in a machine. When we + // have both of these matrices, we + // form the third one by copying + // and adding the first two in // appropriate multiples: system_matrix.reinit (sparsity_pattern); mass_matrix.reinit (sparsity_pattern); @@ -672,15 +683,19 @@ void WaveEquation::run () solve_u (); - // The second step, i.e. solving for - // $V^n$, works similarly, except that - // this time the matrix on the left is - // the mass matrix, the right hand side - // is $MV^{n-1} - k\left[ \theta A U^n - // + (1-\theta) AU^{n-1}\right]$ plus - // forcing terms. Boundary values are - // applied in the same way as before, - // except that now we have to use the + // The second step, + // i.e. solving for $V^n$, + // works similarly, except that + // this time the matrix on the + // left is the mass matrix, and + // the right hand side is + // $MV^{n-1} - k\left[ \theta A + // U^n + (1-\theta) + // AU^{n-1}\right]$ plus + // forcing terms. %Boundary + // values are applied in the + // same way as before, except + // that now we have to use the // BoundaryValuesV class: laplace_matrix.vmult (system_rhs, solution_u); system_rhs *= -theta * time_step;