From: wolf Date: Fri, 24 Nov 2000 15:42:32 +0000 (+0000) Subject: Remove block numbers as templates arguments of BlockSparsityPattern. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0558ae80a37f9a0048c4322c0bb4c3f2961fc6fb;p=dealii-svn.git Remove block numbers as templates arguments of BlockSparsityPattern. git-svn-id: https://svn.dealii.org/trunk@3501 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/dof_constraints.h b/deal.II/deal.II/include/dofs/dof_constraints.h index 316495496a..526304a923 100644 --- a/deal.II/deal.II/include/dofs/dof_constraints.h +++ b/deal.II/deal.II/include/dofs/dof_constraints.h @@ -20,7 +20,7 @@ #include class SparsityPattern; -template class BlockSparsityPattern; +class BlockSparsityPattern; template class SparseMatrix; template class BlockSparseMatrix; class BlockIndices; @@ -255,8 +255,7 @@ class ConstraintMatrix : public Subscriptor * condenses square block sparsity * patterns. */ - template - void condense (BlockSparsityPattern &sparsity) const; + void condense (BlockSparsityPattern &sparsity) const; /** * Condense a given matrix. The associated diff --git a/deal.II/deal.II/include/dofs/dof_constraints.templates.h b/deal.II/deal.II/include/dofs/dof_constraints.templates.h index 6deb241407..20dcee477b 100644 --- a/deal.II/deal.II/include/dofs/dof_constraints.templates.h +++ b/deal.II/deal.II/include/dofs/dof_constraints.templates.h @@ -18,145 +18,6 @@ -template -void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const -{ - Assert (sorted == true, ExcMatrixNotClosed()); - Assert (sparsity.is_compressed() == false, ExcMatrixIsClosed()); - Assert (sparsity.n_rows() == sparsity.n_cols(), - ExcMatrixNotSquare()); - Assert (sparsity.get_column_indices() == sparsity.get_row_indices(), - ExcMatrixNotSquare()); - - const BlockIndices & - index_mapping = sparsity.get_column_indices(); - - // store for each index whether it - // must be distributed or not. If entry - // is -1, no distribution is necessary. - // otherwise, the number states which - // line in the constraint matrix handles - // this index - vector distribute (sparsity.n_rows(), -1); - - for (unsigned int c=0; c(c); - - const unsigned int n_rows = sparsity.n_rows(); - for (unsigned int row=0; row - block_index = index_mapping.global_to_local(row); - const unsigned int block_row = block_index.first; - - if (distribute[row] == -1) - // regular line. loop over - // all columns and see - // whether this column must - // be distributed - { - - // to loop over all entries - // in this row, we have to - // loop over all blocks in - // this blockrow and the - // corresponding row - // therein - for (unsigned int block_col=0; block_col void @@ -405,13 +266,15 @@ template void ConstraintMatrix::condense (BlockSparseMatrix &uncondensed) const { - const BlockSparsityPattern & + const BlockSparsityPattern & sparsity = uncondensed.get_sparsity_pattern (); Assert (sorted == true, ExcMatrixNotClosed()); Assert (sparsity.is_compressed() == true, ExcMatrixNotClosed()); Assert (sparsity.n_rows() == sparsity.n_cols(), ExcMatrixNotSquare()); + Assert (sparsity.n_block_rows() == sparsity.n_block_cols(), + ExcMatrixNotSquare()); Assert (sparsity.get_column_indices() == sparsity.get_row_indices(), ExcMatrixNotSquare()); diff --git a/deal.II/deal.II/source/dofs/dof_constraints.cc b/deal.II/deal.II/source/dofs/dof_constraints.cc index d0bbdbbd15..d6975d3bdb 100644 --- a/deal.II/deal.II/source/dofs/dof_constraints.cc +++ b/deal.II/deal.II/source/dofs/dof_constraints.cc @@ -410,6 +410,149 @@ void ConstraintMatrix::condense (SparsityPattern &sparsity) const +void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const +{ + Assert (sorted == true, ExcMatrixNotClosed()); + Assert (sparsity.is_compressed() == false, ExcMatrixIsClosed()); + Assert (sparsity.n_rows() == sparsity.n_cols(), + ExcMatrixNotSquare()); + Assert (sparsity.n_block_rows() == sparsity.n_block_cols(), + ExcMatrixNotSquare()); + Assert (sparsity.get_column_indices() == sparsity.get_row_indices(), + ExcMatrixNotSquare()); + + const BlockIndices & + index_mapping = sparsity.get_column_indices(); + + const unsigned int n_blocks = sparsity.n_block_rows(); + + // store for each index whether it + // must be distributed or not. If entry + // is -1, no distribution is necessary. + // otherwise, the number states which + // line in the constraint matrix handles + // this index + vector distribute (sparsity.n_rows(), -1); + + for (unsigned int c=0; c(c); + + const unsigned int n_rows = sparsity.n_rows(); + for (unsigned int row=0; row + block_index = index_mapping.global_to_local(row); + const unsigned int block_row = block_index.first; + + if (distribute[row] == -1) + // regular line. loop over + // all columns and see + // whether this column must + // be distributed + { + + // to loop over all entries + // in this row, we have to + // loop over all blocks in + // this blockrow and the + // corresponding row + // therein + for (unsigned int block_col=0; block_col -matrix_functions_2; -#undef MatrixType - -#define MatrixType BlockSparsityPattern<3,3> -matrix_functions_2; -#undef MatrixType - diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 9c6aa0b71d..46ab22e16c 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -1692,10 +1692,7 @@ DoFTools::make_sparsity_pattern (const DoFHandler& dof, 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); + BlockSparsityPattern &sparsity); template void DoFTools::make_sparsity_pattern (const DoFHandler& dof, @@ -1705,12 +1702,7 @@ DoFTools::make_sparsity_pattern (const DoFHandler& dof, 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); + BlockSparsityPattern &sparsity); template void diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index d0dd1a726e..9b9172c178 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -719,7 +719,7 @@ MatrixTools::apply_boundary_values (const map &boundar map::const_iterator dof = boundary_values.begin(), endd = boundary_values.end(); const unsigned int n_dofs = matrix.m(); - const BlockSparsityPattern & + const BlockSparsityPattern & sparsity_pattern = matrix.get_sparsity_pattern(); // if a diagonal entry is zero diff --git a/deal.II/lac/include/lac/block_indices.h b/deal.II/lac/include/lac/block_indices.h index 2baeaff2ff..a48c81800f 100644 --- a/deal.II/lac/include/lac/block_indices.h +++ b/deal.II/lac/include/lac/block_indices.h @@ -47,6 +47,14 @@ class BlockIndices * size of the vector */ BlockIndices (const vector &n); + + /** + * Reinitialize the number of + * blocks and assign each block + * the same number of elements. + */ + void reinit (const unsigned int n_blocks, + const unsigned int n_elements_per_block); /** * Reinitialize the number of @@ -152,6 +160,17 @@ BlockIndices::BlockIndices (const vector &n) +inline +void +BlockIndices::reinit (const unsigned int n_blocks, + const unsigned int n_elements_per_block) +{ + const vector v(n_blocks, n_elements_per_block); + reinit (v); +}; + + + inline void BlockIndices::reinit (const vector &n) diff --git a/deal.II/lac/include/lac/block_sparse_matrix.h b/deal.II/lac/include/lac/block_sparse_matrix.h index 94962632c8..a1b70e92a2 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.h @@ -97,7 +97,7 @@ class BlockSparseMatrix : public Subscriptor * long as @p{reinit} is not called * with a new sparsity structure. */ - BlockSparseMatrix (const BlockSparsityPattern &sparsity); + BlockSparseMatrix (const BlockSparsityPattern &sparsity); @@ -144,7 +144,7 @@ class BlockSparseMatrix : public Subscriptor * The elements of the matrix are * set to zero by this function. */ - virtual void reinit (const BlockSparsityPattern &sparsity); + virtual void reinit (const BlockSparsityPattern &sparsity); /** @@ -178,17 +178,17 @@ class BlockSparseMatrix : public Subscriptor */ virtual void clear (); - /** - * Return the number of blocks in a - * column. - */ - unsigned int n_block_rows () const; - - /** - * Return the number of blocks in a - * row. - */ - unsigned int n_block_cols () const; + /** + * Return the number of blocks in a + * column. + */ + unsigned int n_block_rows () const; + + /** + * Return the number of blocks in a + * row. + */ + unsigned int n_block_cols () const; /** * Return whether the object is @@ -434,7 +434,7 @@ class BlockSparseMatrix : public Subscriptor * function of objects which * operate on it. */ - const BlockSparsityPattern & + const BlockSparsityPattern & get_sparsity_pattern () const; /** @@ -452,7 +452,7 @@ class BlockSparseMatrix : public Subscriptor * it using the @p{SmartPointer} * class. */ - SmartPointer > sparsity_pattern; + SmartPointer sparsity_pattern; /** * Array of sub-matrices. diff --git a/deal.II/lac/include/lac/block_sparse_matrix.templates.h b/deal.II/lac/include/lac/block_sparse_matrix.templates.h index b5dfc66abe..e7cb56603c 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.templates.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.templates.h @@ -27,7 +27,7 @@ BlockSparseMatrix::BlockSparseMatrix () : template BlockSparseMatrix:: -BlockSparseMatrix (const BlockSparsityPattern &sparsity) +BlockSparseMatrix (const BlockSparsityPattern &sparsity) { reinit (sparsity); }; @@ -65,7 +65,7 @@ BlockSparseMatrix::reinit () template void BlockSparseMatrix:: -reinit (const BlockSparsityPattern &sparsity) +reinit (const BlockSparsityPattern &sparsity) { sparsity_pattern = &sparsity; @@ -112,7 +112,7 @@ BlockSparseMatrix::n_nonzero_elements () const template -const BlockSparsityPattern & +const BlockSparsityPattern & BlockSparseMatrix::get_sparsity_pattern () const { return *sparsity_pattern; diff --git a/deal.II/lac/include/lac/block_sparsity_pattern.h b/deal.II/lac/include/lac/block_sparsity_pattern.h index e072ff269e..029cbbb2a8 100644 --- a/deal.II/lac/include/lac/block_sparsity_pattern.h +++ b/deal.II/lac/include/lac/block_sparsity_pattern.h @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -28,12 +29,11 @@ * calls to its member functions to calls to the respective member * functions of the member sparsity patterns. * - * The largest difference between the @p{SparsityPattern} class and this - * class is probably the absence of several of the constructors as - * well as the absenceof the @p{reinit} functions. The reason is that - * mostly, the matrices have different properties and you will want to - * initialize the blocks making up the matrix separately. You can - * access the different blocks using the @p{block(row,col)} function. + * The largest difference between the @p{SparsityPattern} class and + * this class is that mostly, the matrices have different properties + * and you will want to work on the blocks making up the matrix rather + * than the whole matrix. You can access the different blocks using + * the @p{block(row,col)} function. * * Attention: this object is not automatically notified if the size of * one of its subobjects' size is changed. After you initialize the @@ -57,7 +57,6 @@ * * @author Wolfgang Bangerth, 2000 */ -template class BlockSparsityPattern : public Subscriptor { public: @@ -88,10 +87,70 @@ class BlockSparsityPattern : public Subscriptor BlockSparsityPattern (); /** - * Copy operator. For this the same holds - * as for the copy constructor: it is - * declared, defined and fine to be called, - * but the latter only for empty objects. + * Initialize the matrix with the + * given number of block rows and + * columns. The blocks themselves + * are still empty, and you have + * to call @p{collect_args} after + * you assign them sizes. + */ + BlockSparsityPattern (const unsigned int n_rows, + const unsigned int n_columns); + + /** + * Copy constructor. This + * constructor is only allowed to + * be called if the sparsity pattern to be + * copied is empty, i.e. there + * are no block allocated at + * present. This is for the same + * reason as for the + * @p{SparsityPattern}, see there + * for the details. + */ + BlockSparsityPattern (const BlockSparsityPattern &bsp); + + /** + * Destructor. + */ + ~BlockSparsityPattern (); + + /** + * Resize the matrix. This + * deletes all previously + * existant blocks and replaces + * them by unitialized ones, + * i.e. ones for which also the + * sizes are not yet set. You + * have to do that by calling the + * @p{reinit} functions of the + * blocks themselves. Do not + * forget to call + * @p{collect_size} after that on + * this object. + * + * The reason that you have to + * set sizes of the blocks + * yourself is that the sizes may + * be varying, the maximum number + * of elements per row may be + * varying, etc. It is simpler + * not to reproduce the interface + * of the @p{SparsityPattern} + * class here but rather let the + * user call whatever function + * she desires. + */ + void reinit (const unsigned int n_rows, + const unsigned int n_columns); + + /** + * Copy operator. For this the + * same holds as for the copy + * constructor: it is declared, + * defined and fine to be called, + * but the latter only for empty + * objects. */ BlockSparsityPattern & operator = (const BlockSparsityPattern &); @@ -154,17 +213,17 @@ class BlockSparsityPattern : public Subscriptor */ void compress (); - /** - * Return the number of blocks in a - * column. - */ - unsigned int n_block_rows () const; - - /** - * Return the number of blocks in a - * row. - */ - unsigned int n_block_cols () const; + /** + * Return the number of blocks in a + * column. + */ + unsigned int n_block_rows () const; + + /** + * Return the number of blocks in a + * row. + */ + unsigned int n_block_cols () const; /** * Return whether the object is @@ -202,7 +261,7 @@ class BlockSparsityPattern : public Subscriptor * and then relays to that block. */ void add (const unsigned int i, const unsigned int j); - + /** * Return number of rows of this * matrix, which equals the @@ -272,13 +331,30 @@ class BlockSparsityPattern : public Subscriptor int, int, int, int, << "The blocks [" << arg1 << ',' << arg2 << "] and [" << arg3 << ',' << arg4 << "] have differing column numbers."); - + /** + * Exception + */ + DeclException2 (ExcIncompatibleSizes, + int, int, + << "The number of blocks " << arg1 << " and " << arg2 + << " are different."); private: + + /** + * Number of block rows. + */ + unsigned int rows; + + /** + * Number of block columns. + */ + unsigned int columns; + /** * Array of sparsity patterns. */ - SparsityPattern sub_objects[rows][columns]; + vector > > sub_objects; /** * Object storing and managing @@ -312,53 +388,48 @@ class BlockSparsityPattern : public Subscriptor -template inline SparsityPattern & -BlockSparsityPattern::block (const unsigned int row, - const unsigned int column) +BlockSparsityPattern::block (const unsigned int row, + const unsigned int column) { - return sub_objects[row][column]; + return *sub_objects[row][column]; }; -template inline const SparsityPattern & -BlockSparsityPattern::block (const unsigned int row, - const unsigned int column) const +BlockSparsityPattern::block (const unsigned int row, + const unsigned int column) const { - return sub_objects[row][column]; + return *sub_objects[row][column]; }; -template inline const BlockIndices & -BlockSparsityPattern::get_row_indices () const +BlockSparsityPattern::get_row_indices () const { return row_indices; }; -template inline const BlockIndices & -BlockSparsityPattern::get_column_indices () const +BlockSparsityPattern::get_column_indices () const { return column_indices; }; -template inline void -BlockSparsityPattern::add (const unsigned int i, - const unsigned int j) +BlockSparsityPattern::add (const unsigned int i, + const unsigned int j) { // if you get an error here, are // you sure you called @@ -366,26 +437,24 @@ BlockSparsityPattern::add (const unsigned int i, const pair row_index = row_indices.global_to_local (i), col_index = column_indices.global_to_local (j); - sub_objects[row_index.first][col_index.first].add (row_index.second, - col_index.second); + sub_objects[row_index.first][col_index.first]->add (row_index.second, + col_index.second); }; -template inline unsigned int -BlockSparsityPattern::n_block_cols () const +BlockSparsityPattern::n_block_cols () const { return columns; } -template inline unsigned int -BlockSparsityPattern::n_block_rows () const +BlockSparsityPattern::n_block_rows () const { return rows; } diff --git a/deal.II/lac/include/lac/block_sparsity_pattern.templates.h b/deal.II/lac/include/lac/block_sparsity_pattern.templates.h deleted file mode 100644 index c878cd3ccf..0000000000 --- a/deal.II/lac/include/lac/block_sparsity_pattern.templates.h +++ /dev/null @@ -1,184 +0,0 @@ -//---------------------------- block_sparsity_pattern.templates.h --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 1998, 1999, 2000 by the deal.II authors -// -// This file is subject to QPL and may not be distributed -// without copyright and license information. Please refer -// to the file deal.II/doc/license.html for the text and -// further information on this license. -// -//---------------------------- block_sparsity_pattern.templates.h --------------------------- -#ifndef __deal2__block_sparsity_pattern_templates_h -#define __deal2__block_sparsity_pattern_templates_h - - -#include - - -template -BlockSparsityPattern::BlockSparsityPattern () - : row_indices (rows), column_indices(columns) -{ - Assert (rows>0, ExcInvalidSize (rows)); - Assert (columns>0, ExcInvalidSize (columns)); -}; - - - -template -BlockSparsityPattern & -BlockSparsityPattern::operator = (const BlockSparsityPattern &bsp) -{ - // copy objects - for (unsigned int i=0; i -void -BlockSparsityPattern::collect_sizes () -{ - vector row_sizes (rows); - vector col_sizes (columns); - - // first find out the row sizes - // from the first block column - for (unsigned int r=0; r -void -BlockSparsityPattern::compress () -{ - for (unsigned int i=0; i -bool -BlockSparsityPattern::empty () const -{ - for (unsigned int i=0; i -unsigned int -BlockSparsityPattern::max_entries_per_row () const -{ - unsigned int max_entries = 0; - for (unsigned int block_row=0; block_row max_entries) - max_entries = this_row; - }; - return max_entries; -}; - - -template -unsigned int -BlockSparsityPattern::n_rows () const -{ - // only count in first column, since - // all rows should be equivalent - unsigned int count = 0; - for (unsigned int r=0; r -unsigned int -BlockSparsityPattern::n_cols () const -{ - // only count in first row, since - // all rows should be equivalent - unsigned int count = 0; - for (unsigned int c=0; c -unsigned int -BlockSparsityPattern::n_nonzero_elements () const -{ - unsigned int count = 0; - for (unsigned int i=0; i -bool -BlockSparsityPattern::is_compressed () const -{ - for (unsigned int i=0; i +#include -// explicit instantiations -template class BlockSparsityPattern<2,2>; -template class BlockSparsityPattern<2,3>; -template class BlockSparsityPattern<3,2>; -template class BlockSparsityPattern<3,3>; + +BlockSparsityPattern::BlockSparsityPattern () + : + rows (0), + columns (0) +{}; + + + +BlockSparsityPattern::BlockSparsityPattern (const unsigned int r, + const unsigned int c) + : + rows (0), + columns (0) +{ + reinit (r,c); +}; + + + +BlockSparsityPattern::~BlockSparsityPattern () +{ + // clear all memory + reinit (0,0); +}; + + + +void +BlockSparsityPattern::reinit (const unsigned int r, + const unsigned int c) +{ + // delete previous content + for (unsigned int i=0; i > (columns)); + + // allocate new objects + for (unsigned int i=0; i row_sizes (rows); + vector col_sizes (columns); + + // first find out the row sizes + // from the first block column + for (unsigned int r=0; rn_rows(); + // then check that the following + // block columns have the same + // sizes + for (unsigned int c=1; cn_rows(), + ExcIncompatibleRowNumbers (r,0,r,c)); + + // finally initialize the row + // indices with this array + row_indices.reinit (row_sizes); + + + // then do the same with the columns + for (unsigned int c=0; cn_cols(); + for (unsigned int r=1; rn_cols(), + ExcIncompatibleRowNumbers (0,c,r,c)); + + // finally initialize the row + // indices with this array + column_indices.reinit (col_sizes); +}; + + + +void +BlockSparsityPattern::compress () +{ + for (unsigned int i=0; icompress (); +}; + + + +bool +BlockSparsityPattern::empty () const +{ + for (unsigned int i=0; iempty () == false) + return false; + return true; +}; + + + +unsigned int +BlockSparsityPattern::max_entries_per_row () const +{ + unsigned int max_entries = 0; + for (unsigned int block_row=0; block_rowmax_entries_per_row (); + + if (this_row > max_entries) + max_entries = this_row; + }; + return max_entries; +}; + + +unsigned int +BlockSparsityPattern::n_rows () const +{ + // only count in first column, since + // all rows should be equivalent + unsigned int count = 0; + for (unsigned int r=0; rn_rows(); + return count; +}; + + + +unsigned int +BlockSparsityPattern::n_cols () const +{ + // only count in first row, since + // all rows should be equivalent + unsigned int count = 0; + for (unsigned int c=0; cn_cols(); + return count; +}; + + + + + +unsigned int +BlockSparsityPattern::n_nonzero_elements () const +{ + unsigned int count = 0; + for (unsigned int i=0; in_nonzero_elements (); + return count; +}; + + + +bool +BlockSparsityPattern::is_compressed () const +{ + for (unsigned int i=0; iis_compressed () == false) + return false; + return true; +}; + diff --git a/tests/deal.II/block_matrices.cc b/tests/deal.II/block_matrices.cc index 3f1852197f..94aabdf21a 100644 --- a/tests/deal.II/block_matrices.cc +++ b/tests/deal.II/block_matrices.cc @@ -60,7 +60,7 @@ class LaplaceProblem DoFHandler<2> dof_handler; Sparsity sparsity_pattern; - Matrix system_matrix; + Matrix system_matrix; Vector system_rhs; }; @@ -69,9 +69,27 @@ class LaplaceProblem template LaplaceProblem::LaplaceProblem () : dof_handler (triangulation) +{ + sparsity_pattern.reinit (system_matrix.n_block_rows(), + system_matrix.n_block_cols()); +}; + + + +template <> +LaplaceProblem,SparseMatrix,SparsityPattern>::LaplaceProblem () : + dof_handler (triangulation) {}; + +template <> +LaplaceProblem,SparseMatrix,SparsityPattern>::LaplaceProblem () : + dof_handler (triangulation) +{}; + + + template void LaplaceProblem::make_grid_and_dofs () { @@ -138,7 +156,7 @@ void LaplaceProblem,SparseMatrix,SparsityPattern>::reinit_v template <> -void LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern<2,2> >::reinit_sparsity () +void LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern>::reinit_sparsity () { const unsigned int n_dofs = dof_handler.n_dofs(); const unsigned int block_size[2] = { n_dofs/3, n_dofs - n_dofs/3 }; @@ -153,7 +171,7 @@ void LaplaceProblem,BlockSparseMatrix,BlockSpars template <> -void LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern<2,2> >::reinit_vectors () +void LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern>::reinit_vectors () { const unsigned int n_dofs = dof_handler.n_dofs(); const unsigned int block_size_[2] = { n_dofs/3, n_dofs - n_dofs/3 }; @@ -167,7 +185,7 @@ void LaplaceProblem,BlockSparseMatrix,BlockSpars template <> -void LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern<3,3> >::reinit_sparsity () +void LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern>::reinit_sparsity () { const unsigned int n_dofs = dof_handler.n_dofs(); const unsigned int block_size[3] = { n_dofs/5, n_dofs/7, n_dofs - n_dofs/5 - n_dofs/7 }; @@ -182,7 +200,7 @@ void LaplaceProblem,BlockSparseMatrix,BlockSpars template <> -void LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern<3,3> >::reinit_vectors () +void LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern>::reinit_vectors () { const unsigned int n_dofs = dof_handler.n_dofs(); const unsigned int block_size_[3] = { n_dofs/5, n_dofs/7, n_dofs - n_dofs/5 - n_dofs/7 }; @@ -330,7 +348,7 @@ int main () if (true) { - LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern<2,2> > + LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern> laplace_problem; laplace_problem.run (); @@ -342,7 +360,7 @@ int main () if (true) { - LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern<3,3> > + LaplaceProblem,BlockSparseMatrix,BlockSparsityPattern> laplace_problem; laplace_problem.run ();