From: guido Date: Fri, 14 Jun 2002 07:08:41 +0000 (+0000) Subject: Allow different size for u-vector X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a31a3da2f9f915b75511608aa95572caeccfeac;p=dealii-svn.git Allow different size for u-vector git-svn-id: https://svn.dealii.org/trunk@6111 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/schur_matrix.h b/deal.II/lac/include/lac/schur_matrix.h index 043c6b91bf..c2493ab654 100644 --- a/deal.II/lac/include/lac/schur_matrix.h +++ b/deal.II/lac/include/lac/schur_matrix.h @@ -82,18 +82,33 @@ template class BlockVector; * schur.postprocess (u, p); * @end{verbatim} * - * @author Guido Kanschat, 2000, 2001 + * @author Guido Kanschat, 2000, 2001, 2002 */ template class SchurMatrix : public Subscriptor { public: + + /** + * Constructor. This constructor + * receives all the matrices + * needed. Furthermore, it gets a + * reference to a memory structure + * for obtaining block vectors. + * + * Optionally, the length of the + * @p{u}-vector can be provided. + * + * For the meaning of the matrices + * see the class documentation. + */ SchurMatrix(const MA_inverse& Ainv, const MB& B, const MDt& Dt, const MC& C, - VectorMemory >& mem); + VectorMemory >& mem, + const std::vector& signature = std::vector(0)); /** * Do block elimination of the @@ -171,6 +186,11 @@ class SchurMatrix : * Auxiliary memory for vectors. */ VectorMemory >& mem; + + /** + * Optional signature of the @p{u}-vector. + */ + std::vector signature; }; template @@ -179,8 +199,11 @@ SchurMatrix const MB& B, const MDt& Dt, const MC& C, - VectorMemory >& mem) - : Ainv(&Ainv), B(&B), Dt(&Dt), C(&C), mem(mem) + VectorMemory >& mem, + const std::vector& signature) + : Ainv(&Ainv), B(&B), Dt(&Dt), C(&C), + mem(mem), + signature(signature) { } @@ -193,7 +216,10 @@ void SchurMatrix deallog.push("Schur"); C->vmult(dst, src); BlockVector* h1 = mem.alloc(); - h1->reinit(B->n_block_cols(), src.block(0).size()); + if (signature.size()>0) + h1->reinit(signature); + else + h1->reinit(B->n_block_cols(), src.block(0).size()); Dt->Tvmult(*h1,src); BlockVector* h2 = mem.alloc(); h2->reinit(*h1); @@ -230,7 +256,10 @@ void SchurMatrix deallog.push("Schur-prepare"); BlockVector* h1 = mem.alloc(); - h1->reinit(B->n_block_cols(), src.block(0).size()); + if (signature.size()>0) + h1->reinit(signature); + else + h1->reinit(B->n_block_cols(), src.block(0).size()); Ainv->vmult(*h1, src); B->vmult_add(dst, *h1); mem.free(h1); @@ -253,7 +282,10 @@ void SchurMatrix deallog.push("Schur-post"); BlockVector* h1 = mem.alloc(); - h1->reinit(B->n_block_cols(), src.block(0).size()); + if (signature.size()>0) + h1->reinit(signature); + else + h1->reinit(B->n_block_cols(), src.block(0).size()); Dt->Tvmult(*h1, src); h1->sadd(-1.,rhs); Ainv->vmult(dst,*h1);