]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Integrate the CompressedSetSparsityPattern class fully into the library. Create a...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Jun 2007 14:52:01 +0000 (14:52 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Jun 2007 14:52:01 +0000 (14:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@14783 0785d39b-7218-0410-832d-ea1e28bc413d

39 files changed:
deal.II/deal.II/include/dofs/dof_constraints.h
deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/include/dofs/dof_tools.h
deal.II/deal.II/include/hp/dof_handler.h
deal.II/deal.II/source/dofs/dof_constraints.cc
deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/deal.II/source/multigrid/mg_dof_tools.cc
deal.II/doc/doxygen/headers/matrices.h
deal.II/doc/doxygen/headers/preconditioners.h
deal.II/doc/doxygen/headers/solvers.h
deal.II/doc/news/changes.html
deal.II/examples/step-27/step-27.cc
deal.II/lac/include/lac/block_sparsity_pattern.h
deal.II/lac/include/lac/compressed_set_sparsity_pattern.h
deal.II/lac/include/lac/compressed_sparsity_pattern.h
deal.II/lac/include/lac/petsc_block_sparse_matrix.h
deal.II/lac/include/lac/petsc_block_vector.h
deal.II/lac/include/lac/petsc_full_matrix.h
deal.II/lac/include/lac/petsc_matrix_base.h
deal.II/lac/include/lac/petsc_parallel_block_sparse_matrix.h
deal.II/lac/include/lac/petsc_parallel_block_vector.h
deal.II/lac/include/lac/petsc_parallel_sparse_matrix.h
deal.II/lac/include/lac/petsc_parallel_vector.h
deal.II/lac/include/lac/petsc_sparse_matrix.h
deal.II/lac/include/lac/petsc_vector.h
deal.II/lac/include/lac/petsc_vector_base.h
deal.II/lac/include/lac/sparsity_pattern.h
deal.II/lac/source/block_sparsity_pattern.cc
deal.II/lac/source/sparsity_pattern.cc
tests/bits/dof_constraints_11.cc
tests/bits/dof_tools_01d.cc
tests/bits/dof_tools_02d.cc
tests/bits/dof_tools_15d.cc
tests/bits/dof_tools_16d.cc
tests/bits/dof_tools_17d.cc
tests/bits/dof_tools_18d.cc
tests/deal.II/sparsity_pattern.cc
tests/deal.II/sparsity_pattern_01.cc
tests/deal.II/sparsity_pattern_05.cc

index 3b1cfb8d8f4f830dd1fd1350b15c5f1289caf5c8..9d815b535c0da6d983eeecbed007bf48ebc9987d 100644 (file)
@@ -30,7 +30,8 @@ class SparsityPattern;
 class CompressedSparsityPattern;
 class CompressedSetSparsityPattern;
 class BlockSparsityPattern;
-class CompressedBlockSparsityPattern;
+class BlockCompressedSparsityPattern;
+class BlockCompressedSetSparsityPattern;
 template <typename number> class SparseMatrix;
 template <typename number> class BlockSparseMatrix;
 class BlockIndices;
@@ -689,15 +690,20 @@ class ConstraintMatrix : public Subscriptor
                                      */
     void condense (CompressedSetSparsityPattern &sparsity) const;
 
-    void condense_fast (CompressedSparsityPattern &sparsity) const;
-
                                     /**
                                      * Same function as above, but
                                      * condenses square compressed
                                      * sparsity patterns.
                                      */
-    void condense (CompressedBlockSparsityPattern &sparsity) const;
+    void condense (BlockCompressedSparsityPattern &sparsity) const;
 
+                                    /**
+                                     * Same function as above, but
+                                     * condenses square compressed
+                                     * sparsity patterns.
+                                     */
+    void condense (BlockCompressedSetSparsityPattern &sparsity) const;
+    
     
                                     /**
                                      * Condense a given matrix. The associated
index 55283f2ceee6c568ef0d6493457f0a09bfa8915c..b2115f03bd489a54b8797ab91bec277866e775e5 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -282,7 +282,7 @@ class DoFHandler  :  public Subscriptor
                                      * on the finite element and the maximum
                                      * number of cells meeting at a vertex.
                                      * The number holds for the constrained
-                                     * matrix also.
+                                     * matrix as well.
                                      *
                                      * The determination of the number of
                                      * couplings can be done by simple
@@ -290,31 +290,27 @@ class DoFHandler  :  public Subscriptor
                                      * found in the implementation of this
                                      * function.
                                      *
-                                     * Note that this function is
-                                     * most often used to determine
-                                     * the maximal row length for
-                                     * sparsity
-                                     * patterns. Unfortunately, the
-                                     * while the estimates returned
-                                     * by this function are rather
-                                     * accurate in 1d and 2d, they
-                                     * are often significantly too
-                                     * high in 3d, leading the
-                                     * SparsityPattern class to
-                                     * allocate much too much memory
-                                     * in some cases. Unless someone
-                                     * comes around to improving the
-                                     * present function for 3d, there
-                                     * is not very much one can do
-                                     * about these cases. The typical
-                                     * way to work around this
-                                     * problem is to use an
-                                     * intermediate compressed
-                                     * sparsity pattern that only
-                                     * allocates memory on
-                                     * demand. Refer to the @ref
-                                     * step_11 "step-11" example
-                                     * program on how to do this.
+                                     * Note that this function is most often
+                                     * used to determine the maximal row
+                                     * length for sparsity
+                                     * patterns. Unfortunately, while the
+                                     * estimates returned by this function
+                                     * are rather accurate in 1d and 2d, they
+                                     * are often significantly too high in
+                                     * 3d, leading the SparsityPattern class
+                                     * to allocate much too much memory in
+                                     * some cases. Unless someone comes
+                                     * around to improving the present
+                                     * function for 3d, there is not very
+                                     * much one can do about these cases. The
+                                     * typical way to work around this
+                                     * problem is to use an intermediate
+                                     * compressed sparsity pattern that only
+                                     * allocates memory on demand. Refer to
+                                     * the @ref step_11 "step-11" example
+                                     * program on how to do this. The problem
+                                     * is also discussed in the documentation
+                                     * of the module on @ref Sparsity.
                                      */
     unsigned int max_couplings_between_dofs () const;
 
index af9d21d4aa98f9069923d76fad3e7734a178a683..51048a1c0915b32de9feb195a6cadcfc7e24f521 100644 (file)
@@ -383,7 +383,8 @@ class DoFTools
                                      * SparsityPattern,
                                      * CompressedSparsityPattern,
                                      * BlockSparsityPattern,
-                                     * CompressedBlockSparsityPattern,
+                                     * BlockCompressedSparsityPattern,
+                                     * BlockCompressedSetSparsityPattern,
                                      * or any other class that
                                      * satisfies similar
                                      * requirements. It is assumed
@@ -468,7 +469,8 @@ class DoFTools
                                      * SparsityPattern,
                                      * CompressedSparsityPattern,
                                      * BlockSparsityPattern,
-                                     * CompressedBlockSparsityPattern,
+                                     * BlockCompressedSparsityPattern,
+                                     * BlockCompressedSetSparsityPattern,
                                      * or any other class that
                                      * satisfies similar
                                      * requirements.
@@ -560,8 +562,9 @@ class DoFTools
                                      * pattern may be SparsityPattern,
                                      * CompressedSparsityPattern,
                                      * BlockSparsityPattern,
-                                     * CompressedBlockSparsityPattern, or any
-                                     * other class that satisfies similar
+                                     * BlockCompressedSparsityPattern,
+                                     * BlockCompressedSetSparsityPattern, or
+                                     * any other class that satisfies similar
                                      * requirements. It is assumed that the
                                      * size of the sparsity pattern is
                                      * already correct.
index caea3b6ae3564cb46d1f3cfa29574b4d6d68516c..82014169e4b2da275952e53ff93b187849e79ce5 100644 (file)
@@ -221,11 +221,13 @@ namespace hp
                                         * The number holds for the constrained
                                         * matrix also.
                                         *
-                                        * The determination of the number of
-                                        * couplings can be done by simple
-                                        * picture drawing. An example can be
-                                        * found in the implementation of this
-                                        * function.
+                                        * As for
+                                        * DoFHandler::max_couplings_between_dofs(),
+                                        * the result of this function is often
+                                        * not very accurate for 3d and/or high
+                                        * polynomial degrees. The consequences
+                                        * are discussed in the documentation
+                                        * of the module on @ref Sparsity.
                                         */
       unsigned int max_couplings_between_dofs () const;
 
index a895f2e7df016ca4db14c3ec049a48658feacdc9..77aa393b69434e5dc17a0fb95db0cb80a527afdd 100644 (file)
@@ -1044,104 +1044,6 @@ void ConstraintMatrix::condense (CompressedSparsityPattern &sparsity) const
 }
 
 
-
-void ConstraintMatrix::condense_fast (CompressedSparsityPattern &sparsity) const
-{
-  /*
-  Assert (sorted == true, ExcMatrixNotClosed());
-  Assert (sparsity.n_rows() == sparsity.n_cols(),
-         ExcNotQuadratic());
-  
-                                  // store for each index whether it must be
-                                  // distributed or not. If entry is
-                                  // deal_II_numbers::invalid_unsigned_int,
-                                  // no distribution is necessary.
-                                  // otherwise, the number states which line
-                                  // in the constraint matrix handles this
-                                  // index
-  std::vector<unsigned int> distribute(sparsity.n_rows(),
-                                       deal_II_numbers::invalid_unsigned_int);
-  
-  for (unsigned int c=0; c<lines.size(); ++c)
-    distribute[lines[c].line] = c;
-
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
-    {
-      // First copy entries to local cache data structure;
-      std::set<unsigned int> row_cache;
-      for (unsigned int j=0; j<sparsity.row_length(row); ++j)
-       row_cache.insert (sparsity.column_number(row,j));
-
-      if (distribute[row] == deal_II_numbers::invalid_unsigned_int)
-       {
-         // regular line. loop over
-         // cols. note that as we
-         // proceed to distribute
-         // cols, the loop may get
-                                        // longer
-         std::set<unsigned int>::iterator col_num = row_cache.begin ();
-         
-         for (; col_num != row_cache.end (); ++col_num)
-           {
-             const unsigned int column = *col_num;
-             
-             if (distribute[column] != deal_II_numbers::invalid_unsigned_int)
-               {
-                 // row
-                 for (unsigned int q=0;
-                      q!=lines[distribute[column]].entries.size();
-                      ++q) 
-                   {
-                     const unsigned int
-                       new_col = lines[distribute[column]].entries[q].first;
-                     
-                     sparsity.add (row, new_col);
-                   };
-               };
-           }
-       }
-      else
-       // row must be distributed
-       {
-         std::set<unsigned int>::iterator col_num = row_cache.begin ();
-         
-         for (; col_num != row_cache.end (); ++col_num)
-           {
-             const unsigned int column = *col_num;
-             
-             if (distribute[column] == deal_II_numbers::invalid_unsigned_int)
-               // distribute entry at irregular
-               // row @p{row} and regular column
-               // sparsity.colnums[j]
-               for (unsigned int q=0;
-                    q!=lines[distribute[row]].entries.size(); ++q) 
-                 sparsity.add (lines[distribute[row]].entries[q].first,
-                               column);
-             else
-               // distribute entry at irregular
-               // row @p{row} and irregular column
-               // sparsity.get_column_numbers()[j]
-               for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
-                 for (unsigned int q=0;
-                      q!=lines[distribute[column]]
-                        .entries.size(); ++q)
-                   sparsity.add (lines[distribute[row]].entries[p].first,
-                                 lines[distribute[column]]
-                                 .entries[q].first);
-           };
-       }
-
-      // Now copy stuff back to sparsity pattern
-      std::set<unsigned int>::iterator col_num = row_cache.begin ();     
-      for (; col_num != row_cache.end (); ++col_num)
-       {
-       }
-    };
-  */
-}
-
-
 void ConstraintMatrix::condense (CompressedSetSparsityPattern &sparsity) const
 {
   Assert (sorted == true, ExcMatrixNotClosed());
@@ -1166,12 +1068,11 @@ void ConstraintMatrix::condense (CompressedSetSparsityPattern &sparsity) const
     {
       if (distribute[row] == deal_II_numbers::invalid_unsigned_int)
        {
-         // regular line. loop over
-         // cols. note that as we
-         // proceed to distribute
-         // cols, the loop may get
-                                        // longer
-         CompressedSetSparsityPattern::CSSPIterator col_num = sparsity.row_begin (row);
+                                          // regular line. loop over
+                                          // cols. note that as we proceed to
+                                          // distribute cols, the loop may
+                                          // get longer
+         CompressedSetSparsityPattern::row_iterator col_num = sparsity.row_begin (row);
          
          for (; col_num != sparsity.row_end (row); ++col_num)
            {
@@ -1201,7 +1102,7 @@ void ConstraintMatrix::condense (CompressedSetSparsityPattern &sparsity) const
       else
        // row must be distributed
        {
-         CompressedSetSparsityPattern::CSSPIterator col_num = sparsity.row_begin (row);
+         CompressedSetSparsityPattern::row_iterator col_num = sparsity.row_begin (row);
          
          for (; col_num != sparsity.row_end (row); ++col_num)
            {
@@ -1360,7 +1261,7 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
 
 
 
-void ConstraintMatrix::condense (CompressedBlockSparsityPattern &sparsity) const
+void ConstraintMatrix::condense (BlockCompressedSparsityPattern &sparsity) const
 {
   Assert (sorted == true, ExcMatrixNotClosed());
   Assert (sparsity.n_rows() == sparsity.n_cols(),
@@ -1702,8 +1603,12 @@ add_entries_local_to_global<BlockSparsityPattern> (const std::vector<unsigned in
                                              BlockSparsityPattern       &,
                                              const bool) const;
 template void ConstraintMatrix::
-add_entries_local_to_global<CompressedBlockSparsityPattern> (const std::vector<unsigned int> &,
-                                             CompressedBlockSparsityPattern       &,
+add_entries_local_to_global<BlockCompressedSparsityPattern> (const std::vector<unsigned int> &,
+                                             BlockCompressedSparsityPattern       &,
+                                             const bool) const;
+template void ConstraintMatrix::
+add_entries_local_to_global<BlockCompressedSetSparsityPattern> (const std::vector<unsigned int> &,
+                                             BlockCompressedSetSparsityPattern       &,
                                              const bool) const;
 
 
index 30e0f478698c9fc1e1254f2f9f163739d8c8d816..b6a1d0ffc4427ff242bbc9b8b838af73739b17d2 100644 (file)
@@ -4972,6 +4972,12 @@ DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
  CompressedSparsityPattern    &sparsity,
  const ConstraintMatrix &);
 template void
+DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
+                               CompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension> &dof,
+ CompressedSetSparsityPattern    &sparsity,
+ const ConstraintMatrix &);
+template void
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
                                BlockSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
@@ -4979,9 +4985,15 @@ DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
  const ConstraintMatrix &);
 template void
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
-                               CompressedBlockSparsityPattern>
+                               BlockCompressedSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
- CompressedBlockSparsityPattern      &sparsity,
+ BlockCompressedSparsityPattern      &sparsity,
+ const ConstraintMatrix &);
+template void
+DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
+                               BlockCompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension> &dof,
+ BlockCompressedSetSparsityPattern      &sparsity,
  const ConstraintMatrix &);
 
 template void
@@ -5015,9 +5027,15 @@ DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
  const ConstraintMatrix &);
 template void
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
-                               CompressedBlockSparsityPattern>
+                               BlockCompressedSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension> &dof,
+ BlockCompressedSparsityPattern      &sparsity,
+ const ConstraintMatrix &);
+template void
+DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
+                               BlockCompressedSetSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension> &dof,
CompressedBlockSparsityPattern      &sparsity,
BlockCompressedSetSparsityPattern      &sparsity,
  const ConstraintMatrix &);
 
 
@@ -5034,6 +5052,12 @@ DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
  const Table<2,Coupling>&,
  CompressedSparsityPattern&);
 template void 
+DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
+                               CompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension>&,
+ const Table<2,Coupling>&,
+ CompressedSetSparsityPattern&);
+template void 
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
                                BlockSparsityPattern>
 (const DoFHandler<deal_II_dimension>&,
@@ -5041,10 +5065,16 @@ DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
  BlockSparsityPattern&);
 template void 
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
-                               CompressedBlockSparsityPattern>
+                               BlockCompressedSparsityPattern>
+(const DoFHandler<deal_II_dimension>&,
+ const Table<2,Coupling>&,
+ BlockCompressedSparsityPattern&);
+template void 
+DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
+                               BlockCompressedSetSparsityPattern>
 (const DoFHandler<deal_II_dimension>&,
  const Table<2,Coupling>&,
CompressedBlockSparsityPattern&);
BlockCompressedSetSparsityPattern&);
 
 
 template void 
