]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New functions to condense right away a sparsity pattern upon creation. Rewrite most...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 4 Jun 2007 10:00:53 +0000 (10:00 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 4 Jun 2007 10:00:53 +0000 (10:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@14747 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/dofs/dof_constraints.cc
deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/doc/doxygen/images/hp-refinement-simple.png [new file with mode: 0644]
deal.II/doc/news/changes.html

index 549c08d27551484eb4f67dd125b022378eb6e68e..0ea47bc9a1959192fe500e7d0ecef21b49221270 100644 (file)
@@ -79,13 +79,6 @@ ConstraintMatrix::ConstraintLine::memory_consumption () const
 
 
 
-ConstraintMatrix::ConstraintMatrix ()
-               :
-               lines (),
-               sorted (false)
-{}
-
-
 void
 ConstraintMatrix::add_entries (const unsigned int                        line,
                                const std::vector<std::pair<unsigned int,double> > &col_val_pairs)
@@ -1502,4 +1495,22 @@ MATRIX_FUNCTIONS(PETScWrappers::MPI::SparseMatrix);
 MATRIX_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix);
 #endif
 
+template void ConstraintMatrix::
+add_entries_local_to_global<SparsityPattern> (const std::vector<unsigned int> &,
+                                             SparsityPattern                 &,
+                                             const bool) const;
+template void ConstraintMatrix::
+add_entries_local_to_global<CompressedSparsityPattern> (const std::vector<unsigned int> &,
+                                             CompressedSparsityPattern       &,
+                                             const bool) const;
+template void ConstraintMatrix::
+add_entries_local_to_global<BlockSparsityPattern> (const std::vector<unsigned int> &,
+                                             BlockSparsityPattern       &,
+                                             const bool) const;
+template void ConstraintMatrix::
+add_entries_local_to_global<CompressedBlockSparsityPattern> (const std::vector<unsigned int> &,
+                                             CompressedBlockSparsityPattern       &,
+                                             const bool) const;
+
+
 DEAL_II_NAMESPACE_CLOSE
index a47c140e62706a711af58639ea6897c1bb64f748..c4ece0c0c3142a2a885913f3ac1966f755ad3068 100644 (file)
@@ -46,9 +46,9 @@ DEAL_II_NAMESPACE_OPEN
 
 template <class DH, class SparsityPattern>
 void
-DoFTools::make_sparsity_pattern (
-  const DH        &dof,
-  SparsityPattern &sparsity)
+DoFTools::make_sparsity_pattern (const DH        &dof,
+                                SparsityPattern &sparsity,
+                                const ConstraintMatrix &constraints)
 {
   const unsigned int n_dofs = dof.n_dofs();
 
@@ -66,11 +66,13 @@ DoFTools::make_sparsity_pattern (
       const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
       dofs_on_this_cell.resize (dofs_per_cell);
       cell->get_dof_indices (dofs_on_this_cell);
-                                      // make sparsity pattern for this cell
-      for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         sparsity.add (dofs_on_this_cell[i],
-                       dofs_on_this_cell[j]);
+
+                                      // make sparsity pattern for this
+                                      // cell. if no constraints pattern was
+                                      // given, then the following call acts
+                                      // as if simply no constraints existed
+      constraints.add_entries_local_to_global (dofs_on_this_cell,
+                                              sparsity);
     }
 }
 
@@ -1017,7 +1019,7 @@ namespace internal
                                        * degrees of freedom of fe1 to the
                                        * space described by fe2 (for example
                                        * for the complex case described in
-                                       * the hp paper), we have to select
+                                       * the @ref hp_paper "hp paper"), we have to select
                                        * fe2.dofs_per_face out of the
                                        * fe1.dofs_per_face face DoFs as the
                                        * master DoFs, and the rest become
@@ -1300,7 +1302,7 @@ namespace internal
                                        * split it into its master and
                                        * slave parts and invert the
                                        * master part as explained in
