]> https://gitweb.dealii.org/ - dealii.git/commitdiff
reinit
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 17 Mar 2005 00:14:19 +0000 (00:14 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 17 Mar 2005 00:14:19 +0000 (00:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@10178 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_matrix_array.h

index f62037905403ad7a49492e9bc6ca01d0be0e0256..9b011e11bd0c4c5b136b15b82267278a8ac3f2af 100644 (file)
@@ -130,6 +130,13 @@ class BlockMatrixArray : public Subscriptor
                      const unsigned int n_block_cols,
                      VectorMemory<Vector<number> >& 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
                                      * <tt>matrix</tt> 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<Vector<number> >& 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<MATRIX,number>::Entry::Entry (const MATRIX& matrix,
                col (col),
                prefix (prefix),
                transpose (transpose),
-               matrix (&matrix)
+               matrix (&matrix, typeid(*this).name())
 {}
 
 
@@ -495,11 +507,23 @@ BlockMatrixArray<MATRIX,number>::BlockMatrixArray (
   VectorMemory<Vector<number> >& mem)
                : block_rows (n_block_rows),
                  block_cols (n_block_cols),
-                 mem(&mem)
+                 mem(&mem, typeid(*this).name())
 {}
 
 
 
+template <class MATRIX, typename number>
+inline
+void
+BlockMatrixArray<MATRIX,number>::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 <class MATRIX, typename number>
 inline
 void
@@ -768,6 +792,15 @@ BlockTrianglePrecondition<MATRIX,number>::BlockTrianglePrecondition(
 {}
 
 
+template <class MATRIX, typename number>
+inline
+void
+BlockTrianglePrecondition<MATRIX,number>::reinit (
+  const unsigned int n)
+{
+  BlockMatrixArray<MATRIX,number>::reinit(n,n);
+}
+
 template <class MATRIX, typename number>
 inline
 void

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.