From 8ffd036e7c4b40c9fdf81ac3ee57a6042ce0ce2b Mon Sep 17 00:00:00 2001
From: Wolfgang Bangerth
Date: Mon, 15 May 2000 11:06:38 +0000
Subject: [PATCH] Make the sparsity pattern a template arg of
make_sparsity_pattern.
git-svn-id: https://svn.dealii.org/trunk@2852 0785d39b-7218-0410-832d-ea1e28bc413d
---
deal.II/deal.II/include/dofs/dof_tools.h | 18 ++++++++++++++++--
deal.II/deal.II/source/dofs/dof_tools.cc | 24 +++++++++++++++++++++---
deal.II/doc/news/2000/c-3-0.html | 8 ++++++++
3 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/deal.II/deal.II/include/dofs/dof_tools.h b/deal.II/deal.II/include/dofs/dof_tools.h
index 4ddd49adcc..33b45a5946 100644
--- a/deal.II/deal.II/include/dofs/dof_tools.h
+++ b/deal.II/deal.II/include/dofs/dof_tools.h
@@ -98,8 +98,15 @@ class DoFTools
* Remember using
* #SparsityPattern::compress()#
* after generating the pattern.
+ *
+ * The actual type of the
+ * sparsity pattern may be
+ * #SparsityPattern#,
+ * #BlockSparsityPattern#, or any
+ * other class that satisfies
+ * similar requirements.
*/
- template
+ template
static void make_sparsity_pattern (const DoFHandler &dof,
SparsityPattern &sparsity_pattern);
@@ -157,8 +164,15 @@ class DoFTools
* the matrix structure just like the
* previous function, but does not create
* elements if not specified by the mask.
+ *
+ * The actual type of the
+ * sparsity pattern may be
+ * #SparsityPattern#,
+ * #BlockSparsityPattern#, or any
+ * other class that satisfies
+ * similar requirements.
*/
- template
+ template
static void make_sparsity_pattern (const DoFHandler &dof,
const vector > &mask,
SparsityPattern &sparsity_pattern);
diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc
index 42a8edc3ac..80b2b24b2b 100644
--- a/deal.II/deal.II/source/dofs/dof_tools.cc
+++ b/deal.II/deal.II/source/dofs/dof_tools.cc
@@ -24,12 +24,13 @@
#include
#include
#include
+#include
#include
#include
-template
+template
void
DoFTools::make_sparsity_pattern (const DoFHandler &dof,
SparsityPattern &sparsity)
@@ -57,7 +58,7 @@ DoFTools::make_sparsity_pattern (const DoFHandler &dof,
}
-template
+template
void
DoFTools::make_sparsity_pattern (const DoFHandler &dof,
const vector > &mask,
@@ -1414,13 +1415,30 @@ DoFTools::make_boundary_sparsity_pattern (const DoFHandler& d
template void
DoFTools::make_sparsity_pattern (const DoFHandler& dof,
- SparsityPattern &sparsity);
+ SparsityPattern &sparsity);
+
+template void
+DoFTools::make_sparsity_pattern (const DoFHandler &dof,
+ BlockSparsityPattern<2,2> &sparsity);
+template void
+DoFTools::make_sparsity_pattern (const DoFHandler &dof,
+ BlockSparsityPattern<3,3> &sparsity);
template void
DoFTools::make_sparsity_pattern (const DoFHandler& dof,
const vector > &mask,
SparsityPattern &sparsity);
+template void
+DoFTools::make_sparsity_pattern (const DoFHandler& dof,
+ const vector > &mask,
+ BlockSparsityPattern<2,2> &sparsity);
+
+template void
+DoFTools::make_sparsity_pattern (const DoFHandler& dof,
+ const vector > &mask,
+ BlockSparsityPattern<3,3> &sparsity);
+
template
void
DoFTools::distribute_cell_to_dof_vector (const DoFHandler &dof_handler,
diff --git a/deal.II/doc/news/2000/c-3-0.html b/deal.II/doc/news/2000/c-3-0.html
index 2308caf7df..24942a0c1b 100644
--- a/deal.II/doc/news/2000/c-3-0.html
+++ b/deal.II/doc/news/2000/c-3-0.html
@@ -199,6 +199,14 @@
New: DoFRenumbering::sort_selected_dofs_back ()
sorts selected degrees of freedom to the end of the index range.
+
+
+ Extended: DoFTools::make_sparsity_pattern ()
+ now accepts a template parameter as sparsity pattern. This
+ allows to use this function for the usual
+ SparsityPattern
, or for
+ BlockSparsityPattern
arguments.
+
--
2.39.5