@@ -5060,6 +5090,12 @@ DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
  const Table<2,Coupling>&,
  CompressedSparsityPattern&);
 template void 
+DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
+                               CompressedSetSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension>&,
+ const Table<2,Coupling>&,
+ CompressedSetSparsityPattern&);
+template void 
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
                                BlockSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension>&,
@@ -5067,10 +5103,16 @@ DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
  BlockSparsityPattern&);
 template void 
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
-                               CompressedBlockSparsityPattern>
+                               BlockCompressedSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension>&,
+ const Table<2,Coupling>&,
+ BlockCompressedSparsityPattern&);
+template void 
+DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
+                               BlockCompressedSetSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension>&,
  const Table<2,Coupling>&,
CompressedBlockSparsityPattern&);
BlockCompressedSetSparsityPattern&);
 
 
 template void
@@ -5086,6 +5128,12 @@ DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
  const DoFHandler<deal_II_dimension> &dof_col,
  CompressedSparsityPattern    &sparsity);
 template void
+DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
+                               CompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension> &dof_row,
+ const DoFHandler<deal_II_dimension> &dof_col,
+ CompressedSetSparsityPattern    &sparsity);
+template void
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
                                BlockSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof_row,
@@ -5093,10 +5141,16 @@ DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
  BlockSparsityPattern                &sparsity);
 template void
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
-                               CompressedBlockSparsityPattern>
+                               BlockCompressedSparsityPattern>
+(const DoFHandler<deal_II_dimension> &dof_row,
+ const DoFHandler<deal_II_dimension> &dof_col,
+ BlockCompressedSparsityPattern      &sparsity);
+template void
+DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
+                               BlockCompressedSetSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof_row,
  const DoFHandler<deal_II_dimension> &dof_col,
CompressedBlockSparsityPattern      &sparsity);
BlockCompressedSetSparsityPattern      &sparsity);
 
 template void
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
@@ -5111,6 +5165,12 @@ DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
  const hp::DoFHandler<deal_II_dimension> &dof_col,
  CompressedSparsityPattern    &sparsity);
 template void
+DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
+                               CompressedSetSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension> &dof_row,
+ const hp::DoFHandler<deal_II_dimension> &dof_col,
+ CompressedSetSparsityPattern    &sparsity);
+template void
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
                                BlockSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension> &dof_row,
@@ -5118,10 +5178,16 @@ DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
  BlockSparsityPattern                &sparsity);
 template void
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
-                               CompressedBlockSparsityPattern>
+                               BlockCompressedSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension> &dof_row,
+ const hp::DoFHandler<deal_II_dimension> &dof_col,
+ BlockCompressedSparsityPattern      &sparsity);
+template void
+DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
+                               BlockCompressedSetSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension> &dof_row,
  const hp::DoFHandler<deal_II_dimension> &dof_col,
CompressedBlockSparsityPattern      &sparsity);
BlockCompressedSetSparsityPattern      &sparsity);
 
 
 // #if deal_II_dimension > 1
@@ -5136,15 +5202,25 @@ DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,Compresse
  const std::vector<unsigned int>  &,
  CompressedSparsityPattern    &);
 template void
+DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int>  &,
+ CompressedSetSparsityPattern    &);
+template void
 DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockSparsityPattern>
 (const DoFHandler<deal_II_dimension>& dof,
  const std::vector<unsigned int>  &,
  BlockSparsityPattern    &);
 template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedBlockSparsityPattern>
+DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
 (const DoFHandler<deal_II_dimension>& dof,
  const std::vector<unsigned int>  &,
- CompressedBlockSparsityPattern    &);
+ BlockCompressedSparsityPattern    &);
+template void
+DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int>  &,
+ BlockCompressedSetSparsityPattern    &);
 
 template void
 DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SparsityPattern>
@@ -5157,15 +5233,25 @@ DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,Compr
  const std::vector<unsigned int>  &,
  CompressedSparsityPattern    &);
 template void
+DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int>  &,
+ CompressedSetSparsityPattern    &);
+template void
 DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension>& dof,
  const std::vector<unsigned int>  &,
  BlockSparsityPattern    &);
 template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedBlockSparsityPattern>
+DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension>& dof,
  const std::vector<unsigned int>  &,
- CompressedBlockSparsityPattern    &);
+ BlockCompressedSparsityPattern    &);
+template void
+DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int>  &,
+ BlockCompressedSetSparsityPattern    &);
 
 
 template void
