From 1391a66541d729a071a300205cd617843a2870aa Mon Sep 17 00:00:00 2001 From: schrage Date: Thu, 29 Apr 1999 13:58:54 +0000 Subject: [PATCH] Additions to the text. git-svn-id: https://svn.dealii.org/trunk@1224 0785d39b-7218-0410-832d-ea1e28bc413d --- .../tutorial/chapter-1.elements/condense.html | 4 +- .../chapter-1.elements/matrix_generation.html | 56 ++----------------- .../chapter-1.elements/matrix_structure.html | 16 +++--- .../doc/tutorial/chapter-1.elements/rhs.html | 12 ++-- 4 files changed, 21 insertions(+), 67 deletions(-) diff --git a/deal.II/doc/tutorial/chapter-1.elements/condense.html b/deal.II/doc/tutorial/chapter-1.elements/condense.html index cfbbc4a0cc..49c92e9fd5 100644 --- a/deal.II/doc/tutorial/chapter-1.elements/condense.html +++ b/deal.II/doc/tutorial/chapter-1.elements/condense.html @@ -67,13 +67,13 @@ function calls needed. Be sure to use them in their appropriate places. #include <grid/dof_constraints.h> int dim=2; // Work in two dimensions, could also be three -SparseMatrixStruct<double> smstruct; +SparseMatrixStruct<double> sparsity_pattern; DoFHandler<dim> dof; ConstraintMatrix<dim> hanging_nodes; hanging_nodes.clear(); -dof.make_sparsity_pattern(smstruct); +dof.make_sparsity_pattern(sparsity_pattern); dof.make_hanging_nodes_constraints(hanging_nodes); dof.constraints.close(); hanging_nodes.condense(matrix_structure); diff --git a/deal.II/doc/tutorial/chapter-1.elements/matrix_generation.html b/deal.II/doc/tutorial/chapter-1.elements/matrix_generation.html index 2446786e06..d295c36c3d 100644 --- a/deal.II/doc/tutorial/chapter-1.elements/matrix_generation.html +++ b/deal.II/doc/tutorial/chapter-1.elements/matrix_generation.html @@ -27,10 +27,6 @@ There are several kinds of matrices we will deal with: cells have non-zero values.
  • -Block sparse matrices where the matrix is assumed to -consist of blocks on the diagonal. -
  • -
  • Sparse matrices, i.e. matrices where the majority of cells has zero value.
  • @@ -90,62 +86,20 @@ appropriate places. This example initializes a sparse square matrix structure. int dim=2; // For example -SparseMatrixStruct<double> smstruct; +SparseMatrixStruct<double> sparsity_pattern; SparseMatrix<double> sm; DoFHandler<dim> dof; // Your degrees of freedom must already be distributed -smstruct.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs()); - -// If your grid is locally refined, condense the hanging nodes into the -// structure. - -smstruct.compress(); - -sm.reinit(smstruct); - - - -

    The block sparse matrix

    - -

    -A block matrix is assumed to consist of blocks on the diagonal with all -the blocks having the same size. -It is initialized using -BlockSparseMatrix::reinit(const SparseMatrixStruct &sparsity) -Since this is a sparse matrix, i.e. a matrix that can be -stored efficiently, we need to generate a matrix structure first, like for the -sparse matrix. In fact, the block sparse matrix is just a specialization of -the sparse matrix. -

    - -

    -Example: We show the include files you need, -the definitions and the function calls. Make sure to use them in their -appropriate places. -

    -
    -
    -#include <grid/dof.h>
    -#include <lac/blocksparsematrix.h>
    -
    -int dim=2; // 2 Dimensions, could also be three
    -SparseMatrixStruct<double> smstruct;
    -DoFHandler<dim> dof;
    -BlockSparseMatrix<double> A;
    -
    -
    -// Your degrees of freedom must already be distributed
    -
    -smstruct.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs());
    +sparsity_pattern.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs());
     
    -// If your grid is locally refined, condense the hanging nodes into the
    +// If your grid is locally refined, condense the hanging nodes into the
     // structure.
     
    -smstruct.compress();
    +sparsity_pattern.compress();
     
    -A.reinit(smstruct);
    +sm.reinit(sparsity_pattern);
     
     
    diff --git a/deal.II/doc/tutorial/chapter-1.elements/matrix_structure.html b/deal.II/doc/tutorial/chapter-1.elements/matrix_structure.html index b4be08b593..f3a21e92cd 100644 --- a/deal.II/doc/tutorial/chapter-1.elements/matrix_structure.html +++ b/deal.II/doc/tutorial/chapter-1.elements/matrix_structure.html @@ -52,7 +52,7 @@ matrix given by the hanging nodes.

    -Example: We show the include files you need, +Example: We show the include files you need, the definitions and the function calls. Make sure to use them in their appropriate places. This example initializes a sparse square matrix structure.

    @@ -63,13 +63,13 @@ appropriate places. This example initializes a sparse square matrix structure. int dim=2; // For example -SparseMatrixStruct<double> smstruct; +SparseMatrixStruct<double> sparsity_pattern; DoFHandler<dim> dof; ConstraintMatrix hanging_nodes; // Only necessary for locally refined grids // Your degrees of freedom must already be distributed -smstruct.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs()); +sparsity_pattern.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs()); // Condense the hanging nodes into // the matrix, taking into account the constraints to the hanging nodes. @@ -77,10 +77,10 @@ smstruct.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs()); // on locally refined grids. // You can skip this part if your grid is not locally refined. -dof.make_sparsity_pattern(smstruct); +dof.make_sparsity_pattern(sparsity_pattern); hanging_nodes.clear(); dof.make_constraint_matrix(hanging_nodes); -hanging_nodes.condense(smstruct); +hanging_nodes.condense(sparsity_pattern); @@ -112,12 +112,12 @@ The appropriate function is void SparseMatrixStruct::compress().

    -Example: Starting from the example above, we -compress our matrix structure smstruct. +Example: Starting from the example above, we +compress our matrix structure sparsity_pattern.

     
    -smstruct.compress();
    +sparsity_pattern.compress();
     
     
    diff --git a/deal.II/doc/tutorial/chapter-1.elements/rhs.html b/deal.II/doc/tutorial/chapter-1.elements/rhs.html index 8d15cdc412..289c6b592e 100644 --- a/deal.II/doc/tutorial/chapter-1.elements/rhs.html +++ b/deal.II/doc/tutorial/chapter-1.elements/rhs.html @@ -120,16 +120,16 @@ for (DoFHandler<2>::active_cell_iterator c = dof.begin_active() fevalues.reinit(c, stb); elmat.clear(); elvec.clear(); - c->get_dof_indices(indices); + c->get_dof_indices(indices); - for (unsigned k=0;k