From 192521cb2086b4136979a600ba64783fd261fc0b Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Thu, 17 Mar 2005 00:14:19 +0000 Subject: [PATCH] reinit git-svn-id: https://svn.dealii.org/trunk@10178 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/block_matrix_array.h | 41 ++++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/deal.II/lac/include/lac/block_matrix_array.h b/deal.II/lac/include/lac/block_matrix_array.h index f620379054..9b011e11bd 100644 --- a/deal.II/lac/include/lac/block_matrix_array.h +++ b/deal.II/lac/include/lac/block_matrix_array.h @@ -130,6 +130,13 @@ class BlockMatrixArray : public Subscriptor const unsigned int n_block_cols, VectorMemory >& mem); + /** + * Adjust the matrix to a new + * size and delete all blocks. + */ + void reinit (const unsigned int n_block_rows, + const unsigned int n_block_cols); + /** * Add a block matrix entry. The * matrix is entered @@ -154,7 +161,7 @@ class BlockMatrixArray : public Subscriptor const unsigned int col, const double prefix = 1., const bool transpose = false); - + /** * Delete all entries, i.e. reset * the matrix to an empty state. @@ -390,7 +397,12 @@ class BlockTrianglePrecondition VectorMemory >& mem, bool backward = false); - + /** + * Resize preconditioner to a new + * size and clear all blocks. + */ + void reinit(const unsigned int n_block_rows); + /** * Preconditioning. */ @@ -482,7 +494,7 @@ BlockMatrixArray::Entry::Entry (const MATRIX& matrix, col (col), prefix (prefix), transpose (transpose), - matrix (&matrix) + matrix (&matrix, typeid(*this).name()) {} @@ -495,11 +507,23 @@ BlockMatrixArray::BlockMatrixArray ( VectorMemory >& mem) : block_rows (n_block_rows), block_cols (n_block_cols), - mem(&mem) + mem(&mem, typeid(*this).name()) {} +template +inline +void +BlockMatrixArray::reinit ( + const unsigned int n_block_rows, + const unsigned int n_block_cols) +{ + clear(); + block_rows = n_block_rows; + block_cols = n_block_cols; +} + template inline void @@ -768,6 +792,15 @@ BlockTrianglePrecondition::BlockTrianglePrecondition( {} +template +inline +void +BlockTrianglePrecondition::reinit ( + const unsigned int n) +{ + BlockMatrixArray::reinit(n,n); +} + template inline void -- 2.39.5