@@ -5181,17 +5267,29 @@ DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,Compresse
  const std::vector<unsigned int>  &dof_to_boundary_mapping,
  CompressedSparsityPattern    &sparsity);
 template void
+DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
+ const std::vector<unsigned int>  &dof_to_boundary_mapping,
+ CompressedSetSparsityPattern    &sparsity);
+template void
 DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockSparsityPattern>
 (const DoFHandler<deal_II_dimension>& dof,
  const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
  const std::vector<unsigned int>  &dof_to_boundary_mapping,
  BlockSparsityPattern    &sparsity);
 template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedBlockSparsityPattern>
+DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
+(const DoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
+ const std::vector<unsigned int>  &dof_to_boundary_mapping,
+ BlockCompressedSparsityPattern    &sparsity);
+template void
+DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
 (const DoFHandler<deal_II_dimension>& dof,
  const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
  const std::vector<unsigned int>  &dof_to_boundary_mapping,
CompressedBlockSparsityPattern    &sparsity);
BlockCompressedSetSparsityPattern    &sparsity);
 
 template void
 DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SparsityPattern>
@@ -5206,17 +5304,29 @@ DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,Compr
  const std::vector<unsigned int>  &dof_to_boundary_mapping,
  CompressedSparsityPattern    &sparsity);
 template void
+DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
+ const std::vector<unsigned int>  &dof_to_boundary_mapping,
+ CompressedSetSparsityPattern    &sparsity);
+template void
 DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension>& dof,
  const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
  const std::vector<unsigned int>  &dof_to_boundary_mapping,
  BlockSparsityPattern    &sparsity);
 template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedBlockSparsityPattern>
+DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
+ const std::vector<unsigned int>  &dof_to_boundary_mapping,
+ BlockCompressedSparsityPattern    &sparsity);
+template void
+DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension>& dof,
  const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
  const std::vector<unsigned int>  &dof_to_boundary_mapping,
CompressedBlockSparsityPattern    &sparsity);
BlockCompressedSetSparsityPattern    &sparsity);
 
 
 template void
@@ -5228,13 +5338,21 @@ DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSpa
 (const DoFHandler<deal_II_dimension> &dof,
  CompressedSparsityPattern    &sparsity);
 template void
+DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension> &dof,
+ CompressedSetSparsityPattern    &sparsity);
+template void
 DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
  BlockSparsityPattern    &sparsity);
 template void
-DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedBlockSparsityPattern>
+DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
- CompressedBlockSparsityPattern    &sparsity);
+ BlockCompressedSparsityPattern    &sparsity);
+template void
+DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension> &dof,
+ BlockCompressedSetSparsityPattern    &sparsity);
 
 template void
 DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SparsityPattern>
@@ -5245,13 +5363,21 @@ DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,Compresse
 (const hp::DoFHandler<deal_II_dimension> &dof,
  CompressedSparsityPattern    &sparsity);
 template void
+DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension> &dof,
+ CompressedSetSparsityPattern    &sparsity);
+template void
 DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension> &dof,
  BlockSparsityPattern    &sparsity);
 template void
-DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedBlockSparsityPattern>
+DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
+(const hp::DoFHandler<deal_II_dimension> &dof,
+ BlockCompressedSparsityPattern    &sparsity);
+template void
+DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension> &dof,
CompressedBlockSparsityPattern    &sparsity);
BlockCompressedSetSparsityPattern    &sparsity);
 
 
 #if deal_II_dimension > 1
@@ -5268,15 +5394,27 @@ DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSpa
  const Table<2,Coupling>&,
  const Table<2,Coupling>&);
 template void
+DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
+(const DoFHandler<deal_II_dimension> &dof,
+ CompressedSetSparsityPattern    &,
+ const Table<2,Coupling>&,
+ const Table<2,Coupling>&);
+template void
 DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
  BlockSparsityPattern    &,
  const Table<2,Coupling>&,
  const Table<2,Coupling>&);
 template void
-DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedBlockSparsityPattern>
+DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
+(const DoFHandler<deal_II_dimension> &dof,
+ BlockCompressedSparsityPattern    &,
+ const Table<2,Coupling>&,
+ const Table<2,Coupling>&);
+template void
+DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
CompressedBlockSparsityPattern    &,
BlockCompressedSetSparsityPattern    &,
  const Table<2,Coupling>&,
  const Table<2,Coupling>&);
 #endif
index 67b97db72e5d055a77da895355e99389ac9df1b2..808c6baa279565298c46f4e0a290a9ab0a150984 100644 (file)
@@ -1532,11 +1532,19 @@ DEAL_II_NAMESPACE_CLOSE
 #include "mg_tools.pattern.in.h"
 #undef PATTERN
 
+#define PATTERN CompressedSetSparsityPattern
+#include "mg_tools.pattern.in.h"
+#undef PATTERN
+
 #define PATTERN BlockSparsityPattern
 #include "mg_tools.pattern.in.h"
 #undef PATTERN
 
-#define PATTERN CompressedBlockSparsityPattern
+#define PATTERN BlockCompressedSparsityPattern
+#include "mg_tools.pattern.in.h"
+#undef PATTERN
+
+#define PATTERN BlockCompressedSetSparsityPattern
 #include "mg_tools.pattern.in.h"
 #undef PATTERN
 
index 6ccaa3c47a739192dc0cd44aaa6cedf3175def6c..3c1ade3c030acd7842f0524dfcb165f07c2be36a 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2003, 2004, 2006 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
 /**
  * @defgroup Matrices Matrix classes
  *
- * All matrices in this library have a common minimal interface, defined
- * through MATRIX (see Solver documentation). This interface consists of
- * functions for multiplication with appropriate vectors.
+ * deal.II comes with a number of different matrix classes, tailored to the
+ * various purposes for which matrices are used. For example, there are full
+ * matrices, sparse matrices using different storage schemes, matrices
+ * composed of individual blocks, and matrices implemented as interfaces to
+ * other linear algebra classes. As far as possible, all these implementations
+ * share a common interface that contains at least the operations necessary to
+ * write iterative linear solvers (see @ref Solvers), but also element-wise
+ * access to read from and write to a matrix.
  *
- * We split this module into several parts. Basic matrices are all the matrix
- * classes actually storing their entries. Derived matrices use basic
- * matrices, but change the meaning of the matrix-vector multiplication.
+ * This module is split into different parts. @ref Matrix1 "Basic matrices"
+ * contains all the matrix classes actually storing entries. @ref Matrix2
+ * "Derived matrices", on the other hand, only use basic matrices, but
+ * implement certain operations on them. For example, TransposeMatrix provides
+ * a matrix-vector multiplication that acts as if the underlying matrix had
+ * been transposed, without actually ever storing a transposed matrix.
  *
- * Preconditioners are matrix classes as well, since they perform linear
+ * @ref Preconditioners are matrix classes as well, since they perform linear
  * operations on vectors.
  *
- * @author Guido Kanschat, 2003
- *
  * @ingroup LAC
  */
 
  *
  * These are the actual matrix classes provided by deal.II. It is possible to
  * store values in them and retrieve them. Furthermore, they provide the full
- * interface required by linear solvers (see Solver).
+ * interface required by linear solvers (see @ref Solvers).
+ *
+ * Among the matrices in this group are full matrices, different sparse
+ * matrices, and block matrices. In addition, some of the classes in the
+ * interfaces to other linear algebra libraries (for example the
+ * PETScWrappers) are matrices.
  *
- * @author Guido Kanschat, 2003
+ * Most of the deal.II sparse matrix classes are separated from their sparsity
+ * patterns, to make storing several matrices with the same sparsity pattern
+ * more efficient. See @ref Sparsity for more information.
  *
  * @ingroup Matrices
  */
  * @defgroup Matrix2 Derived matrices
  *
  * These matrices are built on top of the basic matrices. They perform special
- * operations using the interface defined in Solver.
+ * operations using the interface defined in @ref Solvers.
+ *
+ * @ingroup Matrices
+ */
+
+/**
+ * @defgroup Sparsity Sparsity patterns
+ *
+ * In deal.II, sparsity patterns are typically separated from the actual
+ * sparse matrices (with the exception of the SparseMatrixEZ class and some
+ * classes from interfaces to external libraries such as PETSc). The reason is
+ * that one often has several matrices that share the same sparsity pattern;
+ * examples include the stiffness and mass matrices necessary for time
+ * stepping schemes, or the left and right hand side matrix of generalized
+ * eigenvalue problems. It would therefore be wasteful if each of them had to
+ * store their sparsity pattern separately.
+ *
+ * Consequently, deal.II has sparsity pattern classes that matrix classes
+ * build on. There are two main groups of sparsity pattern classes, as
+ * discussed below:
+ *
+ *
+ * <h4>"Static" sparsity patterns</h4>
+ *
+ * The main sparse matrix class in deal.II, SparseMatrix, only stores a value
+ * for each matrix entry, but not where these entries are located. For this,
+ * it relies on the information it gets from a sparsity pattern object
+ * associated with this matrix. This sparsity pattern object must be of type
+ * SparsityPattern.
+ *
+ * Because matrices are large objects and because it is comparatively
+ * expensive to change them, SparsityPattern objects are built in two phases:
+ * first, in a "dynamic" phase, one allocates positions where one expects
+ * matrices built on it to have nonzero entries; in a second "static" phase,
+ * the representation of these nonzero locations is "compressed" into the
+ * usual Compressed Row Storage (CSR) format. After this, no new nonzero
+ * locations can be added any more. Only after compression can a sparsity
+ * pattern be associated to a matrix, since the latter requires the efficient
+ * compressed data format of the former. Building a sparsity pattern during
+ * the dynamic phase often happens with the DoFTools:make_sparsity_pattern()
+ * function. Although this may appear a restriction, it is typically not a
+ * significant problem to first build a sparsity pattern and then to write
+ * into the matrix only in the previously allocated locations, since in finite
+ * element codes it is normally quite clear which elements of a matrix can
+ * possibly be nonzero and which are definitely zero.
+ *
+ * The advantage of this two-phase generation of a sparsity pattern is that
+ * when it is actually used with a matrix, a very efficient format is
+ * available. In particular, the locations of entries are stored in a linear
+ * array that allows for rapid access friendly to modern CPU types with deep
+ * hierarchies of caches. Consequently, the static SparsityPattern class is
+ * the only one on which deal.II's main SparseMatrix class can work.
+ *
+ * The main drawback of static sparsity patterns is that their efficient
+ * construction requires a reasonably good guess how many entries each of the
+ * rows may maximally have. During the actual construction, for example in the
+ * DoFTools:make_sparsity_pattern() function, only at most as many entries can
+ * be allocated as previously stated. This is a problem because it is often
+ * difficult to estimate the maximal number of entries per row. Consequently,
+ * a common strategy is to first build and intermediate sparsity pattern that
+ * uses a less efficient storage scheme during construction of the sparsity
+ * pattern and later copy it directly into the static, compressed form (see,
+ * for example the @ref step_11 "step-11", @ref step_18 "step-18", and @ref
+ * step_27 "step-27" tutorial programs).
+ *
+ *
+ * <h4>"Dynamic" or "compressed" sparsity patterns</h4>
+ *
+ * As explained above, it is often complicated to obtain good estimates for
+ * the maximal number of entries in each row of a sparsity
+ * pattern. Consequently, any attempts to allocate a regular SparsityPattern
+ * with bad estimates requires huge amounts of memory, almost all of which
+ * will not be used and be de-allocated upon compression.
+ *
+ * To avoid this, deal.II contains a number of "dynamic" or "compressed"
+ * sparsity patterns that only allocate as much memory as necessary to hold
+ * the currently added entries. While this saves much memory compared to the
+ * worst-case behavior mentioned above, it requires the use of less efficient
+ * storage schemes for insertion of elements, and the frequent allocation of
+ * memory often also takes significant compute time. The tradeoff to avoid
+ * excessive memory allocation cannot be avoided, however.
+ *
+ * In deal.II, the CompressedSparsityPattern and CompressedSetSparsityPattern
+ * classes implement this "dynamic" memory scheme. They use different storage
+ * schemes and appear to both have use cases where they are better than the
+ * respective other. In either case, these classes are typically used in the
+ * following way:
+ * @verbatim
+ * CompressedSparsityPattern compressed_pattern (dof_handler.n_dofs());
+ * DoFTools::make_sparsity_pattern (dof_handler,
+ *                                  compressed_pattern);
+ * constraints.condense (compressed_pattern);
+ *
+ * SparsityPattern finaly_sparsity_pattern;
+ * final_sparsity_pattern.copy_from (compressed_pattern);
+ * @endverbatim
  *
- * @author Guido Kanschat, 2003
+ * The intermediate, compressed sparsity pattern is directly copied into the
+ * "compressed" form of the final static pattern.
  *
  * @ingroup Matrices
  */
