]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add missing access to MatrixBlockVector and use MatrixBlock in MeshWorker::Assembler...
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 21 Mar 2010 05:38:59 +0000 (05:38 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 21 Mar 2010 05:38:59 +0000 (05:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@20870 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/mesh_worker_assembler.h
deal.II/lac/include/lac/matrix_block.h

index 6dc6900ecbcd0a22a51bf2ecf73e26d7f5b43559..01371224c78a9c1a3158e7a3ff208de63b4ad009 100644 (file)
@@ -722,7 +722,7 @@ namespace MeshWorker
                                          * matrix into a global one.
                                          */
        void assemble(
-         MATRIX& global,
+         MatrixBlock<MATRIX>& global,
          const FullMatrix<number>& local,
          unsigned int block_row,
          unsigned int block_col,
@@ -1423,7 +1423,7 @@ namespace MeshWorker
     template <class MATRIX, typename number>
     inline void
     MatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble(
-      MATRIX& global,
+      MatrixBlock<MATRIX>& global,
       const FullMatrix<number>& local,
       unsigned int block_row,
       unsigned int block_col,
@@ -1463,7 +1463,7 @@ namespace MeshWorker
          const unsigned int row = matrices->block(i).row;
          const unsigned int col = matrices->block(i).column;
 
-         assemble(matrices->matrix(i), info.matrix(i,false).matrix, row, col, info.indices, info.indices);
+         assemble(matrices->block(i), info.matrix(i,false).matrix, row, col, info.indices, info.indices);
        }
     }
 
@@ -1482,10 +1482,10 @@ namespace MeshWorker
          const unsigned int row = matrices->block(i).row;
          const unsigned int col = matrices->block(i).column;
 
-         assemble(matrices->matrix(i), info1.matrix(i,false).matrix, row, col, info1.indices, info1.indices);
-         assemble(matrices->matrix(i), info1.matrix(i,true).matrix, row, col, info1.indices, info2.indices);
-         assemble(matrices->matrix(i), info2.matrix(i,false).matrix, row, col, info2.indices, info2.indices);
-         assemble(matrices->matrix(i), info2.matrix(i,true).matrix, row, col, info2.indices, info1.indices);
+         assemble(matrices->block(i), info1.matrix(i,false).matrix, row, col, info1.indices, info1.indices);
+         assemble(matrices->block(i), info1.matrix(i,true).matrix, row, col, info1.indices, info2.indices);
+         assemble(matrices->block(i), info2.matrix(i,false).matrix, row, col, info2.indices, info2.indices);
+         assemble(matrices->block(i), info2.matrix(i,true).matrix, row, col, info2.indices, info1.indices);
        }
     }
 
index 379705e8d7a56cffe144a6165203fe55cd8416de..7d251af375b8864fa74da5e63be8193505bd0ed4 100644 (file)
@@ -248,6 +248,11 @@ class MatrixBlockVector : public NamedData<boost::shared_ptr<MatrixBlock<MATRIX>
                                      * the block at position <i>i</i>.
                                      */
     const MatrixBlock<MATRIX>& block(unsigned int i) const;
+                                    /**
+                                     * Access a reference to
+                                     * the block at position <i>i</i>.
+                                     */
+    MatrixBlock<MATRIX>& block(unsigned int i);
                                     /**
                                      * Access the matrix at position
                                      * <i>i</i> for read and write
@@ -430,6 +435,14 @@ MatrixBlockVector<MATRIX>::block(unsigned int i) const
 }
 
 
+template <class MATRIX>
+inline MatrixBlock<MATRIX>&
+MatrixBlockVector<MATRIX>::block(unsigned int i)
+{
+  return *(*this)(i);
+}
+
+
 template <class MATRIX>
 inline MATRIX&
 MatrixBlockVector<MATRIX>::matrix(unsigned int i)

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.