From: guido Date: Mon, 29 Oct 2001 09:47:59 +0000 (+0000) Subject: scaling of blocks implemented X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aca807f1113262abfd4d93502ceb6925bf7c7253;p=dealii-svn.git scaling of blocks implemented git-svn-id: https://svn.dealii.org/trunk@5172 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/block_matrix_array.h b/deal.II/lac/include/lac/block_matrix_array.h index 8ad7c822c1..cde75f9ffb 100644 --- a/deal.II/lac/include/lac/block_matrix_array.h +++ b/deal.II/lac/include/lac/block_matrix_array.h @@ -228,18 +228,31 @@ BlockMatrixArray::vmult_add (BlockVector& dst, Assert (src.n_blocks() == block_cols, ExcDimensionMismatch(src.n_blocks(), block_cols)); + static Vector aux; + typename vector::const_iterator m = entries.begin(); typename vector::const_iterator end = entries.end(); for (; m != end ; ++m) { - Assert (m->prefix==1., ExcNotImplemented()); - if (m->transpose) - m->matrix->Tvmult_add(dst.block(m->row), + if (m->prefix==1.) + { + if (m->transpose) + m->matrix->Tvmult_add(dst.block(m->row), + src.block(m->col)); + else + m->matrix->vmult_add(dst.block(m->row), + src.block(m->col)); + } else { + aux.reinit(dst.block(m->row)); + if (m->transpose) + m->matrix->Tvmult(aux, src.block(m->col)); - else - m->matrix->vmult_add(dst.block(m->row), + else + m->matrix->vmult(aux, src.block(m->col)); + dst.block(m->row).add (m->prefix, aux); + } } } @@ -275,15 +288,28 @@ BlockMatrixArray::Tvmult_add (BlockVector& dst, typename vector::const_iterator m = entries.begin(); typename vector::const_iterator end = entries.end(); + static Vector aux; + for (; m != end ; ++m) { - Assert (m->prefix==1., ExcNotImplemented()); - if (m->transpose) - m->matrix->vmult_add(dst.block(m->col), - src.block(m->row)); - else - m->matrix->Tvmult_add(dst.block(m->col), - src.block(m->row)); + if (m->prefix==1.) + { + if (m->transpose) + m->matrix->vmult_add(dst.block(m->row), + src.block(m->col)); + else + m->matrix->Tvmult_add(dst.block(m->row), + src.block(m->col)); + } else { + aux.reinit(dst.block(m->row)); + if (m->transpose) + m->matrix->vmult(aux, + src.block(m->col)); + else + m->matrix->Tvmult(aux, + src.block(m->col)); + dst.block(m->row).add (m->prefix, aux); + } } }