Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
sparse_mic.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2002 - 2018 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_sparse_mic_h
17 #define dealii_sparse_mic_h
18 
19 #include <deal.II/lac/sparse_decomposition.h>
20 #include <deal.II/lac/sparse_matrix.h>
21 
22 DEAL_II_NAMESPACE_OPEN
23 
46 template <typename number>
47 class SparseMIC : public SparseLUDecomposition<number>
48 {
49 public:
54 
59  SparseMIC();
60 
64  virtual ~SparseMIC() override;
65 
70  virtual void
71  clear() override;
72 
78 
96  template <typename somenumber>
97  void
99  const AdditionalData & parameters = AdditionalData());
100 
107  template <typename somenumber>
108  void
109  vmult(Vector<somenumber> &dst, const Vector<somenumber> &src) const;
110 
120  template <typename somenumber>
121  void
122  Tvmult(Vector<somenumber> &dst, const Vector<somenumber> &src) const;
123 
128  std::size_t
129  memory_consumption() const override;
130 
144  double,
145  << "The strengthening parameter " << arg1
146  << " is not greater or equal than zero!");
151  int,
152  double,
153  << "The diagonal element (" << arg1 << "," << arg1 << ") is "
154  << arg2 << ", but must be positive");
155 
157 private:
161  std::vector<number> diag;
162 
166  std::vector<number> inv_diag;
167 
172  std::vector<number> inner_sums;
173 
177  number
178  get_rowsum(const size_type row) const;
179 };
180 
183 DEAL_II_NAMESPACE_CLOSE
184 
185 #endif // dealii_
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:541
std::vector< number > inner_sums
Definition: sparse_mic.h:172
void vmult(Vector< somenumber > &dst, const Vector< somenumber > &src) const
static ::ExceptionBase & ExcDecompositionNotStable(int arg1, double arg2)
void Tvmult(Vector< somenumber > &dst, const Vector< somenumber > &src) const
void initialize(const SparseMatrix< somenumber > &matrix, const AdditionalData &parameters=AdditionalData())
std::vector< number > diag
Definition: sparse_mic.h:161
number get_rowsum(const size_type row) const
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:518
virtual ~SparseMIC() override
typename SparseMatrix< number >::size_type size_type
#define DeclException0(Exception0)
Definition: exceptions.h:473
std::vector< number > inv_diag
Definition: sparse_mic.h:166
unsigned int global_dof_index
Definition: types.h:89
std::size_t memory_consumption() const override
virtual void clear() override
static ::ExceptionBase & ExcInvalidStrengthening(double arg1)
typename SparseLUDecomposition< number >::AdditionalData AdditionalData
Definition: sparse_mic.h:77
static ::ExceptionBase & ExcStrengthenDiagonalTooSmall()