index 9baa0d8e67e42e5c8995b4deea2de4ef1e8209d3..02e01e90e75c9dabf52963c0f8d560968951d421 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2003, 2004, 2006 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -30,4 +30,5 @@
  * multiplications, just like the real matrix classes.
  *
  * @ingroup LAC
+ * @ingroup Matrices
  */
index af775e7f428cf1918fdb9d00998914bc058ca51b..10b8fa076186695c5bb8f8a105f8606514da7b84 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2003, 2004, 2006 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
  * @defgroup Solvers Linear solver classes
  *
  * This module groups iterative and direct solvers, eigenvalue solvers, and
- * some control classes. All iterative solvers inherit from the class template
- * Solver, which provides some basic maintenance methods.
+ * some control classes. All these classes operate on objects of the
+ * @ref Matrices "matrix" and @ref Vectors "vector classes" defined in deal.II.
  *
- * The number of iteration steps of iterative solvers is controlled by
- * objects of class SolverControl or its derived class
- * ReductionControl.
- *
- * All solvers receive the matrix and vector classes as template
- * arguments. Therefore, any objects defining the interface described in the
- * documentation of Solver are admissible. These requirements are listed in
- * the documentation page of the Solver class.
+ * In order to work properly, solvers that take matrix and vector classes as
+ * template arguments require that these classes satisfy a certain minimal
+ * interface that can be used from inside the solver. For iterative solvers,
+ * this interface is defined in the Solver class. In addition, solvers are
+ * controlled using objects of classes that are derived from the SolverControl
+ * class (for example its derived class ReductionControl), in order to
+ * determine the maximal number of iterations or a desired tolerance.
  *
  * If detected during configuration (see the ReadMe file), some sparse direct
  * solvers are also supported.
index e38a0acc2a4afb7e186ef212129114572e4ec2ac..8bae2db70647f0da909fbdb544c498d6658dca6f 100644 (file)
@@ -745,6 +745,27 @@ inconvenience this causes.
 <h3>lac</h3>
 
 <ol>
+  <li> <p>Changed: The <code
+       class="class">CompressedBlockSparsityPattern</code> has been renamed to
+       <code class="class">BlockCompressedSparsityPattern</code> to be
+       consistent, since the "block" part builds on the "compressed sparsity
+       pattern", not the other way around.
+       <br>
+       (WB 2007/06/17)
+       </p>
+
+  <li> <p>New: The <code class="class">CompressedSetSparsityPattern</code>
+       class is an alternative to the <code
+       class="class">CompressedSparsityPattern</code> class that appears to be
+       better suited for problems that have many entries per row. There is also
+       a block version, <code
+       class="class">BlockCompressedSetSparsityPattern</code>. The two new
+       classes can used in all places where a regular compressed sparsity
+       pattern can also be used.
+       <br>
+       (Oliver Kayser-Herold, WB 2007/06/03)
+       </p>
+
   <li> <p>Fixed: The <code class="class">SolverBicgstab</code> class
        did not handle hitting on the solution early very
        gracefully (it threw an exception). This is now fixed.
