From 4ee44f58b4dff9b749cdd706c9c2682d36e3ad5b Mon Sep 17 00:00:00 2001 From: zamni Date: Mon, 27 Mar 2000 06:47:55 +0000 Subject: [PATCH] Add text. Other small changes. git-svn-id: https://svn.dealii.org/trunk@2632 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-3/step-3.cc | 31 +++++++++++++++++++++---------- deal.II/examples/step-4/step-4.cc | 4 ++-- deal.II/examples/step-5/step-5.cc | 27 ++++++++++++++++++--------- deal.II/examples/step-6/step-6.cc | 18 +++++++++--------- 4 files changed, 50 insertions(+), 30 deletions(-) diff --git a/deal.II/examples/step-3/step-3.cc b/deal.II/examples/step-3/step-3.cc index 990d8e46a4..9f30b5fb15 100644 --- a/deal.II/examples/step-3/step-3.cc +++ b/deal.II/examples/step-3/step-3.cc @@ -118,7 +118,10 @@ class LaplaceProblem // variables. There are variables // describing the triangulation // and the numbering of the - // degrees of freedom... + // degrees of freedom... The + // FEQ<2> is the space which + // has the following base + // functions: {1,x,y,xy} Triangulation<2> triangulation; FEQ1<2> fe; DoFHandler<2> dof_handler; @@ -352,7 +355,11 @@ void LaplaceProblem::assemble_system () // (Jacobians times weights, or // short JxW) are computed; since // we also need them, we have to - // list them as well: + // list them as well. The advantage + // of this proceeding is that we + // calculate only what we + // need. This optimates the process + // of solving: FEValues<2> fe_values (fe, quadrature_formula, UpdateFlags(update_values | update_gradients | @@ -403,7 +410,7 @@ void LaplaceProblem::assemble_system () // degrees of freedom on the // present cell, and only transfer // them to the global matrix when - // the copmutations are finished + // the computations are finished // for this cell. We do the same // for the right hand side vector, // although access times are not so @@ -422,11 +429,11 @@ void LaplaceProblem::assemble_system () // global matrix, we have to know // the global numbers of the // degrees of freedom. When we get - // them, we need a scratch array + // them, we need a scratch (temporal) array // for these numbers: vector local_dof_indices (dofs_per_cell); - // Now for th loop over all + // Now for the loop over all // cells. You have seen before how // this works, so this should be // familiar to you: @@ -614,7 +621,11 @@ void LaplaceProblem::assemble_system () // therefore, if we give `0' as the // desired portion of the boundary, // this means we get the whole - // boundary. + // boundary. If you got different + // boundaries, you have to number + // them differently and have to be + // attentive when using the method + // above. // // The function describing the // boundary values is an object of @@ -699,8 +710,8 @@ void LaplaceProblem::solve () // PrimitiveVectorMemory class is // such a helper class which the // solver can ask for memory. The - // angle brackets indicate that - // this class really takes a + // angle brackets ``<>''indicate + // that this class really takes a // template parameter (here the // data type of the vectors we // use), which however has a @@ -766,12 +777,12 @@ void LaplaceProblem::output_results () const // After the DataOut object knows // which data it is to work on, we // have to tell it to process them - // into something the backends can + // into something the back ends can // handle. The reason is that we // have separated the frontend // (which knows about how to treat // DoFHandler objects and data - // vectors) from the backend (which + // vectors) from the back end (which // knows several output formats) // and use an intermediate data // format to transfer data from the diff --git a/deal.II/examples/step-4/step-4.cc b/deal.II/examples/step-4/step-4.cc index bac3800554..94d1e2e1ac 100644 --- a/deal.II/examples/step-4/step-4.cc +++ b/deal.II/examples/step-4/step-4.cc @@ -287,7 +287,7 @@ void LaplaceProblem::make_grid_and_dofs () // assemblage of the matrix and right // hand side. // - // More interesting, though, is they + // More interesting, though, is the // way we assemble matrix and right // hand side vector dimension // independently: there is simply no @@ -489,7 +489,7 @@ void LaplaceProblem::solve () // This function also does what the // respective one did in the previous // example. No changes here for - // dimension independentce either. + // dimension independence either. template void LaplaceProblem::output_results () const { diff --git a/deal.II/examples/step-5/step-5.cc b/deal.II/examples/step-5/step-5.cc index a131374b86..a0aafa3c3d 100644 --- a/deal.II/examples/step-5/step-5.cc +++ b/deal.II/examples/step-5/step-5.cc @@ -300,8 +300,8 @@ void LaplaceProblem::setup_system () // as the preconditions CG method), // assembling the matrix and right // hand side can take a comparable - // time, and it is worth the effort - // to use one or two optimizations at + // time, and you should thing about + // using one or two optimizations at // some places. // // What we will show here is how we @@ -389,7 +389,7 @@ void LaplaceProblem::assemble_system () // get the address as follows // (note that this is a // reference to the matrix, - // symbolized by the ampersand, + // symbolized by the ampersand ``&'', // and that it must be a // constant reference, since // only read-only access is @@ -402,7 +402,7 @@ void LaplaceProblem::assemble_system () // shape_values(j,q), i.e. the // function call needed // previously for each access - // has been otimized away. + // has been optimized away. // // There are alike functions // for almost all data elements @@ -788,12 +788,14 @@ void LaplaceProblem::run () // ask it to read the // file). Then we open the // respective file and fill the - // triangulation with it: + // triangulation with it + // because you like to work + // with it: if (cycle == 0) { GridIn grid_in; grid_in.attach_triangulation (triangulation); - + ifstream input_file("circle-grid.inp"); // We would now like to // read the file. However, // the input file is only @@ -845,12 +847,19 @@ void LaplaceProblem::run () // We can now actually read // the grid. It is in UCD // (unstructured cell data) - // format, as supported by - // AVS Explorer, for + // format (but the ending + // of the ``UCD''-file is + // ``inp''), as supported + // by AVS Explorer, for // example: - ifstream input_file("circle-grid.inp"); + grid_in.read_ucd (input_file); + // If you like to use other + // input format, you have + // to use an other + // grid_in.read_``blabla'' + // funktion. // The grid in the file // describes a // circle. Therefore we diff --git a/deal.II/examples/step-6/step-6.cc b/deal.II/examples/step-6/step-6.cc index 0629bdc820..acddb69ea6 100644 --- a/deal.II/examples/step-6/step-6.cc +++ b/deal.II/examples/step-6/step-6.cc @@ -32,10 +32,9 @@ // which in analogy to ``FEQ1'' for // the linear element is called // ``FEQ2''. The Lagrange elements of - // poynomial degrees one through four + // polynomial degrees one through four // are all declared in this file. #include - // We will not read the grid from a // file as in the previous example, // but generate it using a function @@ -215,7 +214,7 @@ LaplaceProblem::LaplaceProblem () : // re-distributed using another // finite element object or until the // ``dof_handler'' object is - // detroyed, it would be unwise if we + // destroyed, it would be unwise if we // would allow the finite element // object to be deleted before // ``dof_handler'' object. To @@ -264,7 +263,7 @@ LaplaceProblem::LaplaceProblem () : // situation, if we did not write // this destructor, the compiler will // generate code that triggers - // exactly the behavious sketched + // exactly the behaviour sketched // above. The reason is that member // variables of the // ``LaplaceProblem'' class are @@ -386,7 +385,7 @@ void LaplaceProblem::setup_system () // functions that eliminate them // are called ``condense'' for both // the system matrix and right hand - // side, as well as for teh + // side, as well as for the // sparsity pattern. hanging_node_constraints.condense (sparsity_pattern); @@ -447,8 +446,9 @@ void LaplaceProblem::assemble_system () // introduced an abbreviation for // the number of degrees of freedom // per cell before: the following - // value will be set to 9 (in 2D) - // now, where it was 4 before. + // value will be set to 9 (in 2D + // because of Q2S) now, where it was + // 4 before. const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.n_quadrature_points; @@ -655,7 +655,7 @@ void LaplaceProblem::refine_grid () // conditions. For this, it needs // to know which parts of the // boundary have Neumann boundary - // conditions and teh respective + // conditions and the respective // boundary values there. This // information is mediated by a map // in which the keys are the @@ -923,7 +923,7 @@ void LaplaceProblem::run () // not constitute programming errors, // these exceptions also are not // switched off in optimized mode, in - // constrast to the ``Assert'' macro + // contrast to the ``Assert'' macro // which we have used to test against // programming errors. If uncought, // these exceptions propagate the -- 2.39.5