16 #ifndef dealii__schur_matrix_h
17 #define dealii__schur_matrix_h
19 #include <deal.II/base/config.h>
20 #include <deal.II/base/subscriptor.h>
21 #include <deal.II/base/smartpointer.h>
22 #include <deal.II/base/logstream.h>
23 #include <deal.II/lac/vector_memory.h>
24 #include <deal.II/lac/block_vector.h>
27 DEAL_II_NAMESPACE_OPEN
96 template <
class MA_inverse,
class MB,
class MDt,
class MC>
115 const std::vector<types::global_dof_index> &
signature = std::vector<types::global_dof_index>(0));
204 template <
class MA_inverse,
class MB,
class MDt,
class MC>
211 const std::vector<types::global_dof_index> &signature)
212 : Ainv(&Ainv), B(&B), Dt(&Dt), C(&C),
214 signature(signature),
220 template <
class MA_inverse,
class MB,
class MDt,
class MC>
229 template <
class MA_inverse,
class MB,
class MDt,
class MC>
234 deallog.
push(
"Schur");
236 deallog <<
"src:" << src.
l2_norm() << std::endl;
240 deallog <<
"C:" << dst.
l2_norm() << std::endl;
243 if (signature.size()>0)
246 h1->
reinit(B->n_block_cols(), src.
block(0).size());
249 deallog <<
"Dt:" << h1->
l2_norm() << std::endl;
253 Ainv->vmult(*h2, *h1);
255 deallog <<
"Ainverse:" << h2->
l2_norm() << std::endl;
258 B->vmult_add(dst, *h2);
260 deallog <<
"dst:" << dst.
l2_norm() << std::endl;
267 template <
class MA_inverse,
class MB,
class MDt,
class MC>
280 template <
class MA_inverse,
class MB,
class MDt,
class MC>
290 deallog.
push(
"Schur-prepare");
292 deallog <<
"src:" << src.
l2_norm() << std::endl;
294 if (signature.size()>0)
297 h1->
reinit(B->n_block_cols(), src.
block(0).size());
298 Ainv->vmult(*h1, src);
300 deallog <<
"Ainverse:" << h1->
l2_norm() << std::endl;
301 B->vmult_add(dst, *h1);
303 deallog <<
"dst:" << dst.
l2_norm() << std::endl;
309 template <
class MA_inverse,
class MB,
class MDt,
class MC>
322 deallog.
push(
"Schur-post");
324 deallog <<
"src:" << src.
l2_norm() << std::endl;
326 if (signature.size()>0)
329 h1->
reinit(B->n_block_cols(), src.
block(0).size());
330 Dt->Tvmult(*h1, src);
332 deallog <<
"Dt:" << h1->
l2_norm() << std::endl;
334 Ainv->vmult(dst,*h1);
336 deallog <<
"dst:" << dst.
l2_norm() << std::endl;
342 DEAL_II_NAMESPACE_CLOSE
void vmult(BlockVector< double > &dst, const BlockVector< double > &src) const
std::vector< types::global_dof_index > signature
void postprocess(BlockVector< double > &dst, const BlockVector< double > &src, const BlockVector< double > &rhs) const
void prepare_rhs(BlockVector< double > &dst, const BlockVector< double > &src) const
double residual(BlockVector< double > &dst, const BlockVector< double > &src, const BlockVector< double > &rhs) const
const SmartPointer< const MB, SchurMatrix< MA_inverse, MB, MDt, MC > > B
void debug_level(unsigned int l)
VectorMemory< BlockVector< double > > & mem
SchurMatrix & operator=(const SchurMatrix< MA_inverse, MB, MDt, MC > &)
const SmartPointer< const MA_inverse, SchurMatrix< MA_inverse, MB, MDt, MC > > Ainv
void sadd(const value_type s, const BlockVectorBase &V)
#define Assert(cond, exc)
static::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
BlockType & block(const unsigned int i)
SchurMatrix(const MA_inverse &Ainv, const MB &B, const MDt &Dt, const MC &C, VectorMemory< BlockVector< double > > &mem, const std::vector< types::global_dof_index > &signature=std::vector< types::global_dof_index >(0))
real_type l2_norm() const
unsigned int n_blocks() const
void reinit(const unsigned int n_blocks, const size_type block_size=0, const bool omit_zeroing_entries=false)
const SmartPointer< const MDt, SchurMatrix< MA_inverse, MB, MDt, MC > > Dt
void push(const std::string &text)
const SmartPointer< const MC, SchurMatrix< MA_inverse, MB, MDt, MC > > C