index 4b571d2f6b5588a441b95faff4d0ef1187e7537c..03c210f5c63820a72e6f5e1028f1e3ae903376ff 100644 (file)
@@ -1282,7 +1282,7 @@ void LaplaceProblem<3>::create_coarse_grid ()
 template <int dim>
 void LaplaceProblem<dim>::run () 
 {
-  for (unsigned int cycle=0; cycle<30; ++cycle)
+  for (unsigned int cycle=0; cycle<3; ++cycle)
     {
       std::cout << "Cycle " << cycle << ':' << std::endl;
 
index 3f44fec7ae00671680bb38fc37b4db750d4806fd..2f71b4e46dfbdc800dff79736e4ee0b2fbcf982a 100644 (file)
@@ -21,6 +21,7 @@
 #include <base/smartpointer.h>
 #include <lac/sparsity_pattern.h>
 #include <lac/compressed_sparsity_pattern.h>
+#include <lac/compressed_set_sparsity_pattern.h>
 #include <lac/block_indices.h>
 
 DEAL_II_NAMESPACE_OPEN
@@ -28,22 +29,22 @@ DEAL_II_NAMESPACE_OPEN
 
 template <typename number> class BlockSparseMatrix;
 class BlockSparsityPattern;
-class CompressedBlockSparsityPattern;
+class BlockCompressedSparsityPattern;
+class BlockCompressedSetSparsityPattern;
 
-/*! @addtogroup Matrix1
+/*! @addtogroup Sparsity
  *@{
  */
 
 
 /**
- * This is the base class for block versions of the sparsity pattern
- * and compressed sparsity pattern classes. It has not much
- * functionality, but only administrates an array of sparsity pattern
- * objects and delegates work to them. It has mostly the same
- * interface as has the SparsityPattern and
- * CompressedSparsityPattern classes, and simply transforms
- * calls to its member functions to calls to the respective member
- * functions of the member sparsity patterns.
+ * This is the base class for block versions of the sparsity pattern and
+ * compressed sparsity pattern classes. It has not much functionality, but
+ * only administrates an array of sparsity pattern objects and delegates work
+ * to them. It has mostly the same interface as has the SparsityPattern,
+ * CompressedSparsityPattern, and CompressedSetSparsityPattern classes, and
+ * simply transforms calls to its member functions to calls to the respective
+ * member functions of the member sparsity patterns.
  *
  * The largest difference between the SparsityPattern and
  * CompressedSparsityPattern classes and this class is that
@@ -418,6 +419,8 @@ class BlockSparsityPatternBase : public Subscriptor
  * adds a few additional member functions, but the main interface
  * stems from the base class, see there for more information.
  *
+ * This class is an example of the "static" type of @ref Sparsity.
+ *
  * @author Wolfgang Bangerth, 2000, 2001
  */
 class BlockSparsityPattern : public BlockSparsityPatternBase<SparsityPattern>
@@ -485,7 +488,20 @@ class BlockSparsityPattern : public BlockSparsityPatternBase<SparsityPattern>
                                     /**
                                      * Copy data from an object of
                                      * type
-                                     * CompressedBlockSparsityPattern,
+                                     * BlockCompressedSparsityPattern,
+                                     * i.e. resize this object to the
+                                     * size of the given argument,
+                                     * and copy over the contents of
+                                     * each of the
+                                     * subobjects. Previous content
+                                     * of this object is lost.
+                                     */
+    void copy_from (const BlockCompressedSparsityPattern &csp);
+
+                                    /**
+                                     * Copy data from an object of
+                                     * type
+                                     * BlockCompressedSetSparsityPattern,
                                      * i.e. resize this object to the
                                      * size of the given argument,
                                      * and copy over the contents of
@@ -493,19 +509,26 @@ class BlockSparsityPattern : public BlockSparsityPatternBase<SparsityPattern>
                                      * subobjects. Previous content
                                      * of this object is lost.
                                      */
-    void copy_from (const CompressedBlockSparsityPattern &csp);
+    void copy_from (const BlockCompressedSetSparsityPattern &csp);
 };
 
 
 
 /**
- * This class extends the base class to implement an array of
- * compressed sparsity patterns that can be used to initialize objects
- * of type BlockSparsityPattern. It does not add additional
- * member functions, but rather acts as a @p typedef to introduce the
- * name of this class, without requiring the user to specify the
- * templated name of the base class. For information on the interface
- * of this class refer to the base class.
+ * This class extends the base class to implement an array of compressed
+ * sparsity patterns that can be used to initialize objects of type
+ * BlockSparsityPattern. It does not add additional member functions, but
+ * rather acts as a @p typedef to introduce the name of this class, without
+ * requiring the user to specify the templated name of the base class. For
+ * information on the interface of this class refer to the base class. The
+ * individual blocks are based on the CompressedSparistyPattern class.
+ *
+ * This class is an example of the "dynamic" type of @ref Sparsity.
+ *
+ * <b>Note:</b> This class used to be called
+ * CompressedBlockSparsityPattern. However, since it's a block wrapper around
+ * the CompressedSparsityPattern class, this is a misnomer and the class has
+ * been renamed.
  *
  * <h3>Example</h3>
  * Usage of this class is very similar to CompressedSparsityPattern,
@@ -521,7 +544,7 @@ class BlockSparsityPattern : public BlockSparsityPatternBase<SparsityPattern>
  * @skipline dofs_per_block
  * @until count
  *
- * Now, we are ready to set up the CompressedBlockSparsityPattern.
+ * Now, we are ready to set up the BlockCompressedSparsityPattern.
  *
  * @until collect
  *
@@ -536,7 +559,7 @@ class BlockSparsityPattern : public BlockSparsityPatternBase<SparsityPattern>
  *
  * @author Wolfgang Bangerth, 2000, 2001, Guido Kanschat, 2006, 2007
  */
-class CompressedBlockSparsityPattern : public BlockSparsityPatternBase<CompressedSparsityPattern>
+class BlockCompressedSparsityPattern : public BlockSparsityPatternBase<CompressedSparsityPattern>
 {
   public:
     
@@ -550,7 +573,7 @@ class CompressedBlockSparsityPattern : public BlockSparsityPatternBase<Compresse
                                      * structure usable by calling
                                      * the reinit() function.
                                      */
-    CompressedBlockSparsityPattern ();
+    BlockCompressedSparsityPattern ();
 
                                     /**
                                      * Initialize the matrix with the
@@ -560,7 +583,7 @@ class CompressedBlockSparsityPattern : public BlockSparsityPatternBase<Compresse
                                      * to call collect_sizes() after
                                      * you assign them sizes.
                                      */
-    CompressedBlockSparsityPattern (const unsigned int n_rows,
+    BlockCompressedSparsityPattern (const unsigned int n_rows,
                                    const unsigned int n_columns);
 
                                     /**
@@ -574,7 +597,7 @@ class CompressedBlockSparsityPattern : public BlockSparsityPatternBase<Compresse
                                      * and then entering the index
                                      * values.
                                      */
-    CompressedBlockSparsityPattern (const std::vector<unsigned int>& row_block_sizes,
+    BlockCompressedSparsityPattern (const std::vector<unsigned int>& row_block_sizes,
                                    const std::vector<unsigned int>& col_block_sizes);
     
                                     /**
@@ -604,6 +627,120 @@ class CompressedBlockSparsityPattern : public BlockSparsityPatternBase<Compresse
 };
 
 
+
+/**
+ * This class extends the base class to implement an array of compressed
+ * sparsity patterns that can be used to initialize objects of type
+ * BlockSparsityPattern. It does not add additional member functions, but
+ * rather acts as a @p typedef to introduce the name of this class, without
+ * requiring the user to specify the templated name of the base class. For
+ * information on the interface of this class refer to the base class. The
+ * individual blocks are based on the CompressedSparistyPattern class.
+ *
+ * This class is an example of the "dynamic" type of @ref Sparsity.
+ *
+ * <b>Note:</b> This class used to be called
+ * CompressedBlockSparsityPattern. However, since it's a block wrapper around
+ * the CompressedSetSparsityPattern class, this is a misnomer and the class has
+ * been renamed.
+ *
+ * <h3>Example</h3>
+ * Usage of this class is very similar to CompressedSetSparsityPattern,
+ * but since the use of block indices causes some additional
+ * complications, we give a short example.
+ *
+ * @dontinclude compressed_block_sparsity_pattern.cc
+ *
+ * After the the DoFHandler <tt>dof</tt> and the ConstraintMatrix
+ * <tt>constraints</tt> have been set up with a system element, we
+ * must count the degrees of freedom in each matrix block:
+ *
+ * @skipline dofs_per_block
+ * @until count
+ *
+ * Now, we are ready to set up the BlockCompressedSetSparsityPattern.
+ *
+ * @until collect
+ *
+ * It is filled as if it were a normal pattern
+ *
+ * @until condense
+ *
+ * In the end, it is copied to a normal BlockSparsityPattern for later
+ * use.
+ *
+ * @until copy
+ *
+ * @author Wolfgang Bangerth, 2000, 2001, Guido Kanschat, 2006, 2007
+ */
+class BlockCompressedSetSparsityPattern : public BlockSparsityPatternBase<CompressedSetSparsityPattern>
+{
+  public:
+    
+                                    /**
+                                     * Initialize the matrix empty,
+                                     * that is with no memory
+                                     * allocated. This is useful if
+                                     * you want such objects as
+                                     * member variables in other
+                                     * classes. You can make the
+                                     * structure usable by calling
+                                     * the reinit() function.
+                                     */
+    BlockCompressedSetSparsityPattern ();
+
+                                    /**
+                                     * Initialize the matrix with the
+                                     * given number of block rows and
+                                     * columns. The blocks themselves
+                                     * are still empty, and you have
+                                     * to call collect_sizes() after
+                                     * you assign them sizes.
+                                     */
+    BlockCompressedSetSparsityPattern (const unsigned int n_rows,
+                                   const unsigned int n_columns);
+
+                                    /**
+                                     * Initialize the pattern with
+                                     * two BlockIndices for the block
+                                     * structures of matrix rows and
+                                     * columns. This function is
+                                     * equivalent to calling the
+                                     * previous constructor with the
+                                     * length of the two index vector
+                                     * and then entering the index
+                                     * values.
+                                     */
+    BlockCompressedSetSparsityPattern (const std::vector<unsigned int>& row_block_sizes,
+                                   const std::vector<unsigned int>& col_block_sizes);
+    
+                                    /**
+                                     * Resize the matrix to a tensor
+                                     * product of matrices with
+                                     * dimensions defined by the
+                                     * arguments.
+                                     *
+                                     * The matrix will have as many
+                                     * block rows and columns as
+                                     * there are entries in the two
+                                     * arguments. The block at
+                                     * position (<i>i,j</i>) will
+                                     * have the dimensions
+                                     * <tt>row_block_sizes[i]</tt>
+                                     * times <tt>col_block_sizes[j]</tt>.
+                                     */
+    void reinit (const std::vector< unsigned int > &row_block_sizes,
+                const std::vector< unsigned int > &col_block_sizes);
+
+                                    /**
+                                     * Allow the use of the reinit
+                                     * functions of the base class as
+                                     * well.
+                                     */
+    BlockSparsityPatternBase<CompressedSetSparsityPattern>::reinit;
+};
+
+
 /*@}*/
 /*---------------------- Template functions -----------------------------------*/
 
index 63cb2fbaadc3fa263186814d0ccb27c4e9f81d0e..90e71ff13c39d35bf7c87dba38601827f969c384 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id: compressed_sparsity_pattern.h 14038 2006-10-23 02:46:34Z bangerth $
 //    Version: $Name$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -26,7 +26,7 @@ DEAL_II_NAMESPACE_OPEN
 
 template <typename number> class SparseMatrix;
 
-/*! @addtogroup Matrix1
+/*! @addtogroup Sparsity
  *@{
  */
 
@@ -45,44 +45,12 @@ template <typename number> class SparseMatrix;
  * copy the data of this object over to an object of type
  * SparsityPattern before using it in actual matrices.
  *
- * Another viewpoint is that this class does not need up front
- * allocation of a certain amount of memory, but grows as necessary.
- *
- *
- * <h3>Rationale</h3>
- *
- * When constructing the sparsity pattern of a matrix, you usually
- * first have to provide an empty sparsity pattern object with a fixed
- * maximal number of entries per row. To find out about this maximal
- * row length, one usually calls the function
- * DoFHandler::max_couplings_between_dofs() which returns an estimate for
- * that quantity or DoFTools::compute_row_length_vector(), which gives
- * a better estimate for each row. While this estimate is usually
- * quite good in 2d and exact in 1d, it is often significantly too
- * large in 3d and especially for higher order elements. Furthermore,
- * normally only a small fraction of the rows of a matrix will end up
- * having the maximal number of nonzero entries per row (usually those
- * nodes adjacent to hanging nodes), most have much less. In effect,
- * the empty SparsityPattern object has allocated much too much
- * memory. Although this unnecessarily allocated memory is later freed
- * when SparsityPattern::compress() is called, this overallocation
- * has, with higher order elements and in 3d, sometimes been so large
- * that the program aborted due to lack of memory.
- *
- * This class therefore provides an alternative representation of a
- * sparsity pattern: we don't specify a maximal row length initially,
- * but store a set of column indices indicating possible nonzero
- * entries in the sparsity pattern for each row. This is very much
- * like the final "compressed" format used in the
- * SparsityPattern object after compression, but uses a less
- * compact memory storage format, since the exact number of entries
- * per row is only known a posteriori and since it may change (for the
- * SparsityPattern class, no more changes are allowed after
- * compressing it). We can therefore not store all the column indices
- * in a big array, but have to use a vector of sets. This can later be
- * used to actually initialize a SparsityPattern object with the
- * then final set of necessary indices.
+ * Another viewpoint is that this class does not need up front allocation of a
+ * certain amount of memory, but grows as necessary.  An extensive description
+ * of sparsity patterns can be found in the documentation of the @ref Sparsity
+ * module.
  *
+ * This class is an example of the "dynamic" type of @ref Sparsity.
  *
  * <h3>Interface</h3>
  *
@@ -92,20 +60,6 @@ template <typename number> class SparseMatrix;
  * function, and the functions inquiring properties of the sparsity
  * pattern are the same.
  *
- * <h3>Notes</h3>
- *
- * This class is a variation of the CompressedSparsityPattern class.
- * Instead of using sorted vectors together with a caching algorithm
- * for storing the column indices of NZ entries, the std::set
- * container is used. This solution might not be the fastest in
- * all situations, but seems to work much better than the
- * CompressedSparsityPattern in the context of hp-adaptivity.
- * On the other hand, a benchmark where NZ entries were randomly inserted
- * into the sparsity pattern revealed that this class is slower
- * by a factor 4-6 in this situation. Hence, currently the suggestion
- * is to carefully analyse which of the CompressedSparsityPattern
- * classes works best in a certain setting. An algorithm which
- * performs equally well in all situations still has to be found.
  *
  * <h3>Usage</h3>
  *
@@ -120,13 +74,37 @@ template <typename number> class SparseMatrix;
  * sp.copy_from (compressed_pattern);
  * @endverbatim
  *
+ * See also @ref step_11 "step-11" and @ref step_18 "step-18" for usage
+ * patterns.
+ *
+ * <h3>Notes</h3>
+ *
+ * This class is a variation of the CompressedSparsityPattern class.
+ * Instead of using sorted vectors together with a caching algorithm
+ * for storing the column indices of nonzero entries, the std::set
+ * container is used. This solution might not be the fastest in
+ * all situations, but seems to work much better than the
+ * CompressedSparsityPattern in the context of hp-adaptivity.
+ * On the other hand, a benchmark where nonzero entries were randomly inserted
+ * into the sparsity pattern revealed that this class is slower
+ * by a factor 4-6 in this situation. Hence, currently the suggestion
+ * is to carefully analyze which of the CompressedSparsityPattern
+ * classes works best in a certain setting. An algorithm which
+ * performs equally well in all situations still has to be found.
+ *
  *
- * @author Wolfgang Bangerth, 2001
+ * @author Oliver Kayser-Herold, 2007
  */
 class CompressedSetSparsityPattern : public Subscriptor
 {
   public:
-    typedef std::set<unsigned int>::iterator CSSPIterator;
+                                    /**
+                                     * An iterator that can be used to
+                                     * iterate over the elements of a single
+                                     * row. The result of dereferencing such
+                                     * an iterator is a column index.
+                                     */
+    typedef std::set<unsigned int>::iterator row_iterator;
 
 
                                     /**
@@ -156,18 +134,6 @@ class CompressedSetSparsityPattern : public Subscriptor
                                      * (CompressedSetSparsityPattern());</tt>,
                                      * with @p v a vector of @p
                                      * CompressedSetSparsityPattern objects.
-                                     *
-                                     * Usually, it is sufficient to
-                                     * use the explicit keyword to
-                                     * disallow unwanted temporaries,
-                                     * but for the STL vectors, this
-                                     * does not work. Since copying a
-                                     * structure like this is not
-                                     * useful anyway because multiple
-                                     * matrices can use the same
-                                     * sparsity structure, copies are
-                                     * only allowed for empty
-                                     * objects, as described above.
                                      */
     CompressedSetSparsityPattern (const CompressedSetSparsityPattern &);
 
@@ -177,7 +143,7 @@ class CompressedSetSparsityPattern : public Subscriptor
                                      * @p n columns.
                                      */
     CompressedSetSparsityPattern (const unsigned int m,
-                              const unsigned int n);
+                                 const unsigned int n);
     
                                     /**
                                      * Initialize a square matrix of
@@ -311,8 +277,8 @@ class CompressedSetSparsityPattern : public Subscriptor
                                      * Return the column number of
                                      * the @p indexth entry in @p row.
                                      */
-    CSSPIterator row_begin (const unsigned int row) const;
-    CSSPIterator row_end (const unsigned int row) const;
+    row_iterator row_begin (const unsigned int row) const;
+    row_iterator row_end (const unsigned int row) const;
 
 
                                     /**
@@ -327,16 +293,7 @@ class CompressedSetSparsityPattern : public Subscriptor
 
                                     /**
                                      * Return the number of nonzero elements
-                                     * of this matrix. Actually, it returns
-                                     * the number of entries in the sparsity
-                                     * pattern; if any of the entries should
-                                     * happen to be zero, it is counted
-                                     * anyway.
-                                     *
-                                     * This function may only be called if
-                                     * the matrix struct is compressed. It
-                                     * does not make too much sense otherwise
-                                     * anyway.
+                                     * allocated through this sparsity pattern.
                                      */
     unsigned int n_nonzero_elements () const;
 
@@ -354,59 +311,15 @@ class CompressedSetSparsityPattern : public Subscriptor
     unsigned int cols;
 
                                      /**
-                                      * Store some data for each row
-                                      * describing which entries of this row
-                                      * are nonzero. Data is organized as
-                                      * follows: if an entry is added to a
-                                      * row, it is first added to the #cache
-                                      * variable, irrespective of whether an
-                                      * entry with same column number has
-                                      * already been added. Only if the cache
-                                      * is full do we flush it by removing
-                                      * duplicates, removing entries that are
-                                      * already stored in the @p entries
-                                      * array, sorting everything, and merging
-                                      * the two arrays.
-                                      *
-                                      * The reasoning behind this scheme is
-                                      * that memory allocation is expensive,
-                                      * and we only want to do it when really
-                                      * necessary. Previously (in deal.II
-                                      * versions up to 5.0), we used to store
-                                      * the column indices inside a std::set,
-                                      * but this would allocate 20 bytes each
-                                      * time we added an entry. Using the
-                                      * present scheme, we only need to
-                                      * allocate memory once for every 8 added
-                                      * entries, and we waste a lot less
-                                      * memory by not using a balanced tree
-                                      * for storing column indices.
-                                      *
-                                      * Since some functions that are @p const
-                                      * need to access the data of this
-                                      * object, but need to flush caches
-                                      * before, the flush_cache() function is
-                                      * marked const, and the data members are
-                                      * marked @p mutable.
-                                      *
-                                      * A small testseries about the size of
-                                      * the cache showed that the run time of
-                                      * a small program just testing the
-                                      * compressed sparsity pattern element
-                                      * insertion routine ran for 3.6 seconds
-                                      * with a cache size of 8, and 4.2
-                                      * seconds with a cache size of 16. We
-                                      * deem even smaller cache sizes
-                                      * undesirable, since they lead to more
-                                      * memory allocations, while larger cache
-                                      * sizes lead to waste of memory. The
-                                      * original version of this class, with
-                                      * one std::set per row took 8.2 seconds
-                                      * on the same program.
+                                      * For each row of the matrix, store the
+                                      * allocated non-zero entries as a
+                                      * std::set of column indices. For a
+                                      * discussion of storage schemes see the
+                                      * CompressedSparsityPattern::Line class.
                                       */
     struct Line
     {
-       std::set <unsigned int> entries;
+       std::set<unsigned int> entries;
 
                                          /**
                                           * Constructor.
@@ -433,6 +346,12 @@ class CompressedSetSparsityPattern : public Subscriptor
 /*---------------------- Inline functions -----------------------------------*/
 
 
+inline
+CompressedSetSparsityPattern::Line::Line ()
+{}
+
+
+
 inline
 void
 CompressedSetSparsityPattern::Line::add (const unsigned int j)
@@ -463,7 +382,7 @@ CompressedSetSparsityPattern::n_cols () const
 inline
 void
 CompressedSetSparsityPattern::add (const unsigned int i,
-                               const unsigned int j)
+                                  const unsigned int j)
 {
   Assert (i<rows, ExcIndexRange(i, 0, rows));
   Assert (j<cols, ExcIndexRange(j, 0, cols));
@@ -473,12 +392,6 @@ CompressedSetSparsityPattern::add (const unsigned int i,
 
 
 
-inline
-CompressedSetSparsityPattern::Line::Line ()
-{}
-
-
-
 inline
 unsigned int
 CompressedSetSparsityPattern::row_length (const unsigned int row) const
@@ -490,7 +403,7 @@ CompressedSetSparsityPattern::row_length (const unsigned int row) const
 
 
 inline
-CompressedSetSparsityPattern::CSSPIterator
+CompressedSetSparsityPattern::row_iterator
 CompressedSetSparsityPattern::row_begin (const unsigned int row) const
 {
   return (lines[row].entries.begin ());
@@ -498,7 +411,7 @@ CompressedSetSparsityPattern::row_begin (const unsigned int row) const
 
 
 inline
-CompressedSetSparsityPattern::CSSPIterator
+CompressedSetSparsityPattern::row_iterator
 CompressedSetSparsityPattern::row_end (const unsigned int row) const
 {
   return (lines[row].entries.end ());
index f199538b7752959d767d41a778f641b26169bdfc..ed0d3dda378b1b3c648b9502a62f8c3346c39626 100644 (file)
@@ -26,7 +26,7 @@ DEAL_II_NAMESPACE_OPEN
 template <typename number> class SparseMatrix;
 
 
-/*! @addtogroup Matrix1
+/*! @addtogroup Sparsity
  *@{
  */
 
@@ -45,44 +45,12 @@ template <typename number> class SparseMatrix;
  * copy the data of this object over to an object of type
  * SparsityPattern before using it in actual matrices.
  *
- * Another viewpoint is that this class does not need up front
- * allocation of a certain amount of memory, but grows as necessary.
- *
- *
- * <h3>Rationale</h3>
- *
- * When constructing the sparsity pattern of a matrix, you usually
- * first have to provide an empty sparsity pattern object with a fixed
- * maximal number of entries per row. To find out about this maximal
- * row length, one usually calls the function
- * DoFHandler::max_couplings_between_dofs() which returns an estimate for
- * that quantity or DoFTools::compute_row_length_vector(), which gives
- * a better estimate for each row. While this estimate is usually
- * quite good in 2d and exact in 1d, it is often significantly too
- * large in 3d and especially for higher order elements. Furthermore,
- * normally only a small fraction of the rows of a matrix will end up
- * having the maximal number of nonzero entries per row (usually those
- * nodes adjacent to hanging nodes), most have much less. In effect,
- * the empty SparsityPattern object has allocated much too much
- * memory. Although this unnecessarily allocated memory is later freed
- * when SparsityPattern::compress() is called, this overallocation
- * has, with higher order elements and in 3d, sometimes been so large
- * that the program aborted due to lack of memory.
- *
- * This class therefore provides an alternative representation of a
- * sparsity pattern: we don't specify a maximal row length initially,
- * but store a set of column indices indicating possible nonzero
- * entries in the sparsity pattern for each row. This is very much
- * like the final "compressed" format used in the
- * SparsityPattern object after compression, but uses a less
- * compact memory storage format, since the exact number of entries
- * per row is only known a posteriori and since it may change (for the
- * SparsityPattern class, no more changes are allowed after
- * compressing it). We can therefore not store all the column indices
- * in a big array, but have to use a vector of sets. This can later be
- * used to actually initialize a SparsityPattern object with the
- * then final set of necessary indices.
+ * Another viewpoint is that this class does not need up front allocation of a
+ * certain amount of memory, but grows as necessary.  An extensive description
+ * of sparsity patterns can be found in the documentation of the @ref Sparsity
+ * module.
  *
+ * This class is an example of the "dynamic" type of @ref Sparsity.
  *
  * <h3>Interface</h3>
  *
@@ -106,6 +74,15 @@ template <typename number> class SparseMatrix;
  * sp.copy_from (compressed_pattern);
  * @endverbatim
  *
+ * See also @ref step_11 "step-11" and @ref step_18 "step-18" for usage
+ * patterns.
+ *
+ * <h3>Notes</h3>
+ *
+ * A variation of this class is the CompressedSetSparsityPattern class that
+ * appears to be more efficient in some situations, in particular when using
+ * hp finite elements. See for example the @ref step_27 "step-27" tutorial
+ * program.
  *
  * @author Wolfgang Bangerth, 2001
  */
@@ -139,18 +116,6 @@ class CompressedSparsityPattern : public Subscriptor
                                      * (CompressedSparsityPattern());</tt>,
                                      * with @p v a vector of @p
                                      * CompressedSparsityPattern objects.
-                                     *
-                                     * Usually, it is sufficient to
-                                     * use the explicit keyword to
-                                     * disallow unwanted temporaries,
-                                     * but for the STL vectors, this
-                                     * does not work. Since copying a
-                                     * structure like this is not
-                                     * useful anyway because multiple
-                                     * matrices can use the same
-                                     * sparsity structure, copies are
-                                     * only allowed for empty
-                                     * objects, as described above.
                                      */
     CompressedSparsityPattern (const CompressedSparsityPattern &);
 
@@ -309,16 +274,7 @@ class CompressedSparsityPattern : public Subscriptor
 
                                     /**
                                      * Return the number of nonzero elements
-                                     * of this matrix. Actually, it returns
-                                     * the number of entries in the sparsity
-                                     * pattern; if any of the entries should
-                                     * happen to be zero, it is counted
-                                     * anyway.
-                                     *
-                                     * This function may only be called if
-                                     * the matrix struct is compressed. It
-                                     * does not make too much sense otherwise
-                                     * anyway.
+                                     * allocated through this sparsity pattern.
                                      */
     unsigned int n_nonzero_elements () const;
 
@@ -357,7 +313,13 @@ class CompressedSparsityPattern : public Subscriptor
                                       * versions up to 5.0), we used to store
                                       * the column indices inside a std::set,
                                       * but this would allocate 20 bytes each
-                                      * time we added an entry. Using the
+                                      * time we added an entry. (A std::set
+                                      * based class has later been revived in
+                                      * form of the
+                                      * CompressedSetSparsityPattern class, as
+                                      * this turned out to be more efficient
+                                      * for hp finite element programs such as
+                                      * @ref step_27 "step-27"). Using the
                                       * present scheme, we only need to
                                       * allocate memory once for every 8 added
                                       * entries, and we waste a lot less
index 39ffdf70dc8eb304ad32f8c245433ed1f6dfbc84..3e83d7c15f2332fe09b48478aa85912eec242fb5 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -55,6 +55,7 @@ namespace PETScWrappers
  * matrices. For this, one has to call the collect_sizes() function, for much
  * the same reason as is documented with the BlockSparsityPattern class.
  *
+ * @ingroup Matrix1
  * @author Wolfgang Bangerth, 2004
  */
   class BlockSparseMatrix : public BlockMatrixBase<PETScWrappers::SparseMatrix>
index 9cfb8990a1b62837e197ff73e484af5708109cd8..97224dab6868acb05baaa40c0ca8f609b4555f69 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -39,6 +39,7 @@ namespace PETScWrappers
  * this class handles the actual allocation of vectors and provides functions
  * that are specific to the underlying vector type.
  *
+ * @ingroup Vectors
  * @author Wolfgang Bangerth, 2004
  */
   class BlockVector : public BlockVectorBase<Vector>
index 900cfefc72fa0aa4f6a60060fe26a68983fa3ad3..ed89cb741c78a8f3fe637aaea1b5811ce9a17cd1 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -39,6 +39,7 @@ namespace PETScWrappers
  * virtual functions). Only the functions creating a matrix of specific type
  * differ, and are implemented in this particular class.
  *
+ * @ingroup Matrix1
  * @author Wolfgang Bangerth, 2004
  */
   class FullMatrix : public MatrixBase
index 226871d1e3a1000c149a8d76e4317ff35d203124..aa28eb62bde2ea0c444aa4c6e1aff9a8673f9f5d 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -276,6 +276,7 @@ namespace PETScWrappers
  * before the matrix is actively used.
  * 
  * @ingroup PETScWrappers
+ * @ingroup Matrix1
  * @author Wolfgang Bangerth, 2004
  */
   class MatrixBase : public Subscriptor
index c7ab8206621ae00ef1284684b2e304c4e2ce2b24..6f6dbc1e4a0b4e83567e3cf8fbf670244b94c8ae 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -55,6 +55,7 @@ namespace PETScWrappers
  * matrices. For this, one has to call the collect_sizes() function, for much
  * the same reason as is documented with the BlockSparsityPattern class.
  *
+ * @ingroup Matrix1
  * @author Wolfgang Bangerth, 2004
  */
     class BlockSparseMatrix : public BlockMatrixBase<SparseMatrix>
index 500a9123f718db57b19c3b61d49d6c883ea00599..a87b9b7361f8c817cd94c643e7ab3483943b813c 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -49,7 +49,8 @@ namespace PETScWrappers
  * constructors and reinit() functions, one therefore not only has to specify
  * the sizes of the individual blocks, but also the number of elements of each
  * of these blocks to be stored on the local process.
- * 
+ *
+ * @ingroup Vectors
  * @author Wolfgang Bangerth, 2004
  */
     class BlockVector : public BlockVectorBase<Vector>
index af4d5afd54d7ca42f8217240b98ece6038256d4b..01f40197ea4ae3d311ab88b73c5ad6637b0614a5 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -104,6 +104,7 @@ namespace PETScWrappers
  * numbers for all processes available at all processes.
  * 
  * @ingroup PETScWrappers
+ * @ingroup Matrix1
  * @author Wolfgang Bangerth, 2004
  */
     class SparseMatrix : public MatrixBase
index d66a9f908f3c050d9e15249bce9051987df75cd4..004784360b9f075f9bd26aadb284266d1e6e6e4d 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -145,6 +145,7 @@ namespace PETScWrappers
  * necessary.
  *
  * @ingroup PETScWrappers
+ * @ingroup Vectors
  * @author Wolfgang Bangerth, 2004
  */
     class Vector : public VectorBase
index 1cc9f813dce076127d4584f5d0cf8b878e0a64e5..7a7de77feb0898624dae9c9d96f2d3f89f8c3494 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -38,6 +38,7 @@ namespace PETScWrappers
  * differ, and are implemented in this particular class.
  *
  * @ingroup PETScWrappers
+ * @ingroup Matrix1
  * @author Wolfgang Bangerth, 2004
  */
   class SparseMatrix : public MatrixBase
index 2d02f3680164f27bab3b5164187a902fcd869a77..eb5ce4f0d3ce2658a40b5d884d880e1c90f599ee 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -40,6 +40,7 @@ namespace PETScWrappers
  * functions). Only the functions creating a vector of specific type differ,
  * and are implemented in this particular class.
  *
+ * @ingroup Vectors
  * @author Wolfgang Bangerth, 2004
  */
   class Vector : public VectorBase
index eb1b9963a956fff9281d545b5df6fd9e0d109851..a4252f02d3d9ef8afe1df1d3d1c1abcc5104a586 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -35,6 +35,7 @@ template <typename number> class Vector;
  * A namespace in which wrapper classes for PETSc objects reside.
  *
  * @ingroup PETScWrappers
+ * @ingroup Vectors
  * @see @ref SoftwarePETSc
  * @author Wolfgang Bangerth, 2004
  */
index 9af439f4d094b2d3d8e7601d3f815eb9704b3e90..50523baabcf6a80c34edebf722669a40b9c2e05a 100644 (file)
@@ -33,7 +33,7 @@ class CompressedSetSparsityPattern;
 
 
 
-/*! @addtogroup Matrix1
+/*! @addtogroup Sparsity
  *@{
  */
 
@@ -382,80 +382,10 @@ namespace internals
 
 /**
  * Structure representing the sparsity pattern of a sparse matrix.
- * 
- * The following picture will illustrate the relation between the
- * SparsityPattern an the SparseMatrix.
  *
- * @verbatim
- *  SparsityPattern:                               \
- *                                                 |
- *              _________________________          |
- *  rowstart   |0 | 4| 8|11|13|....                |
- *             |__|__|__|__|__|__________          | 
- *              |   \  \                           |
- *              |    \  \__                        | 
- *              |     \    \                       |
- *              |      \    \__                    |
- *             \ /      \      \                   |
- *              |        \      \__                |     
- *              |         \        \               |
- *              |          \        \__            |   
- *              |           \         \           |            
- *              0___________4___________8____       \ Position         
- *  colnums    |3 | 2| 9|17| 1| 4| 6| 8| 4|..       /         
- *             /__|/_|__|__|__|__|__|__|__|__      |         
- *            /   /                                |        
- *           / \______  _____/ \_____  _____/      |         
- *          /         \/             \/            |                 
- *         /   /  row = 0        row = 1           |    
- *        /   /                                    |
- *       /   /                                     |
- *      /   /                                      | 
- *     /   /___colnums[1]                          |  
- *    /                                            |
- *   /_________colnums[0]                          |
- *                                                 |                    
- *                                                /                    
- * @endverbatim
- *
- * @verbatim
- * For row = 0
- *   
- * there are: (0| 3) = colnums[0]
- *            (0| 2) = colnums[1]
- *            (0| 9) = colnums[2]
- *            (0|17) = colnums[3]
- *
- * For row = 1
- *   
- * there are: (1| 1) = colnums[4]
- *            (1| 4) = colnums[5]
- * ....
- *
- * @endverbatim
- *
- * @verbatim
- * SparseMatrix:                                  \
- *                                                 |
- *              _____________________________      |
- *  val        |  |  |  |  |  |  |  |  | 3|..       \ Value
- *             |__|__|__|__|__|__|__|__|__|__       /
- *                                                 |
- *                                                 |
- *                                                /
- * @endverbatim
- *
- * If you want to get the <tt>3</tt> you need to get its position in
- * the table above and its value by returning the value of the element
- * on which the pointer shows, using <tt>*val</tt>. For example
- * <tt>val[8]=3</tt>. Its position is <tt>colnums[8]</tt> so
- * <tt>row=2</tt>. In other words, if you want to get the element
- * <i>a<sub>24</sub></i> you know that <tt>row=2</tt>. To get the
- * element, a search of <tt>4</tt> form <tt>colnums[rowstart[2]]</tt>
- * to <tt>colnums[rowstart[3]]</tt> is needed. Then
- * <i>a<sub>24</sub></i>=<tt>val[number of the found element] =
- * 3</tt>.
+ * This class is an example of the "static" type of @ref Sparsity.
  *
+ * It uses the compressed row storage (CSR) format to store data.
  *
  * @author Wolfgang Bangerth, Guido Kanschat and others
  */
index 68fec80527ca66799680f3db323f1305864d838f..7968812b9fcc92311cbf08babbf38824f14af040 100644 (file)
@@ -282,6 +282,7 @@ BlockSparsityPatternBase<SparsityPatternBase>::print(std::ostream& out) const
 
 template class BlockSparsityPatternBase<SparsityPattern>;
 template class BlockSparsityPatternBase<CompressedSparsityPattern>;
+template class BlockSparsityPatternBase<CompressedSetSparsityPattern>;
 
 
 
@@ -354,7 +355,7 @@ BlockSparsityPattern::memory_consumption () const
 
 
 void
-BlockSparsityPattern::copy_from  (const CompressedBlockSparsityPattern &csp)
+BlockSparsityPattern::copy_from  (const BlockCompressedSparsityPattern &csp)
 {
                                   // delete old content, set block
                                   // sizes anew
@@ -372,13 +373,32 @@ BlockSparsityPattern::copy_from  (const CompressedBlockSparsityPattern &csp)
 
 
 
-CompressedBlockSparsityPattern::CompressedBlockSparsityPattern ()
+void
+BlockSparsityPattern::copy_from  (const BlockCompressedSetSparsityPattern &csp)
+{
+                                  // delete old content, set block
+                                  // sizes anew
+  reinit (csp.n_block_rows(), csp.n_block_cols());
+
+                                  // copy over blocks
+  for (unsigned int i=0; i<rows; ++i)
+    for (unsigned int j=0; j<rows; ++j)
+      block(i,j).copy_from (csp.block(i,j));
+
+                                  // and finally enquire their new
+                                  // sizes
+  collect_sizes();
+}
+
+
+
+BlockCompressedSparsityPattern::BlockCompressedSparsityPattern ()
 {}
 
 
 
-CompressedBlockSparsityPattern::
-CompressedBlockSparsityPattern (const unsigned int n_rows,
+BlockCompressedSparsityPattern::
+BlockCompressedSparsityPattern (const unsigned int n_rows,
                                const unsigned int n_columns)
                :
                BlockSparsityPatternBase<CompressedSparsityPattern>(n_rows,
@@ -386,8 +406,8 @@ CompressedBlockSparsityPattern (const unsigned int n_rows,
 {}
 
 
-CompressedBlockSparsityPattern::
-CompressedBlockSparsityPattern (const std::vector<unsigned int>& row_indices,
+BlockCompressedSparsityPattern::
+BlockCompressedSparsityPattern (const std::vector<unsigned int>& row_indices,
                                const std::vector<unsigned int>& col_indices)
                :
                BlockSparsityPatternBase<CompressedSparsityPattern>(row_indices.size(),
@@ -401,7 +421,49 @@ CompressedBlockSparsityPattern (const std::vector<unsigned int>& row_indices,
 
 
 void
-CompressedBlockSparsityPattern::reinit (
+BlockCompressedSparsityPattern::reinit (
+  const std::vector< unsigned int > &row_block_sizes,
+  const std::vector< unsigned int > &col_block_sizes)
+{
+  this->reinit(row_block_sizes.size(), col_block_sizes.size());
+  for (unsigned int i=0;i<row_block_sizes.size();++i)
+    for (unsigned int j=0;j<col_block_sizes.size();++j)
+      this->block(i,j).reinit(row_block_sizes[i],col_block_sizes[j]);
+  this->collect_sizes();  
+}
+
+
+
+BlockCompressedSetSparsityPattern::BlockCompressedSetSparsityPattern ()
+{}
+
+
+
+BlockCompressedSetSparsityPattern::
+BlockCompressedSetSparsityPattern (const unsigned int n_rows,
+                               const unsigned int n_columns)
+               :
+               BlockSparsityPatternBase<CompressedSetSparsityPattern>(n_rows,
+                                                                   n_columns)
+{}
+
+
+BlockCompressedSetSparsityPattern::
+BlockCompressedSetSparsityPattern (const std::vector<unsigned int>& row_indices,
+                               const std::vector<unsigned int>& col_indices)
+               :
+               BlockSparsityPatternBase<CompressedSetSparsityPattern>(row_indices.size(),
+                                                                   col_indices.size())
+{
+  for (unsigned int i=0;i<row_indices.size();++i)
+    for (unsigned int j=0;j<col_indices.size();++j)
+      this->block(i,j).reinit(row_indices[i],col_indices[j]);
+  this->collect_sizes();
+}
+
+
+void
+BlockCompressedSetSparsityPattern::reinit (
   const std::vector< unsigned int > &row_block_sizes,
   const std::vector< unsigned int > &col_block_sizes)
 {
index 05e1d4f3481b87d3418c215ea963b6d389f3cb07..071ca537ce315e11a4f78d428902e86391ae3e08 100644 (file)
@@ -628,7 +628,7 @@ SparsityPattern::copy_from (const CompressedSetSparsityPattern &csp,
   for (unsigned int row = 0; row<csp.n_rows(); ++row)
     {
       unsigned int *cols = &colnums[rowstart[row]] + (is_square ? 1 : 0);
-      CompressedSetSparsityPattern::CSSPIterator col_num = csp.row_begin (row);
+      CompressedSetSparsityPattern::row_iterator col_num = csp.row_begin (row);
 
       for (; col_num != csp.row_end (row); ++col_num)
        {
index 9ea765db3ee0db8c8142da418edea18a00cee583..95c47f756748e09ef112a26fafdffd0da73d8c98 100644 (file)
@@ -67,7 +67,7 @@ void test ()
   block_sizes[0] = dof_handler.n_dofs()/3;
   block_sizes[1] = dof_handler.n_dofs() - block_sizes[0];
 
-  CompressedBlockSparsityPattern sparsity(2,2);
+  BlockCompressedSparsityPattern sparsity(2,2);
   for (unsigned int i=0; i<2; ++i)
     for (unsigned int j=0; j<2; ++j)
       sparsity.block(i,j).reinit (block_sizes[i], block_sizes[j]);
index e32133a4f463a377d84c78758ba079438a646b77..3a033d0403e0e2d5c9b5eaee909c814377c29bf0 100644 (file)
@@ -18,7 +18,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
-//                         CompressedBlockSparsityPattern  &);
+//                         BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_01d/output";
 
@@ -38,7 +38,7 @@ check_this (const DoFHandler<dim> &dof_handler)
   
                                    // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
-  CompressedBlockSparsityPattern sp (n_components,
+  BlockCompressedSparsityPattern sp (n_components,
                                      n_components);
   std::vector<unsigned int> dofs_per_component(n_components);
   DoFTools::count_dofs_per_component (dof_handler,
index 461881f0f2aced7e5fb0089a99f5d9d1463b3c04..6e3f9a9cf4ab5f1d7782bf9ee1a1ba77851f6f8f 100644 (file)
@@ -19,7 +19,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
 //                          std::vector<std::vector<bool> > &,
-//                         CompressedBlockSparsityPattern  &);
+//                         BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_02d/output";
 
@@ -45,7 +45,7 @@ check_this (const DoFHandler<dim> &dof_handler)
     return;
   
                                    // create sparsity pattern
-  CompressedBlockSparsityPattern sp (n_components,
+  BlockCompressedSparsityPattern sp (n_components,
                                      n_components);
   std::vector<unsigned int> dofs_per_component(n_components);
   DoFTools::count_dofs_per_component (dof_handler,
index 5b50ce996253a68505e29e140781062de9425dc9..a79aa86b744f594a66cccb235561477b45c090a5 100644 (file)
@@ -19,7 +19,7 @@
 //   DoFTools::
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const std::vector<unsigned int> &
-//                                  CompressedBlockSparsityPattern  &);
+//                                  BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_15d/output";
 
@@ -38,7 +38,7 @@ check_this (const DoFHandler<dim> &dof_handler)
   
   const unsigned int n_blocks = std::min (dof_handler.get_fe().n_components(),
                                           dof_handler.n_boundary_dofs());
-  CompressedBlockSparsityPattern sp (n_blocks,
+  BlockCompressedSparsityPattern sp (n_blocks,
                                      n_blocks);
                                    // split dofs almost arbitrarily to
                                    // blocks
index 66cddda5fb8834139b8f17b7052c989913d0ee15..3b9d1a49555149b23bce5b22ba1148a0c2c4c55a 100644 (file)
@@ -20,7 +20,7 @@
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const typename FunctionMap<dim>::type &
 //                                   const std::vector<unsigned int> &
-//                                  CompressedBlockSparsityPattern  &);
+//                                  BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_16d/output";
 
@@ -44,7 +44,7 @@ check_this (const DoFHandler<dim> &dof_handler)
   const unsigned int n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
   const unsigned int n_blocks = std::min (dof_handler.get_fe().n_components(),
                                           n_boundary_dofs);
-  CompressedBlockSparsityPattern sp (n_blocks,
+  BlockCompressedSparsityPattern sp (n_blocks,
                                      n_blocks);
                                    // split dofs almost arbitrarily to
                                    // blocks
index 4413d31fd50168f5903fb249aaca43d09980bc1c..42f5821f7d382287faa2852a633ae52350d33c71 100644 (file)
@@ -18,7 +18,7 @@
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              CompressedBlockSparsityPattern  &);
+//                              BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_17d/output";
 
@@ -38,7 +38,7 @@ check_this (const DoFHandler<dim> &dof_handler)
   
                                    // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
-  CompressedBlockSparsityPattern sp (n_components,
+  BlockCompressedSparsityPattern sp (n_components,
                                      n_components);
   std::vector<unsigned int> dofs_per_component(n_components);
   DoFTools::count_dofs_per_component (dof_handler,
index 8bea3e6076c001d723019f05f387415680ba8049..5326a5c27b712a8cbfc2da02f93d81c4ed70c44b 100644 (file)
@@ -18,7 +18,7 @@
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              CompressedBlockSparsityPattern  &);
+//                              BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_18d/output";
 
@@ -64,7 +64,7 @@ my_check_this (const DoFHandler<dim> &dof_handler)
   
                                    // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
-  CompressedBlockSparsityPattern sp (n_components,
+  BlockCompressedSparsityPattern sp (n_components,
                                      n_components);
   std::vector<unsigned int> dofs_per_component(n_components);
   DoFTools::count_dofs_per_component (dof_handler,
index 8ac51a0979fc9cfc2347f456859ae65a2c0f9963..fb9b8decbbda65830e6d1dd97c9f4186d3f2bbe4 100644 (file)
@@ -195,7 +195,7 @@ check ()
   sparsity_3.compress ();
 
   BlockSparsityPattern sparsity_4;
-  CompressedBlockSparsityPattern csp_4(2,2);
+  BlockCompressedSparsityPattern csp_4(2,2);
   csp_4.block(0,0).reinit (n1,n1);
   csp_4.block(1,0).reinit (n2,n1);
   csp_4.block(0,1).reinit (n1,n2);
index 6457c38c5abc3955b96c9e3deeb4a648832313d3..69974e0d7523ef7c2442d92f17409aca34cfb1c5 100644 (file)
@@ -195,7 +195,7 @@ check ()
   sparsity_3.compress ();
 
   BlockSparsityPattern sparsity_4;
-  CompressedBlockSparsityPattern csp_4(2,2);
+  BlockCompressedSparsityPattern csp_4(2,2);
   csp_4.block(0,0).reinit (n1,n1);
   csp_4.block(1,0).reinit (n2,n1);
   csp_4.block(0,1).reinit (n1,n2);
index c7248150e99e385b57660f6373fdb7dc96504ddc..48bd8596e05393a672b8289e05b5f9b2518257be 100644 (file)
@@ -160,7 +160,7 @@ check ()
   sparsity_3.compress ();
 
   BlockSparsityPattern sparsity_4;
-  CompressedBlockSparsityPattern csp_4(2,2);
+  BlockCompressedSparsityPattern csp_4(2,2);
   csp_4.block(0,0).reinit (n1,n1);
   csp_4.block(1,0).reinit (n2,n1);
   csp_4.block(0,1).reinit (n1,n2);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.