-                                       * the hp paper.
+                                       * the @ref hp_paper "hp paper".
                                        */
 #ifdef DEAL_II_ANON_NAMESPACE_BUG
       static
@@ -2085,7 +2087,7 @@ namespace internal
                                       // inverted. these two matrices
                                       // are derived from the face
                                       // interpolation matrix as
-                                      // described in the hp paper
+                                      // described in the @ref hp_paper "hp paper"
       Table<2,boost::shared_ptr<std::pair<FullMatrix<double>,FullMatrix<double> > > >
         split_face_interpolation_matrices (n_finite_elements (dof_handler),
                                           n_finite_elements (dof_handler));
@@ -4959,43 +4961,51 @@ template void
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
                                SparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
- SparsityPattern    &sparsity);
+ SparsityPattern    &sparsity,
+ const ConstraintMatrix &);
 template void
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
                                CompressedSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
- CompressedSparsityPattern    &sparsity);
+ CompressedSparsityPattern    &sparsity,
+ const ConstraintMatrix &);
 template void
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
                                BlockSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
- BlockSparsityPattern                &sparsity);
+ BlockSparsityPattern                &sparsity,
+ const ConstraintMatrix &);
 template void
 DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension>,
                                CompressedBlockSparsityPattern>
 (const DoFHandler<deal_II_dimension> &dof,
- CompressedBlockSparsityPattern      &sparsity);
+ CompressedBlockSparsityPattern      &sparsity,
+ const ConstraintMatrix &);
 
 template void
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
                                SparsityPattern>
 (const hp::DoFHandler<deal_II_dimension> &dof,
- SparsityPattern    &sparsity);
+ SparsityPattern    &sparsity,
+ const ConstraintMatrix &);
 template void
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
                                CompressedSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension> &dof,
- CompressedSparsityPattern    &sparsity);
+ CompressedSparsityPattern    &sparsity,
+ const ConstraintMatrix &);
 template void
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
                                BlockSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension> &dof,
- BlockSparsityPattern                &sparsity);
+ BlockSparsityPattern                &sparsity,
+ const ConstraintMatrix &);
 template void
 DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
                                CompressedBlockSparsityPattern>
 (const hp::DoFHandler<deal_II_dimension> &dof,
- CompressedBlockSparsityPattern      &sparsity);
+ CompressedBlockSparsityPattern      &sparsity,
+ const ConstraintMatrix &);
 
 
 template void 
diff --git a/deal.II/doc/doxygen/images/hp-refinement-simple.png b/deal.II/doc/doxygen/images/hp-refinement-simple.png
new file mode 100644 (file)
index 0000000..1343162
Binary files /dev/null and b/deal.II/doc/doxygen/images/hp-refinement-simple.png differ
index d8cf807d61fcf37c54dc4558f0d140e1a1c0b8c1..b1d73c0bbf90551f3c9d54857c08183bd3666f11 100644 (file)
@@ -1033,6 +1033,26 @@ inconvenience this causes.
 <h3>deal.II</h3>
 
 <ol>
+   <li> <p>New: the function
+       <code>DoFTools::make_sparsity_pattern</code> 
+       now takes an optional constraint matrix argument that can be used to
+       avoid the subsequent call to condense the sparsity pattern. In effect,
+       the sparsity pattern is generated condensed right away. For problems in
+       3d and with many constraints, this is many times faster than separate
+       creation and condensation.
+       <br>
+       (WB 2007/06/03)
+       </p>
+
+   <li> <p>New: the new function
+       <code>ConstraintMatrix::add_entries_local_to_global</code> 
+       can be used to add entries to a matrix where entries that will appear if
+       the current entry corresponds to a constrained degree of freedom are
+       also added.
+       <br>
+       (WB 2007/06/03)
+       </p>
+
    <li> <p>Fixed: the function
        <code>GridTools::find_cells_adjacent_to_vertex</code> 
        was not detecting properly the coarse cells adjacent to

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.