// 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;
// (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 |
// 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
// 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<unsigned int> 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:
// 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
// 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
// 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
// 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
// This function also does what the
// respective one did in the previous
// example. No changes here for
- // dimension independentce either.
+ // dimension independence either.
template <int dim>
void LaplaceProblem<dim>::output_results () const
{
// 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
// 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
// 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
// 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<dim> 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
// 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
// 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 <fe/fe_lib.lagrange.h>
-
// We will not read the grid from a
// file as in the previous example,
// but generate it using a function
// 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
// 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
// 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);
// 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;
// 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
// 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