From 4c63faae50b5ba8a1cd664c3ad64767a94f8e6fe Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Sat, 20 Mar 2010 16:59:23 +0000 Subject: [PATCH] add BlockIndices to MatrixBlock git-svn-id: https://svn.dealii.org/trunk@20868 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/numerics/mesh_worker_assembler.h | 13 +------------ deal.II/lac/include/lac/matrix_block.h | 8 +++++++- 2 files changed, 8 insertions(+), 13 deletions(-) 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 015bfca1e9..6dc6900ecb 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_assembler.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_assembler.h @@ -1444,19 +1444,8 @@ namespace MeshWorker // our local matrices const unsigned int jcell = this->block_info->local().local_to_global(block_row, j); const unsigned int kcell = this->block_info->local().local_to_global(block_col, k); - - // The global dof - // indices to assemble - // in. Since we may - // have face matrices - // coupling two - // different cells, we - // provide two sets of - // dof indices. - const unsigned int jglobal = this->block_info->global().global_to_local(dof1[jcell]).second; - const unsigned int kglobal = this->block_info->global().global_to_local(dof2[kcell]).second; - global.add(jglobal, kglobal, local(j,k)); + global.add(dof1[jcell], dof2[kcell], local(j,k)); } } diff --git a/deal.II/lac/include/lac/matrix_block.h b/deal.II/lac/include/lac/matrix_block.h index 03b9a64260..379705e8d7 100644 --- a/deal.II/lac/include/lac/matrix_block.h +++ b/deal.II/lac/include/lac/matrix_block.h @@ -320,6 +320,8 @@ MatrixBlock::add (const std::vector& row_indices, const FullMatrix& values, const bool elide_zero_values) { + Assert(block_indices != 0, ExcNotInitialized()); + AssertDimension (row_indices.size(), values.m()); AssertDimension (col_indices.size(), values.n()); @@ -338,6 +340,8 @@ MatrixBlock::add (const std::vector &indices, const FullMatrix &values, const bool elide_zero_values) { + Assert(block_indices != 0, ExcNotInitialized()); + AssertDimension (indices.size(), values.m()); Assert (values.n() == values.m(), ExcNotQuadratic()); @@ -356,7 +360,8 @@ MatrixBlock::add (const unsigned int row, const std::vector &col_indices, const std::vector &values, const bool elide_zero_values) -{ +{ + Assert(block_indices != 0, ExcNotInitialized()); AssertDimension (col_indices.size(), values.size()); add (row, col_indices.size(), &col_indices[0], &values[0], elide_zero_values); @@ -374,6 +379,7 @@ MatrixBlock::add (const unsigned int b_row, const bool, const bool) { + Assert(block_indices != 0, ExcNotInitialized()); const std::pair bi = block_indices->global_to_local(b_row); -- 2.39.5