From: Guido Kanschat Date: Sun, 21 Mar 2010 05:38:59 +0000 (+0000) Subject: add missing access to MatrixBlockVector and use MatrixBlock in MeshWorker::Assembler... X-Git-Tag: v8.0.0~6290 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=875c687f63e2afcb5bec6c93182a5cc9facc2cd8;p=dealii.git add missing access to MatrixBlockVector and use MatrixBlock in MeshWorker::Assembler::MatrixLocalBlocksToGlobalBlocks git-svn-id: https://svn.dealii.org/trunk@20870 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/mesh_worker_assembler.h b/deal.II/deal.II/include/numerics/mesh_worker_assembler.h index 6dc6900ecb..01371224c7 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_assembler.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_assembler.h @@ -722,7 +722,7 @@ namespace MeshWorker * matrix into a global one. */ void assemble( - MATRIX& global, + MatrixBlock& global, const FullMatrix& local, unsigned int block_row, unsigned int block_col, @@ -1423,7 +1423,7 @@ namespace MeshWorker template inline void MatrixLocalBlocksToGlobalBlocks::assemble( - MATRIX& global, + MatrixBlock& global, const FullMatrix& 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); } } diff --git a/deal.II/lac/include/lac/matrix_block.h b/deal.II/lac/include/lac/matrix_block.h index 379705e8d7..7d251af375 100644 --- a/deal.II/lac/include/lac/matrix_block.h +++ b/deal.II/lac/include/lac/matrix_block.h @@ -248,6 +248,11 @@ class MatrixBlockVector : public NamedData * the block at position i. */ const MatrixBlock& block(unsigned int i) const; + /** + * Access a reference to + * the block at position i. + */ + MatrixBlock& block(unsigned int i); /** * Access the matrix at position * i for read and write @@ -430,6 +435,14 @@ MatrixBlockVector::block(unsigned int i) const } +template +inline MatrixBlock& +MatrixBlockVector::block(unsigned int i) +{ + return *(*this)(i); +} + + template inline MATRIX& MatrixBlockVector::matrix(unsigned int i)