9#include <kernel/solver/base.hpp>
10#include <kernel/adjacency/graph.hpp>
11#include <kernel/lafem/dense_vector.hpp>
12#include <kernel/lafem/dense_vector_blocked.hpp>
13#include <kernel/lafem/power_vector.hpp>
14#include <kernel/lafem/tuple_vector.hpp>
15#include <kernel/lafem/sparse_matrix_csr.hpp>
16#include <kernel/lafem/sparse_matrix_bcsr.hpp>
17#include <kernel/lafem/power_diag_matrix.hpp>
18#include <kernel/lafem/power_full_matrix.hpp>
19#include <kernel/lafem/power_row_matrix.hpp>
20#include <kernel/lafem/power_col_matrix.hpp>
21#include <kernel/lafem/saddle_point_matrix.hpp>
22#include <kernel/util/stop_watch.hpp>
49 template<
typename Vector_>
68 template<
typename Matrix_>
71 template<
typename DT_,
typename IT_>
72 class VankaVector<LAFEM::DenseVector<DT_, IT_>>
75 typedef LAFEM::DenseVector<DT_, IT_> VectorType;
76 static constexpr int dim = 1;
79 Memory::TypedView<DT_> _vec_view;
83 explicit VankaVector(VectorType& vec_cor) :
84 _vec_view(vec_cor.elements_view_rw())
89 explicit VankaVector(
const VectorType& vec_def) :
90 _vec_view(vec_def.elements_view_r())
94 IT_ gather_def(DT_* x,
const IT_* idx,
const IT_ n,
const IT_ off)
const
96 for(IT_ i(0); i < n; ++i)
98 x[off+i] = _vec_view(idx[i]);
103 IT_ scatter_cor(
const DT_ omega,
const DT_* x,
const IT_* idx,
const IT_ n,
const IT_ off)
105 for(IT_ i(0); i < n; ++i)
107 _vec_view[idx[i]] += omega * x[off+i];
113 template<
typename DT_,
typename IT_,
int dim_>
114 class VankaVector<LAFEM::DenseVectorBlocked<DT_, IT_, dim_>>
117 typedef LAFEM::DenseVectorBlocked<DT_, IT_, dim_> VectorType;
118 typedef typename VectorType::ValueType ValueType;
119 static constexpr int dim = dim_;
122 Memory::TypedView<ValueType> _vec_view;
126 explicit VankaVector(VectorType& vec_cor) :
127 _vec_view(vec_cor.elements_view_rw())
132 explicit VankaVector(
const VectorType& vec_def) :
133 _vec_view(vec_def.elements_view_r())
137 IT_ gather_def(DT_* x,
const IT_* idx,
const IT_ n,
const IT_ off)
const
139 for(IT_ i(0); i < n; ++i)
141 const ValueType& vi = _vec_view(idx[i]);
142 for(
int j(0); j < dim; ++j)
144 x[off + i*IT_(dim) + IT_(j)] = vi[j];
147 return off + IT_(dim)*n;
150 IT_ scatter_cor(
const DT_ omega,
const DT_* x,
const IT_* idx,
const IT_ n,
const IT_ off)
152 for(IT_ i(0); i < n; ++i)
154 ValueType& vi = _vec_view[idx[i]];
155 for(
int j(0); j < dim; ++j)
157 vi[j] += omega * x[off + i*IT_(dim) + IT_(j)];
160 return off + IT_(dim)*n;
164 template<
typename SubVector_,
int dim_>
165 class VankaVector<LAFEM::PowerVector<SubVector_, dim_>>
168 typedef LAFEM::PowerVector<SubVector_, dim_> VectorType;
169 typedef VankaVector<SubVector_> FirstClass;
170 typedef VankaVector<LAFEM::PowerVector<SubVector_, dim_-1>> RestClass;
172 static constexpr int dim = FirstClass::dim + RestClass::dim;
179 explicit VankaVector(VectorType& vec_cor) :
180 _first(vec_cor.first()),
181 _rest(vec_cor.
rest())
185 explicit VankaVector(
const VectorType& vec_cor) :
186 _first(vec_cor.first()),
187 _rest(vec_cor.
rest())
191 template<
typename DT_,
typename IT_>
192 IT_ gather_def(DT_* x,
const IT_* idx,
const IT_ n,
const IT_ off)
const
194 IT_ noff = _first.gather_def(x, idx, n, off);
195 return _rest.gather_def(x, idx, n, noff);
198 template<
typename DT_,
typename IT_>
199 IT_ scatter_cor(
const DT_ omega,
const DT_* x,
const IT_* idx,
const IT_ n,
const IT_ off)
201 IT_ noff = _first.scatter_cor(omega, x, idx, n, off);
202 return _rest.scatter_cor(omega, x, idx, n, noff);
206 template<
typename SubVector_>
207 class VankaVector<LAFEM::PowerVector<SubVector_, 1>>
210 typedef LAFEM::PowerVector<SubVector_, 1> VectorType;
211 typedef VankaVector<SubVector_> FirstClass;
213 static constexpr int dim = FirstClass::dim;
219 explicit VankaVector(VectorType& vec_cor) :
220 _first(vec_cor.first())
224 explicit VankaVector(
const VectorType& vec_cor) :
225 _first(vec_cor.first())
229 template<
typename DT_,
typename IT_>
230 IT_ gather_def(DT_* x,
const IT_* idx,
const IT_ n,
const IT_ off)
const
232 return _first.gather_def(x, idx, n, off);
235 template<
typename DT_,
typename IT_>
236 IT_ scatter_cor(
const DT_ omega,
const DT_* x,
const IT_* idx,
const IT_ n,
const IT_ off)
238 return _first.scatter_cor(omega, x, idx, n, off);
242 template<
typename DT_,
typename IT_>
243 class VankaMatrix<LAFEM::SparseMatrixCSR<DT_, IT_>>
246 typedef LAFEM::SparseMatrixCSR<DT_, IT_> MatrixType;
247 typedef LAFEM::DenseVector<DT_, IT_> VectorTypeR;
249 static constexpr int row_dim = 1;
250 static constexpr int col_dim = 1;
253 const Memory::TypedView<IT_> _row_ptr;
254 const Memory::TypedView<IT_> _col_idx;
255 const Memory::TypedView<DT_> _mat_val;
258 explicit VankaMatrix(
const MatrixType& matrix) :
259 _row_ptr(matrix.row_ptr_view_r()),
260 _col_idx(matrix.col_idx_view_r()),
261 _mat_val(matrix.val_view_r())
265 std::pair<IT_, IT_> gather_full(
266 DT_* data,
const IT_* ridx,
const IT_* cidx,
267 const IT_ m,
const IT_ n,
const IT_ stride,
268 const IT_ mo = IT_(0),
const IT_ no = IT_(0))
const
271 if(_mat_val.is_nullptr())
272 return std::make_pair(mo+m, no+n);
275 for(IT_ i(0); i < m; ++i)
278 const IT_ ri = ridx[i];
284 for(IT_ ai = _row_ptr[ri]; ai < _row_ptr[ri+1]; ++ai)
287 const IT_ rj = _col_idx[ai];
290 while((j < n) && (cidx[j] < rj))
295 if((j < n) && (cidx[j] == rj))
298 data[(mo + i) * stride + no + j] = _mat_val[ai];
302 return std::make_pair(mo+m, no+n);
305 IT_ gather_diag(DT_* data,
const IT_* idx,
const IT_ m,
const IT_ mo = IT_(0))
const
308 for(IT_ i(0); i < m; ++i)
311 const IT_ ri = idx[i];
314 for(IT_ ai = _row_ptr[ri]; ai < _row_ptr[ri+1]; ++ai)
317 if(_col_idx[ai] == ri)
319 data[mo+i] = _mat_val[ai];
327 IT_ mult_cor(DT_* x,
const DT_ alpha,
const VectorTypeR& vec_cor,
const IT_* idx,
const IT_ m,
const IT_ off)
const
329 if(_mat_val.is_nullptr())
332 const Memory::TypedView<DT_> v = vec_cor.elements_view_r();
335 for(IT_ i(0); i < m; ++i)
337 const IT_ vi = idx[i];
341 for(IT_ k = _row_ptr[vi]; k < _row_ptr[vi+1]; ++k)
343 r += _mat_val[k] * v[_col_idx[k]];
345 x[off+i] += alpha * r;
355 template<
typename DT_,
typename IT_,
int row_dim_,
int col_dim_>
356 class VankaMatrix<LAFEM::SparseMatrixBCSR<DT_, IT_, row_dim_, col_dim_>>
359 typedef LAFEM::SparseMatrixBCSR<DT_, IT_, row_dim_, col_dim_> MatrixType;
361 typedef typename MatrixType::ValueType MatVal;
363 static constexpr int row_dim = row_dim_;
364 static constexpr int col_dim = col_dim_;
367 const Memory::TypedView<IT_> _row_ptr;
368 const Memory::TypedView<IT_> _col_idx;
369 const Memory::TypedView<MatVal> _mat_val;
372 explicit VankaMatrix(
const MatrixType& matrix) :
373 _row_ptr(matrix.row_ptr_view_r()),
374 _col_idx(matrix.col_idx_view_r()),
375 _mat_val(matrix.val_view_r())
379 std::pair<IT_, IT_> gather_full(
380 DT_* data,
const IT_* ridx,
const IT_* cidx,
381 const IT_ m,
const IT_ n,
const IT_ stride,
382 const IT_ mo = IT_(0),
const IT_ no = IT_(0))
const
385 XASSERTM(!_mat_val.is_nullptr(),
"Vanka: invalid empty BCSR matrix");
388 for(IT_ i(0); i < m; ++i)
391 const IT_ ri = ridx[i];
397 for(IT_ ai = _row_ptr[ri]; ai < _row_ptr[ri+1]; ++ai)
400 const IT_ rj = _col_idx[ai];
403 while((j < n) && (cidx[j] < rj))
408 if((j < n) && (cidx[j] == rj))
411 const MatVal& mv = _mat_val[ai];
414 for(
int ii(0); ii < row_dim; ++ii)
417 const IT_ lro = (mo + i * IT_(row_dim) + IT_(ii)) * stride + no + j * IT_(col_dim);
420 for(
int jj(0); jj < col_dim; ++jj)
422 data[lro + IT_(jj)] = mv[ii][jj];
428 return std::make_pair(mo + IT_(row_dim)*m, no + IT_(col_dim)*n);
431 IT_ gather_diag(DT_* data,
const IT_* idx,
const IT_ m,
const IT_ mo = IT_(0))
const
434 for(IT_ i(0); i < m; ++i)
437 const IT_ ri = idx[i];
440 for(IT_ ai = _row_ptr[ri]; ai < _row_ptr[ri+1]; ++ai)
443 if(_col_idx[ai] == ri)
445 const MatVal& mv = _mat_val[ai];
448 for(
int k(0); k < row_dim; ++k)
450 data[mo + i*IT_(row_dim) + IT_(k)] = mv[k][k];
459 IT_ mult_cor(DT_* x,
const DT_ alpha,
const LAFEM::DenseVectorBlocked<DT_, IT_, col_dim_>& vec_cor,
460 const IT_* idx,
const IT_ m,
const IT_ off)
const
462 if(_mat_val.is_nullptr())
465 typedef LAFEM::DenseVectorBlocked<DT_, IT_, col_dim_> VectorType;
466 typedef typename VectorType::ValueType VecVal;
467 const Memory::TypedView<VecVal> v = vec_cor.elements_view_r();
470 for(IT_ i(0); i < m; ++i)
472 const IT_ vi = idx[i];
475 for(IT_ k = _row_ptr[vi]; k < _row_ptr[vi+1]; ++k)
478 const MatVal& mv = _mat_val[k];
479 const VecVal& vv = v[_col_idx[k]];
482 for(
int ii(0); ii < row_dim; ++ii)
486 for(
int jj(0); jj < col_dim; ++jj)
488 r += mv[ii][jj] * vv[jj];
490 x[off + i*IT_(row_dim) + IT_(ii)] += alpha * r;
494 return off + m* IT_(row_dim);
497 IT_ mult_cor(DT_* x,
const DT_ alpha,
const LAFEM::DenseVector<DT_, IT_>& vec_cor,
498 const IT_* idx,
const IT_ m,
const IT_ off)
const
500 if(_mat_val.is_nullptr())
503 const Memory::TypedView<DT_> v = vec_cor.elements_view_r();
506 for(IT_ i(0); i < m; ++i)
508 const IT_ vi = idx[i];
511 for(IT_ k = _row_ptr[vi]; k < _row_ptr[vi+1]; ++k)
514 const MatVal& mv = _mat_val[k];
518 const IT_ vo = _col_idx[k] * IT_(col_dim);
521 for(
int ii(0); ii < row_dim; ++ii)
525 for(
int jj(0); jj < col_dim; ++jj)
527 r += mv[ii][jj] * v[vo + IT_(jj)];
529 x[off + i*IT_(row_dim) + IT_(ii)] += alpha * r;
533 return off + m* IT_(row_dim);
541 template<
typename SubMatrix_,
int dim_>
542 class VankaMatrix<LAFEM::PowerDiagMatrix<SubMatrix_, dim_>>
545 typedef LAFEM::PowerDiagMatrix<SubMatrix_, dim_> MatrixType;
546 typedef typename MatrixType::VectorTypeR VectorTypeR;
547 typedef VankaMatrix<SubMatrix_> FirstClass;
548 typedef VankaMatrix<LAFEM::PowerDiagMatrix<SubMatrix_, dim_-1>> RestClass;
550 static constexpr int row_dim = FirstClass::row_dim + RestClass::row_dim;
551 static constexpr int col_dim = FirstClass::col_dim + RestClass::col_dim;
558 explicit VankaMatrix(
const MatrixType& matrix) :
559 _first(matrix.first()),
564 template<
typename DT_,
typename IT_>
565 std::pair<IT_, IT_> gather_full(
566 DT_* data,
const IT_* ridx,
const IT_* cidx,
567 const IT_ m,
const IT_ n,
const IT_ stride,
568 const IT_ mo = IT_(0),
const IT_ no = IT_(0))
const
570 std::pair<IT_, IT_> mn = _first.gather_full(data, ridx, cidx, m, n, stride, mo, no);
571 return _rest.gather_full(data, ridx, cidx, m, n, stride, mn.first, mn.second);
574 template<
typename DT_,
typename IT_>
575 IT_ gather_diag(DT_* data,
const IT_* idx,
const IT_ m,
const IT_ mo = IT_(0))
const
577 IT_ mno = _first.gather_diag(data, idx, m, mo);
578 return _rest.gather_diag(data, idx, m, mno);
581 template<
typename DT_,
typename IT_>
582 IT_ mult_cor(DT_* x,
const DT_ alpha,
const VectorTypeR& vec_cor,
const IT_* idx,
const IT_ m,
const IT_ off)
const
584 IT_ noff = _first.mult_cor(x, alpha, vec_cor.first(), idx, m, off);
585 return _rest.mult_cor(x, alpha, vec_cor.rest(), idx, m, noff);
589 template<
typename SubMatrix_>
590 class VankaMatrix<LAFEM::PowerDiagMatrix<SubMatrix_, 1>>
593 typedef LAFEM::PowerDiagMatrix<SubMatrix_, 1> MatrixType;
594 typedef typename MatrixType::VectorTypeR VectorTypeR;
595 typedef VankaMatrix<SubMatrix_> FirstClass;
597 static constexpr int row_dim = FirstClass::row_dim;
598 static constexpr int col_dim = FirstClass::col_dim;
604 explicit VankaMatrix(
const MatrixType& matrix) :
605 _first(matrix.first())
609 template<
typename DT_,
typename IT_>
610 std::pair<IT_, IT_> gather_full(
611 DT_* data,
const IT_* ridx,
const IT_* cidx,
612 const IT_ m,
const IT_ n,
const IT_ stride,
613 const IT_ mo = IT_(0),
const IT_ no = IT_(0))
const
615 return _first.gather_full(data, ridx, cidx, m, n, stride, mo, no);
618 template<
typename DT_,
typename IT_>
619 IT_ gather_diag(DT_* data,
const IT_* idx,
const IT_ m,
const IT_ mo = IT_(0))
const
621 return _first.gather_diag(data, idx, m, mo);
624 template<
typename DT_,
typename IT_>
625 IT_ mult_cor(DT_* x,
const DT_ alpha,
const VectorTypeR& vec_cor,
const IT_* idx,
const IT_ m,
const IT_ off)
const
627 return _first.mult_cor(x, alpha, vec_cor.first(), idx, m, off);
631 template<
typename SubMatrix_,
int dim_>
632 class VankaMatrix<LAFEM::PowerColMatrix<SubMatrix_, dim_>>
635 typedef LAFEM::PowerColMatrix<SubMatrix_, dim_> MatrixType;
636 typedef typename MatrixType::VectorTypeR VectorTypeR;
637 typedef VankaMatrix<SubMatrix_> FirstClass;
638 typedef VankaMatrix<LAFEM::PowerColMatrix<SubMatrix_, dim_-1>> RestClass;
640 static constexpr int row_dim = FirstClass::row_dim + RestClass::row_dim;
641 static constexpr int col_dim = FirstClass::col_dim;
648 explicit VankaMatrix(
const MatrixType& matrix) :
649 _first(matrix.first()),
654 template<
typename DT_,
typename IT_>
655 std::pair<IT_, IT_> gather_full(
656 DT_* data,
const IT_* ridx,
const IT_* cidx,
657 const IT_ m,
const IT_ n,
const IT_ stride,
658 const IT_ mo = IT_(0),
const IT_ no = IT_(0))
const
660 std::pair<IT_, IT_> mno = _first.gather_full(data, ridx, cidx, m, n, stride, mo, no);
661 return _rest.gather_full(data, ridx, cidx, m, n, stride, mno.first, no);
664 template<
int ro_,
int co_,
typename DT_,
typename IT_>
665 IT_ gather_diag_pfm(DT_* data,
const IT_* idx,
const IT_ m,
const IT_ mo = IT_(0))
const
667 IT_ mno = _first.template gather_diag_pfm<ro_, co_>(data, idx, m, mo);
668 return _rest.template gather_diag_pfm<ro_+1, co_>(data, idx, m, mno);
671 template<
typename DT_,
typename IT_>
672 IT_ mult_cor(DT_* x,
const DT_ alpha,
const VectorTypeR& vec_cor,
const IT_* idx,
const IT_ m,
const IT_ off)
const
674 IT_ noff = _first.mult_cor(x, alpha, vec_cor, idx, m, off);
675 return _rest.mult_cor(x, alpha, vec_cor, idx, m, noff);
679 template<
typename SubMatrix_>
680 class VankaMatrix<LAFEM::PowerColMatrix<SubMatrix_, 1>>
683 typedef LAFEM::PowerColMatrix<SubMatrix_, 1> MatrixType;
684 typedef typename MatrixType::VectorTypeR VectorTypeR;
685 typedef VankaMatrix<SubMatrix_> FirstClass;
687 static constexpr int row_dim = FirstClass::row_dim;
688 static constexpr int col_dim = FirstClass::col_dim;
691 VankaMatrix<SubMatrix_> _first;
694 explicit VankaMatrix(
const MatrixType& matrix) :
695 _first(matrix.first())
699 template<
typename DT_,
typename IT_>
700 std::pair<IT_, IT_> gather_full(
701 DT_* data,
const IT_* ridx,
const IT_* cidx,
702 const IT_ m,
const IT_ n,
const IT_ stride,
703 const IT_ mo = IT_(0),
const IT_ no = IT_(0))
const
705 return _first.gather_full(data, ridx, cidx, m, n, stride, mo, no);
708 template<
int ro_,
int co_,
typename DT_,
typename IT_>
709 IT_ gather_diag_pfm(DT_* data,
const IT_* idx,
const IT_ m,
const IT_ mo = IT_(0))
const
711 return _first.template gather_diag_pfm<ro_, co_>(data, idx, m, mo);
714 template<
typename DT_,
typename IT_>
715 IT_ mult_cor(DT_* x,
const DT_ alpha,
const VectorTypeR& vec_cor,
const IT_* idx,
const IT_ m,
const IT_ off)
const
717 return _first.mult_cor(x, alpha, vec_cor, idx, m, off);
721 template<
typename SubMatrix_,
int dim_>
722 class VankaMatrix<LAFEM::PowerRowMatrix<SubMatrix_, dim_>>
725 typedef LAFEM::PowerRowMatrix<SubMatrix_, dim_> MatrixType;
726 typedef typename MatrixType::VectorTypeR VectorTypeR;
727 typedef VankaMatrix<SubMatrix_> FirstClass;
728 typedef VankaMatrix<LAFEM::PowerRowMatrix<SubMatrix_, dim_-1>> RestClass;
730 static constexpr int row_dim = FirstClass::row_dim;
731 static constexpr int col_dim = FirstClass::col_dim + RestClass::col_dim;
738 explicit VankaMatrix(
const MatrixType& matrix) :
739 _first(matrix.first()),
744 template<
typename DT_,
typename IT_>
745 std::pair<IT_, IT_> gather_full(
746 DT_* data,
const IT_* ridx,
const IT_* cidx,
747 const IT_ m,
const IT_ n,
const IT_ stride,
748 const IT_ mo = IT_(0),
const IT_ no = IT_(0))
const
750 std::pair<IT_, IT_> mno = _first.gather_full(data, ridx, cidx, m, n, stride, mo, no);
751 return _rest.gather_full(data, ridx, cidx, m, n, stride, mo, mno.second);
754 template<
int ro_,
int co_,
typename DT_,
typename IT_>
755 IT_ gather_diag_pfm(DT_* data,
const IT_* idx,
const IT_ m,
const IT_ mo = IT_(0))
const
758 return _first.gather_diag(data, idx, m, mo);
760 return _rest.template gather_diag_pfm<ro_, co_+1>(data, idx, m, mo);
763 template<
typename DT_,
typename IT_>
764 IT_ mult_cor(DT_* x,
const DT_ alpha,
const VectorTypeR& vec_cor,
const IT_* idx,
const IT_ m,
const IT_ off)
const
766 _first.mult_cor(x, alpha, vec_cor.first(), idx, m, off);
767 return _rest.mult_cor(x, alpha, vec_cor.rest(), idx, m, off);
771 template<
typename SubMatrix_>
772 class VankaMatrix<LAFEM::PowerRowMatrix<SubMatrix_, 1>>
775 typedef LAFEM::PowerRowMatrix<SubMatrix_, 1> MatrixType;
776 typedef VankaMatrix<SubMatrix_> FirstClass;
777 typedef typename MatrixType::VectorTypeR VectorTypeR;
779 static constexpr int row_dim = FirstClass::row_dim;
780 static constexpr int col_dim = FirstClass::col_dim;
786 explicit VankaMatrix(
const MatrixType& matrix) :
787 _first(matrix.first())
791 template<
typename DT_,
typename IT_>
792 std::pair<IT_, IT_> gather_full(
793 DT_* data,
const IT_* ridx,
const IT_* cidx,
794 const IT_ m,
const IT_ n,
const IT_ stride,
795 const IT_ mo = IT_(0),
const IT_ no = IT_(0))
const
797 return _first.gather_full(data, ridx, cidx, m, n, stride, mo, no);
800 template<
int ro_,
int co_,
typename DT_,
typename IT_>
801 IT_ gather_diag_pfm(DT_* data,
const IT_* idx,
const IT_ m,
const IT_ mo = IT_(0))
const
804 return _first.gather_diag(data, idx, m, mo);
809 template<
typename DT_,
typename IT_>
810 IT_ mult_cor(DT_* x,
const DT_ alpha,
const VectorTypeR& vec_cor,
const IT_* idx,
const IT_ m,
const IT_ off)
const
812 return _first.mult_cor(x, alpha, vec_cor.first(), idx, m, off);
816 template<
typename SubMatrix_,
int dim_w_,
int dim_h_>
817 class VankaMatrix<LAFEM::PowerFullMatrix<SubMatrix_, dim_w_, dim_h_>>
820 typedef LAFEM::PowerFullMatrix<SubMatrix_, dim_w_, dim_h_> MatrixType;
821 typedef typename MatrixType::VectorTypeR VectorTypeR;
822 typedef VankaMatrix<typename MatrixType::ContClass> ContClass;
824 static constexpr int row_dim = ContClass::row_dim;
825 static constexpr int col_dim = ContClass::col_dim;
831 explicit VankaMatrix(
const MatrixType& matrix) :
832 _cont(matrix.get_container())
836 template<
typename DT_,
typename IT_>
837 std::pair<IT_, IT_> gather_full(
838 DT_* data,
const IT_* ridx,
const IT_* cidx,
839 const IT_ m,
const IT_ n,
const IT_ stride,
840 const IT_ mo = IT_(0),
const IT_ no = IT_(0))
const
842 return _cont.gather_full(data, ridx, cidx, m, n, stride, mo, no);
845 template<
typename DT_,
typename IT_>
846 IT_ gather_diag(DT_* data,
const IT_* idx,
const IT_ m,
const IT_ mo = IT_(0))
const
848 return _cont.template gather_diag_pfm<0,0>(data, idx, m, mo);
851 template<
typename DT_,
typename IT_>
852 IT_ mult_cor(DT_* x,
const DT_ alpha,
const VectorTypeR& vec_cor,
const IT_* idx,
const IT_ m,
const IT_ off)
const
854 return _cont.mult_cor(x, alpha, vec_cor, idx, m, off);
858 template<
typename DT_,
typename IT_>
859 Memory::TypedView<IT_> vanka_row_ptr(
860 const LAFEM::SparseMatrixCSR<DT_, IT_>& matrix)
862 return matrix.row_ptr_view_r();
865 template<
typename DT_,
typename IT_,
int m_,
int n_>
866 Memory::TypedView<IT_> vanka_row_ptr(
867 const LAFEM::SparseMatrixBCSR<DT_, IT_, m_, n_>& matrix)
869 return matrix.row_ptr_view_r();
872 template<
typename DT_,
typename IT_,
int dim_>
873 Memory::TypedView<IT_> vanka_row_ptr(
874 const LAFEM::PowerColMatrix<LAFEM::SparseMatrixCSR<DT_, IT_>, dim_>& matrix)
876 return matrix.first().row_ptr_view_r();
879 template<
typename DT_,
typename IT_,
int dim_>
880 Memory::TypedView<IT_> vanka_row_ptr(
881 const LAFEM::PowerRowMatrix<LAFEM::SparseMatrixCSR<DT_, IT_>, dim_>& matrix)
883 return matrix.first().row_ptr_view_r();
886 template<
typename DT_,
typename IT_,
int dim_>
887 Memory::TypedView<IT_> vanka_row_ptr(
888 const LAFEM::PowerDiagMatrix<LAFEM::SparseMatrixCSR<DT_, IT_>, dim_>& matrix)
890 return matrix.first().row_ptr_view_r();
893 template<
typename DT_,
typename IT_,
int row_dim_,
int col_dim_>
894 Memory::TypedView<IT_> vanka_row_ptr(
895 const LAFEM::PowerFullMatrix<LAFEM::SparseMatrixCSR<DT_, IT_>, row_dim_, col_dim_>& matrix)
897 return matrix.first().row_ptr_view_r();
900 template<
typename DT_,
typename IT_>
901 Memory::TypedView<IT_> vanka_col_idx(
902 const LAFEM::SparseMatrixCSR<DT_, IT_>& matrix)
904 return matrix.col_idx_view_r();
907 template<
typename DT_,
typename IT_,
int m_,
int n_>
908 Memory::TypedView<IT_> vanka_col_idx(
909 const LAFEM::SparseMatrixBCSR<DT_, IT_, m_, n_>& matrix)
911 return matrix.col_idx_view_r();
914 template<
typename DT_,
typename IT_,
int dim_>
915 Memory::TypedView<IT_> vanka_col_idx(
916 const LAFEM::PowerColMatrix<LAFEM::SparseMatrixCSR<DT_, IT_>, dim_>& matrix)
918 return matrix.first().col_idx_view_r();
921 template<
typename DT_,
typename IT_,
int dim_>
922 Memory::TypedView<IT_> vanka_col_idx(
923 const LAFEM::PowerRowMatrix<LAFEM::SparseMatrixCSR<DT_, IT_>, dim_>& matrix)
925 return matrix.first().col_idx_view_r();
928 template<
typename DT_,
typename IT_,
int dim_>
929 Memory::TypedView<IT_> vanka_col_idx(
930 const LAFEM::PowerDiagMatrix<LAFEM::SparseMatrixCSR<DT_, IT_>, dim_>& matrix)
932 return matrix.first().col_idx_view_r();
935 template<
typename DT_,
typename IT_,
int row_dim_,
int col_dim_>
936 Memory::TypedView<IT_> vanka_col_idx(
937 const LAFEM::PowerFullMatrix<LAFEM::SparseMatrixCSR<DT_, IT_>, row_dim_, col_dim_>& matrix)
939 return matrix.first().col_idx_view_r();
993 template<
typename Matrix_,
typename Filter_>
1068 template<
typename MatrixA_,
typename MatrixB_,
typename MatrixD_,
typename Filter_>
1069 class Vanka<LAFEM::SaddlePointMatrix<MatrixA_, MatrixB_, MatrixD_>, Filter_> :
1070 public SolverBase<LAFEM::TupleVector<typename MatrixB_::VectorTypeL, typename MatrixD_::VectorTypeL>>
1092 typedef Intern::VankaMatrix<MatrixA_> VankaMatrixA;
1093 typedef Intern::VankaMatrix<MatrixB_> VankaMatrixB;
1094 typedef Intern::VankaMatrix<MatrixD_> VankaMatrixD;
1097 static_assert(VankaMatrixA::row_dim == VankaMatrixA::col_dim,
"Matrix A has invalid dimensions");
1098 static_assert(VankaMatrixA::row_dim == VankaMatrixB::row_dim,
"Matrices A and B have incompatible dimensions");
1099 static_assert(VankaMatrixA::col_dim == VankaMatrixD::col_dim,
"Matrices A and D have incompatible dimensions");
1100 static_assert(VankaMatrixB::col_dim == VankaMatrixD::row_dim,
"Matrices B and D have incompatible dimensions");
1103 static_assert(VankaMatrixB::col_dim == 1,
"Invalid pressure space dimension");
1175 watch_init_symbolic.
start();
1177 bool block = ((int(_type) & 0x010) != 0);
1178 bool multi = ((int(_type) & 0x100) == 0);
1183 this->_build_p_block();
1187 this->_build_p_nodal();
1191 this->_build_v_block();
1194 this->_alloc_data();
1204 watch_init_symbolic.
stop();
1216 _block_v_ptr.clear();
1217 _block_v_idx.clear();
1218 _block_p_ptr.clear();
1219 _block_p_idx.clear();
1225 watch_init_numeric.
start();
1227 bool full = ((int(_type) & 0x001) != 0);
1228 bool multi = ((int(_type) & 0x100) == 0);
1232 this->_factor_full();
1236 this->_factor_diag();
1241 this->_calc_scale();
1244 watch_init_numeric.
stop();
1247 virtual Status apply(VectorType& vec_cor,
const VectorType& vec_def)
override
1249 watch_apply.
start();
1251 bool full = ((int(_type) & 0x001) != 0);
1254 this->_apply_full(vec_cor, vec_def);
1258 this->_apply_diag(vec_cor, vec_def);
1266 std::size_t data_size()
const
1268 return _data.size();
1271 std::size_t bytes()
const
1273 return sizeof(IndexType) * (_block_v_ptr.size() + _block_v_idx.size() + _block_p_ptr.size() + _block_p_idx.size())
1274 +
sizeof(DataType) * (_data.size() + _vdef.size() + _vcor.size())
1283 watch_init_symbolic.
reset();
1284 watch_init_numeric.
reset();
1285 watch_apply.
reset();
1293 return watch_init_symbolic.
elapsed();
1301 return watch_init_numeric.
elapsed();
1331 _block_p_ptr.clear();
1332 _block_p_idx.clear();
1336 std::map<IndexType, int> map_s;
1339 std::vector<int> mask(std::size_t(m), 0);
1342 for(
Index i(0); i < m; ++i)
1352 for(
IndexType kd = row_ptr_d[i]; kd < row_ptr_d[i+1]; ++kd)
1358 for(
IndexType kb = row_ptr_b[col_d]; kb < row_ptr_b[col_d+1]; ++kb)
1364 auto ib = map_s.emplace(col_b, 1);
1368 ++(ib.first->second);
1375 for(
auto it = map_s.begin(); it != map_s.end(); ++it)
1379 for(
auto it = map_s.begin(); it != map_s.end(); ++it)
1381 if(ideg == it->second)
1384 _block_p_idx.push_back(it->first);
1385 mask[it->first] = 1;
1390 _block_p_ptr.push_back(
IndexType(_block_p_idx.size()));
1402 _block_p_ptr.clear();
1403 _block_p_idx.clear();
1404 _block_p_ptr.reserve(m+1);
1405 _block_p_idx.reserve(m);
1408 _block_p_ptr.push_back(i);
1409 _block_p_idx.push_back(i);
1411 _block_p_ptr.push_back(m);
1425 _block_v_ptr.clear();
1426 _block_v_idx.clear();
1427 _block_v_ptr.reserve(m+1);
1430 std::set<IndexType> set_v;
1436 for(
IndexType j = _block_p_ptr[i]; j < _block_p_ptr[i+1]; ++j)
1442 for(
IndexType k = row_ptr_d[pix]; k < row_ptr_d[pix+1]; ++k)
1445 set_v.insert(col_idx_d[k]);
1450 for(
auto it = set_v.begin(); it != set_v.end(); ++it)
1452 _block_v_idx.push_back(*it);
1456 _block_v_ptr.push_back(
IndexType(_block_v_idx.size()));
1470 bool diag = ((int(_type) & 1) == 0);
1483 IndexType nv = _block_v_ptr[i+1] - _block_v_ptr[i];
1484 IndexType np = _block_p_ptr[i+1] - _block_p_ptr[i];
1509 _vdef.resize(dim*_degree_v + _degree_p);
1510 _vcor.resize(dim*_degree_v + _degree_p);
1517 this->_vec_scale.
format();
1520 Intern::VankaVector<VectorV> vanka_v(this->_vec_scale.template at<0>());
1521 Intern::VankaVector<VectorP> vanka_p(this->_vec_scale.template at<1>());
1524 const IndexType* vptr = _block_v_ptr.data();
1525 const IndexType* vidx = _block_v_idx.data();
1526 const IndexType* pptr = _block_p_ptr.data();
1527 const IndexType* pidx = _block_p_idx.data();
1530 std::vector<DataType> vec_one(vanka_v.dim*_degree_v + _degree_p,
DataType(1));
1531 const DataType* vone = vec_one.data();
1535 for(
IndexType iblock(0); iblock < nblocks; ++iblock)
1538 const IndexType nv = vptr[iblock+1] - vptr[iblock];
1539 const IndexType np = pptr[iblock+1] - pptr[iblock];
1548 this->_vec_scale.component_invert(this->_vec_scale);
1554 Intern::VankaMatrix<MatrixA_> vanka_a(_matrix.
block_a());
1555 Intern::VankaMatrix<MatrixB_> vanka_b(_matrix.
block_b());
1556 Intern::VankaMatrix<MatrixD_> vanka_d(_matrix.
block_d());
1563 const IndexType* vptr = _block_v_ptr.data();
1564 const IndexType* vidx = _block_v_idx.data();
1565 const IndexType* pptr = _block_p_ptr.data();
1566 const IndexType* pidx = _block_p_idx.data();
1572 std::vector<IndexType> pivot(3*(dim*_degree_v + _degree_p));
1579 for(
IndexType iblock(0); iblock < nblocks; ++iblock)
1582 const IndexType nv = vptr[iblock+1] - vptr[iblock];
1583 const IndexType np = pptr[iblock+1] - pptr[iblock];
1586 const IndexType* loc_vidx = &vidx[vptr[iblock]];
1587 const IndexType* loc_pidx = &pidx[pptr[iblock]];
1594 DataType* block_data = &data[block_offset];
1597 std::pair<IndexType,IndexType> ao =
1598 vanka_a.gather_full(block_data, loc_vidx, loc_vidx, nv, nv, n);
1599 vanka_b.gather_full(block_data, loc_vidx, loc_pidx, nv, np, n,
IndexType(0), ao.second);
1600 vanka_d.gather_full(block_data, loc_pidx, loc_vidx, np, nv, n, ao.first,
IndexType(0));
1611 block_offset += block_size;
1622 const bool multi = ((int(_type) & 0x100) == 0);
1627 this->_vec_tmp1.
copy(vec_def);
1628 this->_vec_tmp2.
format();
1632 VectorV& vec_cv = (multi ? vec_cor.template at<0>() : this->_vec_tmp2.template at<0>());
1633 VectorP& vec_cp = (multi ? vec_cor.template at<1>() : this->_vec_tmp2.template at<1>());
1634 const VectorV& vec_dv = (multi ? vec_def.template at<0>() : this->_vec_tmp1.template at<0>());
1635 const VectorP& vec_dp = (multi ? vec_def.template at<1>() : this->_vec_tmp1.template at<1>());
1644 const IndexType* vptr = _block_v_ptr.data();
1645 const IndexType* vidx = _block_v_idx.data();
1646 const IndexType* pptr = _block_p_ptr.data();
1647 const IndexType* pidx = _block_p_idx.data();
1650 const DataType* lmat_data = _data.data();
1663 this->_matrix.
apply(_vec_tmp1, vec_cor, vec_def, -
DataType(1));
1673 for(
IndexType iblock(0); iblock < num_blocks; ++iblock)
1676 const IndexType nv = vptr[iblock+1] - vptr[iblock];
1677 const IndexType np = pptr[iblock+1] - pptr[iblock];
1680 const IndexType* loc_vidx = &vidx[vptr[iblock]];
1681 const IndexType* loc_pidx = &pidx[pptr[iblock]];
1687 const DataType* lmat = &lmat_data[block_offset];
1691 DataType* lcor_p = &lcor[velo_dim * nv];
1693 DataType* ldef_p = &ldef[velo_dim * nv];
1697 Intern::VankaVector<VectorV> vanka_dv(vec_dv);
1698 Intern::VankaVector<VectorP> vanka_dp(vec_dp);
1699 vanka_dv.gather_def(ldef_v, loc_vidx, nv,
IndexType(0));
1700 vanka_dp.gather_def(ldef_p, loc_pidx, np,
IndexType(0));
1706 Intern::VankaMatrix<MatrixA_> vanka_a(_matrix.
block_a());
1707 Intern::VankaMatrix<MatrixB_> vanka_b(_matrix.
block_b());
1708 Intern::VankaMatrix<MatrixD_> vanka_d(_matrix.
block_d());
1722 lcor[i] += lmat[i*n + j] * ldef[j];
1729 Intern::VankaVector<VectorV> vanka_cv(vec_cv);
1730 Intern::VankaVector<VectorP> vanka_cp(vec_cp);
1731 vanka_cv.scatter_cor(_omega, lcor_v, loc_vidx, nv,
IndexType(0));
1732 vanka_cp.scatter_cor(_omega, lcor_p, loc_pidx, np,
IndexType(0));
1736 block_offset += n*n;
1739 Statistics::add_time_precon(stamp_kernel.
elapsed_now());
1745 this->_vec_tmp2.component_product(this->_vec_tmp2, this->_vec_scale);
1748 vec_cor.axpy(this->_vec_tmp2);
1752 _filter.filter_cor(vec_cor);
1761 Intern::VankaMatrix<MatrixA_> vanka_a(_matrix.
block_a());
1762 Intern::VankaMatrix<MatrixB_> vanka_b(_matrix.
block_b());
1763 Intern::VankaMatrix<MatrixD_> vanka_d(_matrix.
block_d());
1770 const IndexType* vptr = _block_v_ptr.data();
1771 const IndexType* vidx = _block_v_idx.data();
1772 const IndexType* pptr = _block_p_ptr.data();
1773 const IndexType* pidx = _block_p_idx.data();
1779 std::vector<IndexType> pivot(3*_degree_p);
1786 for(
IndexType iblock(0); iblock < nblocks; ++iblock)
1789 const IndexType nv = vptr[iblock+1] - vptr[iblock];
1790 const IndexType np = pptr[iblock+1] - pptr[iblock];
1794 const IndexType* loc_vidx = &vidx[vptr[iblock]];
1795 const IndexType* loc_pidx = &pidx[pptr[iblock]];
1801 DataType* block_data = &data[block_offset];
1805 DataType* loc_b = &block_data[dnv];
1806 DataType* loc_d = &block_data[dnv + dnv*np];
1810 vanka_a.gather_diag(loc_a, loc_vidx, nv);
1812 vanka_b.gather_full(loc_b, loc_vidx, loc_pidx, nv, np, np);
1813 vanka_d.gather_full(loc_d, loc_pidx, loc_vidx, np, nv, dnv);
1830 loc_d[j*dnv + i] *= loc_a[i];
1844 s += loc_d[i*dnv + k] * loc_b[k*np + j];
1846 loc_s[i*np + j] = -s;
1859 block_offset += block_size;
1870 const bool multi = ((int(_type) & 0x100) == 0);
1875 this->_vec_tmp1.
copy(vec_def);
1876 this->_vec_tmp2.
format();
1880 VectorV& vec_cv = (multi ? vec_cor.template at<0>() : this->_vec_tmp2.template at<0>());
1881 VectorP& vec_cp = (multi ? vec_cor.template at<1>() : this->_vec_tmp2.template at<1>());
1882 const VectorV& vec_dv = (multi ? vec_def.template at<0>() : this->_vec_tmp1.template at<0>());
1883 const VectorP& vec_dp = (multi ? vec_def.template at<1>() : this->_vec_tmp1.template at<1>());
1892 const IndexType* vptr = _block_v_ptr.data();
1893 const IndexType* vidx = _block_v_idx.data();
1894 const IndexType* pptr = _block_p_ptr.data();
1895 const IndexType* pidx = _block_p_idx.data();
1898 const DataType* data = _data.data();
1911 this->_matrix.
apply(_vec_tmp1, vec_cor, vec_def, -
DataType(1));
1921 for(
IndexType iblock(0); iblock < num_blocks; ++iblock)
1924 const IndexType nv = vptr[iblock+1] - vptr[iblock];
1925 const IndexType np = pptr[iblock+1] - pptr[iblock];
1929 const IndexType* loc_vidx = &vidx[vptr[iblock]];
1930 const IndexType* loc_pidx = &pidx[pptr[iblock]];
1936 const DataType* block_data = &data[block_offset];
1939 const DataType* loc_a = block_data;
1940 const DataType* loc_b = &block_data[dnv];
1941 const DataType* loc_d = &block_data[dnv + dnv*np];
1952 Intern::VankaVector<VectorV> vanka_dv(vec_dv);
1953 Intern::VankaVector<VectorP> vanka_dp(vec_dp);
1954 vanka_dv.gather_def(ldef_v, loc_vidx, nv,
IndexType(0));
1955 vanka_dp.gather_def(ldef_p, loc_pidx, np,
IndexType(0));
1961 Intern::VankaMatrix<MatrixA_> vanka_a(_matrix.
block_a());
1962 Intern::VankaMatrix<MatrixB_> vanka_b(_matrix.
block_b());
1963 Intern::VankaMatrix<MatrixD_> vanka_d(_matrix.
block_d());
1978 r += loc_d[i*dnv + j] * ldef_v[j];
1991 r += loc_s[i*np + j] * ldef_p[j];
2003 xb += loc_b[i*np + j] * lcor_p[j];
2006 lcor_v[i] = loc_a[i] * (ldef_v[i] - xb);
2008 flops += dnv * (2*np + 2);
2012 Intern::VankaVector<VectorV> vanka_cv(vec_cv);
2013 Intern::VankaVector<VectorP> vanka_cp(vec_cp);
2014 vanka_cv.scatter_cor(_omega, lcor_v, loc_vidx, nv,
IndexType(0));
2015 vanka_cp.scatter_cor(_omega, lcor_p, loc_pidx, np,
IndexType(0));
2019 block_offset += block_size;
2022 Statistics::add_time_precon(stamp_kernel.
elapsed_now());
2028 this->_vec_tmp2.component_product(this->_vec_tmp2, this->_vec_scale);
2031 vec_cor.axpy(this->_vec_tmp2);
2035 _filter.filter_cor(vec_cor);
2063 template<
typename MatrixA_,
typename MatrixB_,
typename MatrixD_,
typename Filter_>
2064 std::shared_ptr<Vanka<LAFEM::SaddlePointMatrix<MatrixA_, MatrixB_, MatrixD_>, Filter_>>
new_vanka(
2066 const Filter_& filter,
2068 typename MatrixA_::DataType omega =
typename MatrixA_::DataType(1),
2071 return std::make_shared<Vanka<LAFEM::SaddlePointMatrix<MatrixA_, MatrixB_, MatrixD_>, Filter_>>
2072 (matrix, filter, type, omega, num_iter);
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Saddle-Point matrix meta class template.
MatrixTypeA::DataType DataType
data type
MatrixTypeA & block_a()
Returns the sub-matrix block A.
VectorTypeR create_vector_r() const
Returns a new compatible R-Vector.
void apply(VectorTypeL &r, const VectorTypeR &x) const
Applies this matrix onto a vector.
MatrixTypeA::IndexType IndexType
index type
MatrixTypeB & block_b()
Returns the sub-matrix block B.
MatrixTypeD & block_d()
Returns the sub-matrix block D.
Variadic TupleVector class template.
std::size_t bytes() const
Returns the total amount of bytes allocated.
void copy(const TupleVector &x, bool full=false)
Performs .
void clear()
Free all allocated arrays.
void format()
Reset all elements of the container to a given value or zero if missing.
Polymorphic solver interface.
Base-class for solver generated exceptions.
MatrixType::DataType DataType
our data type
virtual void init_numeric() override
Performs numeric factorization.
void _calc_scale()
Calculate the scaling vector for additive Vanka.
double time_apply() const
Returns the total accumulated time for the solver application.
virtual void done_symbolic() override
Releases the symbolic factorization data.
DataType _omega
relaxation parameter
void _factor_full()
Performs the 'full' numerical factorization.
Index _num_iter
desired number of iterations
void _factor_diag()
Performs the 'diagonal' numerical factorization.
IndexType _degree_p
maximum pressure block degree
void _build_p_block()
Builds the 'blocked' pressure graph.
void _alloc_data()
Allocates the data arrays for numerical factorization.
virtual void init_symbolic() override
Performs symbolic factorization.
std::vector< IndexType > _block_v_ptr
velocity block structure
MatrixType::IndexType IndexType
our index type
std::vector< DataType > _data
factorization data
Filter_ FilterType
our filter type
void _apply_full(VectorType &vec_cor, const VectorType &vec_def)
Applies the 'full' Vanka iteration.
MatrixB_::VectorTypeR VectorP
pressure vector type
double time_init_numeric() const
Returns the total accumulated time for numeric initialization.
MatrixType::VectorTypeR VectorType
our vector type
virtual String name() const override
Returns the name of the solver.
void _build_v_block()
Builds the velocity graph.
std::vector< IndexType > _block_p_ptr
pressure block structure
const FilterType & _filter
the system filter
void reset_timings()
Resets the internal stop watches for time measurement.
VectorType _vec_scale
temporary vectors (additive types only)
VankaType _type
the Vanka type
IndexType _degree_v
maximum velocity block degree
Vanka(const MatrixType &matrix, const FilterType &filter, VankaType type, DataType omega=DataType(1), Index num_iter=Index(1))
Constructor.
void _apply_diag(VectorType &vec_cor, const VectorType &vec_def)
Applies the 'diagonal' Vanka iteration.
void _build_p_nodal()
Builds the 'nodal' pressure graph.
MatrixD_::VectorTypeR VectorV
velocity vector type
const MatrixType & _matrix
the system matrix
std::vector< DataType > _vdef
local defect/correction vectors
double time_init_symbolic() const
Returns the total accumulated time for symbolic initialization.
LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ > MatrixType
our matrix type
Vanka Factorization Error.
Vanka preconditioner/smoother class template.
static void add_flops(Index flops)
Add an amount of flops to the global flop counter.
double elapsed() const
Returns the total elapsed time in seconds.
void start()
Starts the stop-watch.
void reset()
Resets the elapsed time.
void stop()
Stops the stop-watch and increments elapsed time.
String class implementation.
double elapsed_now() const
Calculates the time elapsed between the time stamp and now.
bool isnormal(T_ x)
Checks whether a value is normal.
T_ sqr(T_ x)
Returns the square of a value.
DT_ invert_matrix(const IT_ n, const IT_ stride, DT_ a[], IT_ p[])
Inverts a matrix and returns its determinant.
T_ max(T_ a, T_ b)
Returns the maximum of two values.
void memset_main(void *ptr, int value, std::size_t bytes)
Formats all bytes of a memory block in main memory to a given value.
VankaType
Vanka type enumeration.
@ nodal_full_mult
Nodal full Vanka type (multiplicative)
@ block_diag_add
Blocked diagonal Vanka type (additive)
@ nodal_full_add
Nodal full Vanka type (additive)
@ block_diag_mult
Blocked diagonal Vanka type (multiplicative)
@ nodal_diag_mult
Nodal diagonal Vanka type (multiplicative)
@ block_full_mult
Blocked full Vanka type (multiplicative)
@ nodal_diag_add
Nodal diagonal Vanka type (additive)
@ block_full_add
Blocked full Vanka type (additive)
Status
Solver status return codes enumeration.
@ success
solving successful (convergence criterion fulfilled)
@ iter
Plot every iteration (if applicable)
@ full
full Uzawa preconditioner
@ rest
restriction (multigrid)
std::shared_ptr< Vanka< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, Filter_ > > new_vanka(const LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ > &matrix, const Filter_ &filter, VankaType type, typename MatrixA_::DataType omega=typename MatrixA_::DataType(1), Index num_iter=Index(1))
Creates a new Vanka solver object.
std::uint64_t Index
Index data type.