3#ifndef DUNE_ISTL_OVERLAPPINGSCHWARZ_HH
4#define DUNE_ISTL_OVERLAPPINGSCHWARZ_HH
11#include <dune/common/dynmatrix.hh>
12#include <dune/common/sllist.hh>
37 template<
class M,
class X,
class TM,
class TD,
class TA>
38 class SeqOverlappingSchwarz;
43 template<
class I,
class S,
class D>
52 typedef typename AtomInitializer::Matrix
Matrix;
53 typedef typename Matrix::const_iterator
Iter;
54 typedef typename Matrix::row_type::const_iterator
CIter;
80 typedef std::map<size_type,size_type> Map;
81 typedef typename Map::iterator iterator;
82 typedef typename Map::const_iterator const_iterator;
94 const_iterator
begin()
const;
98 const_iterator
end()
const;
101 std::map<size_type,size_type> map_;
106 typedef typename InitializerList::iterator InitIterator;
107 typedef typename IndexSet::const_iterator IndexIteratur;
110 mutable std::vector<IndexMap> indexMaps;
137 template<
class M,
class X,
class Y>
141 template<
class K,
class Al,
class X,
class Y>
154 static constexpr size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<K>()))>::rows;
160 void apply (DynamicVector<field_type>& v, DynamicVector<field_type>& d)
162 assert(v.size() > 0);
163 assert(v.size() == d.size());
164 assert(A.rows() <= v.size());
165 assert(A.cols() <= v.size());
166 size_t sz = A.rows();
170 v.resize(v.capacity());
171 d.resize(d.capacity());
184 size_t sz = rowset.size();
186 typedef typename S::const_iterator SIter;
188 for(SIter rowIdx = rowset.begin(), rowEnd=rowset.end();
189 rowIdx!= rowEnd; ++rowIdx, r++)
192 for(SIter colIdx = rowset.begin(), colEnd=rowset.end();
193 colIdx!= colEnd; ++colIdx, c++)
195 if (BCRS[*rowIdx].find(*colIdx) == BCRS[*rowIdx].end())
197 for (
size_t i=0; i<n; i++)
199 for (
size_t j=0; j<n; j++)
201 A[r*n+i][c*n+j] = Impl::asMatrix(BCRS[*rowIdx][*colIdx])[i][j];
211 template<
typename T,
bool tag>
219 template<
class K,
class Al,
class X,
class Y>
228 static constexpr size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<K>()))>::rows;
248 void resetIndexForNextDomain();
255 DynamicVector<field_type> & lhs();
262 DynamicVector<field_type> & rhs();
275 void operator()(
const size_type& domainIndex);
294 DynamicVector<field_type> * rhs_;
297 DynamicVector<field_type> * lhs_;
305 std::size_t maxlength_;
308#if HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
309 template<
template<
class>
class S,
typename T,
typename A>
319 static constexpr size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::rows;
320 static constexpr size_t m = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::cols;
340 void resetIndexForNextDomain();
364 void operator()(
const size_type& domain);
391 std::size_t maxlength_;
396 template<
class M,
class X,
class Y>
479 template<
class M,
class X,
class Y>
498 template<
class M,
class X,
class Y>
516 template<
typename S,
typename T>
520 template<
typename S,
typename T,
typename A>
524 typedef typename std::decay_t<decltype(Impl::asVector(std::declval<T>()))>::field_type
field_type;
527 void operator()(
const size_type& domain);
529 static constexpr size_t n = std::decay_t<decltype(Impl::asVector(std::declval<T>()))>::dimension;
538 template<
typename S,
typename T>
542 template<
typename S,
typename T,
typename A>
546 typedef typename std::decay_t<decltype(Impl::asVector(std::declval<T>()))>::field_type
field_type;
549 void operator()(
const size_type& domain);
551 static constexpr size_t n = std::decay_t<decltype(Impl::asVector(std::declval<T>()))>::dimension;
568 template<
typename T,
class X,
class S>
572 template<
class X,
class S>
578 template<
class X,
class S>
584 template<
class X,
class S>
601 template<
typename T1,
typename T2,
bool forward>
629 template<
typename T1,
typename T2>
673 sm.template apply<true>(v, b);
677 template<
class M,
class X,
class TD,
class TA>
685 sm.template apply<true>(v, b);
686 sm.template apply<false>(v, b);
690 template<
class T,
bool tag>
697 template<
class K,
class Al,
class X,
class Y>
701 static constexpr size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<K>()))>::rows;
702 template<
class RowToDomain,
class Solvers,
class SubDomains>
703 static std::size_t assembleLocalProblems(
const RowToDomain& rowToDomain,
const matrix_type&
mat,
704 Solvers& solvers,
const SubDomains& domains,
708 template<
template<
class>
class S,
typename T,
typename A>
712 static constexpr size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::rows;
713 template<
class RowToDomain,
class Solvers,
class SubDomains>
714 static std::size_t assembleLocalProblems(
const RowToDomain& rowToDomain,
const matrix_type&
mat,
715 Solvers& solvers,
const SubDomains& domains,
719 template<
class M,
class X,
class Y>
723 template<
class RowToDomain,
class Solvers,
class SubDomains>
725 Solvers& solvers,
const SubDomains& domains,
729 template<
class M,
class X,
class Y>
734 template<
class M,
class X,
class Y>
790 typedef std::set<size_type, std::less<size_type>,
791 typename std::allocator_traits<TA>::template rebind_alloc<size_type> >
795 typedef std::vector<subdomain_type, typename std::allocator_traits<TA>::template rebind_alloc<subdomain_type> >
subdomain_vector;
798 typedef SLList<size_type, typename std::allocator_traits<TA>::template rebind_alloc<size_type> >
subdomain_list;
801 typedef std::vector<subdomain_list, typename std::allocator_traits<TA>::template rebind_alloc<subdomain_list> >
rowtodomain_vector;
807 typedef std::vector<slu, typename std::allocator_traits<TA>::template rebind_alloc<slu> >
slu_vector;
823 field_type relaxationFactor=1,
bool onTheFly_=
true);
837 field_type relaxationFactor=1,
bool onTheFly_=
true);
844 virtual void pre ([[maybe_unused]] X& x, [[maybe_unused]] X& b)
852 virtual void apply (X& v,
const X& d);
859 virtual void post ([[maybe_unused]] X& x)
862 template<
bool forward>
877 typename M::size_type maxlength;
884 template<
class I,
class S,
class D>
888 : initializers(&il), indices(&idx), indexMaps(il.size()), domains(domains_)
892 template<
class I,
class S,
class D>
895 typedef typename IndexSet::value_type::const_iterator iterator;
896 for(iterator domain=(*indices)[row.index()].begin(); domain != (*indices)[row.index()].end(); ++domain) {
897 (*initializers)[*domain].addRowNnz(row, domains[*domain]);
898 indexMaps[*domain].insert(row.index());
902 template<
class I,
class S,
class D>
905 for(
auto&& i: *initializers)
906 i.allocateMatrixStorage();
907 for(
auto&& i: *initializers)
911 template<
class I,
class S,
class D>
914 typedef typename IndexSet::value_type::const_iterator iterator;
915 for(iterator domain=(*indices)[row.index()].begin(); domain != (*indices)[row.index()].end(); ++domain) {
916 typename std::map<size_type,size_type>::const_iterator v = indexMaps[*domain].find(
col.index());
917 if(v!= indexMaps[*domain].end()) {
918 (*initializers)[*domain].countEntries(indexMaps[*domain].find(
col.index())->second);
923 template<
class I,
class S,
class D>
926 for(
auto&& i : *initializers)
930 template<
class I,
class S,
class D>
933 typedef typename IndexSet::value_type::const_iterator iterator;
934 for(iterator domain=(*indices)[row.index()].begin(); domain!= (*indices)[row.index()].end(); ++domain) {
935 typename std::map<size_type,size_type>::const_iterator v = indexMaps[*domain].find(
col.index());
936 if(v!= indexMaps[*domain].end()) {
937 assert(indexMaps[*domain].end()!=indexMaps[*domain].find(row.index()));
938 (*initializers)[*domain].copyValue(
col, indexMaps[*domain].find(row.index())->second,
944 template<
class I,
class S,
class D>
947 std::vector<IndexMap>().swap(indexMaps);
948 for(
auto&& i: *initializers)
952 template<
class I,
class S,
class D>
957 template<
class I,
class S,
class D>
960 assert(map_.find(grow)==map_.end());
961 map_.insert(std::make_pair(grow, row++));
964 template<
class I,
class S,
class D>
965 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::const_iterator
968 return map_.find(grow);
971 template<
class I,
class S,
class D>
972 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::iterator
975 return map_.find(grow);
978 template<
class I,
class S,
class D>
979 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::const_iterator
985 template<
class I,
class S,
class D>
986 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::iterator
992 template<
class I,
class S,
class D>
993 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::const_iterator
999 template<
class I,
class S,
class D>
1000 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::iterator
1003 return map_.begin();
1006 template<
class M,
class X,
class TM,
class TD,
class TA>
1009 :
mat(mat_), relax(relaxationFactor), onTheFly(fly)
1011 typedef typename rowtodomain_vector::const_iterator RowDomainIterator;
1012 typedef typename subdomain_list::const_iterator DomainIterator;
1013#ifdef DUNE_ISTL_WITH_CHECKING
1014 assert(rowToDomain.size()==mat.N());
1015 assert(rowToDomain.size()==mat.M());
1017 for(RowDomainIterator iter=rowToDomain.begin(); iter != rowToDomain.end(); ++iter)
1018 assert(iter->size()>0);
1023 for(RowDomainIterator iter=rowToDomain.begin(); iter != rowToDomain.end(); ++iter)
1024 for(DomainIterator d=iter->begin(); d != iter->end(); ++d)
1025 domains=std::max(domains, *d);
1028 solvers.resize(domains);
1029 subDomains.resize(domains);
1033 for(RowDomainIterator iter=rowToDomain.begin(); iter != rowToDomain.end(); ++iter, ++row)
1034 for(DomainIterator d=iter->begin(); d != iter->end(); ++d)
1035 subDomains[*d].insert(row);
1037#ifdef DUNE_ISTL_WITH_CHECKING
1039 typedef typename subdomain_vector::const_iterator iterator;
1040 for(iterator iter=subDomains.begin(); iter != subDomains.end(); ++iter) {
1041 typedef typename subdomain_type::const_iterator entry_iterator;
1042 Dune::dvverb<<
"domain "<<i++<<
":";
1043 for(entry_iterator entry = iter->begin(); entry != iter->end(); ++entry) {
1044 Dune::dvverb<<
" "<<*entry;
1046 Dune::dvverb<<std::endl;
1053 template<
class M,
class X,
class TM,
class TD,
class TA>
1058 :
mat(mat_), solvers(sd.size()), subDomains(sd), relax(relaxationFactor),
1061 typedef typename subdomain_vector::const_iterator DomainIterator;
1063#ifdef DUNE_ISTL_WITH_CHECKING
1066 for(DomainIterator d=sd.begin(); d != sd.end(); ++d,++i) {
1068 assert(d->size()>0);
1069 typedef typename DomainIterator::value_type::const_iterator entry_iterator;
1070 Dune::dvverb<<
"domain "<<i<<
":";
1071 for(entry_iterator entry = d->begin(); entry != d->end(); ++entry) {
1072 Dune::dvverb<<
" "<<*entry;
1074 Dune::dvverb<<std::endl;
1084 for(DomainIterator domain=sd.begin(); domain != sd.end(); ++domain, ++domainId) {
1085 typedef typename subdomain_type::const_iterator iterator;
1086 for(iterator row=domain->begin(); row != domain->end(); ++row)
1087 rowToDomain[*row].push_back(domainId);
1103 template<
typename T,
typename A>
1106 static constexpr size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::rows;
1107 static constexpr size_t m = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::cols;
1108 template<
class Domain>
1116 template<
class K,
class Al,
class X,
class Y>
1117 template<
class RowToDomain,
class Solvers,
class SubDomains>
1120 assembleLocalProblems([[maybe_unused]]
const RowToDomain& rowToDomain,
1122 [[maybe_unused]] Solvers& solvers,
1123 const SubDomains& subDomains,
1124 [[maybe_unused]]
bool onTheFly)
1126 typedef typename SubDomains::const_iterator DomainIterator;
1127 std::size_t maxlength = 0;
1131 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1132 maxlength=std::max(maxlength, domain->size());
1138#if HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
1139 template<
template<
class>
class S,
typename T,
typename A>
1140 template<
class RowToDomain,
class Solvers,
class SubDomains>
1144 const SubDomains& subDomains,
1147 typedef typename S<BCRSMatrix<T,A>>::MatrixInitializer MatrixInitializer;
1148 typedef typename std::vector<MatrixInitializer>::iterator InitializerIterator;
1149 typedef typename SubDomains::const_iterator DomainIterator;
1150 typedef typename Solvers::iterator SolverIterator;
1151 std::size_t maxlength = 0;
1154 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1155 maxlength=std::max(maxlength, domain->size());
1156 maxlength*=Impl::asMatrix(*
mat[0].begin()).N();
1159 DomainIterator domain=subDomains.begin();
1162 std::vector<MatrixInitializer> initializers(subDomains.size());
1164 SolverIterator solver=solvers.begin();
1165 for(InitializerIterator initializer=initializers.begin(); initializer!=initializers.end();
1166 ++initializer, ++solver, ++domain) {
1170 *initializer=MatrixInitializer(solver->getInternalMatrix());
1175 RowToDomain, SubDomains> Initializer;
1177 Initializer initializer(initializers, rowToDomain, subDomains);
1178 copyToBCCSMatrix(initializer,
mat);
1181 for(
auto&& s: solvers)
1183 for (SolverIterator solverIt = solvers.begin(); solverIt != solvers.end(); ++solverIt)
1185 assert(solverIt->getInternalMatrix().N() == solverIt->getInternalMatrix().M());
1186 maxlength = std::max(maxlength, solverIt->getInternalMatrix().N());
1194 template<
class M,
class X,
class Y>
1195 template<
class RowToDomain,
class Solvers,
class SubDomains>
1199 const SubDomains& subDomains,
1202 typedef typename SubDomains::const_iterator DomainIterator;
1203 typedef typename Solvers::iterator SolverIterator;
1204 std::size_t maxlength = 0;
1207 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1208 maxlength=std::max(maxlength, domain->size());
1211 SolverIterator solver=solvers.begin();
1212 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end();
1213 ++domain, ++solver) {
1214 solver->setSubMatrix(
mat, *domain);
1215 maxlength=std::max(maxlength, domain->size());
1224 template<
class M,
class X,
class TM,
class TD,
class TA>
1230 template<
class M,
class X,
class TM,
class TD,
class TA>
1231 template<
bool forward>
1234 typedef slu_vector solver_vector;
1247 Adder adder(v, x, assigner, relax);
1251 std::for_each(domain->begin(), domain->end(), assigner);
1252 assigner.resetIndexForNextDomain();
1256 sdsolver.setSubMatrix(
mat, *domain);
1258 sdsolver.apply(assigner.lhs(), assigner.rhs());
1260 solver->apply(assigner.lhs(), assigner.rhs());
1265 std::for_each(domain->begin(), domain->end(), adder);
1266 assigner.resetIndexForNextDomain();
1271 assigner.deallocate();
1274 template<
class K,
class Al,
class X,
class Y>
1275 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< K, Al>, X, Y >,
false>
1277 const X& b_, Y& x_) :
1279 rhs_( new DynamicVector<
field_type>(maxlength, 42) ),
1280 lhs_( new DynamicVector<
field_type>(maxlength, -42) ),
1284 maxlength_(maxlength)
1287 template<
class K,
class Al,
class X,
class Y>
1296 template<
class K,
class Al,
class X,
class Y>
1299 ::resetIndexForNextDomain()
1304 template<
class K,
class Al,
class X,
class Y>
1305 DynamicVector<typename X::field_type> &
1312 template<
class K,
class Al,
class X,
class Y>
1313 DynamicVector<typename X::field_type> &
1320 template<
class K,
class Al,
class X,
class Y>
1328 template<
class K,
class Al,
class X,
class Y>
1337 assert(i<maxlength_);
1338 rhs()[i]=(*b)[domainIndex][j];
1345 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1347 (*col).mv((*x)[
col.index()], tmp);
1350 assert(i<maxlength_);
1357 assert(i<maxlength_);
1358 rhs()[i]=Impl::asVector((*b)[domainIndex])[j];
1364 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1366 rhs()[i]-=Impl::asMatrix(*
col)[j][k] * Impl::asVector((*x)[
col.index()])[k];
1373 template<
class K,
class Al,
class X,
class Y>
1380 assert(i<maxlength_);
1381 Impl::asVector(res)[j]+=lhs()[i];
1385#if HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
1387 template<
template<
class>
class S,
typename T,
typename A>
1389 ::OverlappingAssignerHelper(std::size_t maxlength,
1395 x(&x_), i(0), maxlength_(maxlength)
1402 template<
template<
class>
class S,
typename T,
typename A>
1409 template<
template<
class>
class S,
typename T,
typename A>
1416 assert(i<maxlength_);
1417 rhs_[i]=Impl::asVector((*b)[domainIndex])[j];
1425 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1427 Impl::asMatrix(*col).mv((*x)[
col.index()], tmp);
1430 assert(i<maxlength_);
1431 rhs_[i]-=Impl::asVector(tmp)[j];
1438 template<
template<
class>
class S,
typename T,
typename A>
1442 assert(i<maxlength_);
1448 template<
template<
class>
class S,
typename T,
typename A>
1453 assert(i<maxlength_);
1454 Impl::asVector(res)[j]+=lhs_[i];
1458 template<
template<
class>
class S,
typename T,
typename A>
1464 template<
template<
class>
class S,
typename T,
typename A>
1471 template<
template<
class>
class S,
typename T,
typename A>
1480 template<
class M,
class X,
class Y>
1489 rhs_=
new Y(maxlength);
1490 lhs_ =
new X(maxlength);
1493 template<
class M,
class X,
class Y>
1500 template<
class M,
class X,
class Y>
1503 (*rhs_)[i]=(*b)[domainIndex];
1506 typedef typename matrix_type::ConstColIterator col_iterator;
1509 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1510 Impl::asMatrix(*col).mmv((*x)[
col.index()], (*rhs_)[i]);
1516 template<
class M,
class X,
class Y>
1522 template<
class M,
class X,
class Y>
1528 template<
class M,
class X,
class Y>
1534 template<
class M,
class X,
class Y>
1540 template<
class M,
class X,
class Y>
1546 template<
typename S,
typename T,
typename A>
1551 : v(&v_), x(&x_), assigner(&assigner_), relax(relax_)
1554 template<
typename S,
typename T,
typename A>
1558 assigner->assignResult((*v)[domainIndex]);
1562 template<
typename S,
typename T,
typename A>
1570 template<
typename S,
typename T,
typename A>
1575 : x(&x_), assigner(&assigner_), relax(relax_)
1579 template<
typename S,
typename T,
typename A>
1583 assigner->relaxResult(relax);
1584 assigner->assignResult((*x)[domainIndex]);
1588 template<
typename S,
typename T,
typename A>
Implementation of the BCRSMatrix class.
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Various local subdomain solvers based on ILU for SeqOverlappingSchwarz.
Define general preconditioner interface.
Templates characterizing the type of a solver.
Classes for using SuperLU with ISTL matrices.
Classes for using UMFPack with ISTL matrices.
Col col
Definition: matrixmatrix.hh:349
Matrix & mat
Definition: matrixmatrix.hh:345
void addRowNnz(const Iter &row)
Definition: overlappingschwarz.hh:893
X & lhs()
Get the local left hand side.
Definition: overlappingschwarz.hh:1529
void calcColstart() const
Definition: overlappingschwarz.hh:924
Y & rhs()
Get the local right hand side.
Definition: overlappingschwarz.hh:1535
iterator end()
Definition: overlappingschwarz.hh:987
void resetIndexForNextDomain()
Resets the local index to zero.
Definition: overlappingschwarz.hh:1541
void copyValue(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:931
void createMatrix() const
Definition: overlappingschwarz.hh:945
iterator begin()
Definition: overlappingschwarz.hh:1001
OverlappingSchwarzInitializer(InitializerList &il, const IndexSet &indices, const subdomain_vector &domains)
Definition: overlappingschwarz.hh:885
IndexMap()
Definition: overlappingschwarz.hh:953
virtual void apply(X &v, const X &d)
Apply the precondtioner.
Definition: overlappingschwarz.hh:1225
OverlappingAssignerILUBase(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:1481
const_iterator find(size_type grow) const
Definition: overlappingschwarz.hh:966
void operator()(const size_type &domain)
calculate one entry of the local defect.
Definition: overlappingschwarz.hh:1501
SeqOverlappingSchwarz(const matrix_type &mat, const subdomain_vector &subDomains, field_type relaxationFactor=1, bool onTheFly_=true)
Construct the overlapping Schwarz method.
Definition: overlappingschwarz.hh:1054
void allocate()
Definition: overlappingschwarz.hh:903
void deallocate()
Deallocates memory of the local vector.
Definition: overlappingschwarz.hh:1494
void insert(size_type grow)
Definition: overlappingschwarz.hh:958
void countEntries(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:912
static std::size_t assembleLocalProblems(const RowToDomain &rowToDomain, const matrix_type &mat, Solvers &solvers, const SubDomains &domains, bool onTheFly)
Definition: overlappingschwarz.hh:1196
void relaxResult(field_type relax)
relax the result.
Definition: overlappingschwarz.hh:1517
void assignResult(block_type &res)
Assigns the block to the current local index. At the same time the local defect is calculated for the...
Definition: overlappingschwarz.hh:1523
SeqOverlappingSchwarz(const matrix_type &mat, const rowtodomain_vector &rowToDomain, field_type relaxationFactor=1, bool onTheFly_=true)
Definition: overlappingschwarz.hh:1007
Definition: allocator.hh:9
Initializer for SuperLU Matrices representing the subdomains.
Definition: overlappingschwarz.hh:45
Matrix::row_type::const_iterator CIter
Definition: overlappingschwarz.hh:54
S IndexSet
Definition: overlappingschwarz.hh:56
Matrix::const_iterator Iter
Definition: overlappingschwarz.hh:53
IndexSet::size_type size_type
Definition: overlappingschwarz.hh:57
I InitializerList
Definition: overlappingschwarz.hh:50
AtomInitializer::Matrix Matrix
Definition: overlappingschwarz.hh:52
InitializerList::value_type AtomInitializer
Definition: overlappingschwarz.hh:51
D subdomain_vector
The vector type containing the subdomain to row index mapping.
Definition: overlappingschwarz.hh:48
A sparse block matrix with compressed row storage.
Definition: bcrsmatrix.hh:464
A::size_type size_type
The type for the index access and the size.
Definition: bcrsmatrix.hh:498
row_type::ConstIterator ConstColIterator
Const iterator to the entries of a row.
Definition: bcrsmatrix.hh:739
A vector of blocks with memory management.
Definition: bvector.hh:393
Exact subdomain solver using ILU(p) with appropriate p.
Definition: ilusubdomainsolver.hh:76
Definition: ilusubdomainsolver.hh:109
Sequential overlapping Schwarz preconditioner.
Definition: overlappingschwarz.hh:753
X::field_type field_type
The field type of the preconditioner.
Definition: overlappingschwarz.hh:781
void apply(X &v, const X &d)
Apply one step of the preconditioner to the system A(v)=d.
SLList< size_type, typename std::allocator_traits< TA >::template rebind_alloc< size_type > > subdomain_list
The type for the row to subdomain mapping.
Definition: overlappingschwarz.hh:798
std::vector< slu, typename std::allocator_traits< TA >::template rebind_alloc< slu > > slu_vector
The vector type containing subdomain solvers.
Definition: overlappingschwarz.hh:807
M matrix_type
The type of the matrix to precondition.
Definition: overlappingschwarz.hh:758
TM Mode
The mode (additive or multiplicative) of the Schwarz method.
Definition: overlappingschwarz.hh:776
X range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:768
std::set< size_type, std::less< size_type >, typename std::allocator_traits< TA >::template rebind_alloc< size_type > > subdomain_type
The type for the subdomain to row index mapping.
Definition: overlappingschwarz.hh:792
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:763
TD slu
The type for the subdomain solver in use.
Definition: overlappingschwarz.hh:804
virtual SolverCategory::Category category() const
Category of the preconditioner (see SolverCategory::Category)
Definition: overlappingschwarz.hh:866
virtual void pre(X &x, X &b)
Prepare the preconditioner.
Definition: overlappingschwarz.hh:844
virtual void post(X &x)
Postprocess the preconditioner.
Definition: overlappingschwarz.hh:859
TA allocator
The allocator to use.
Definition: overlappingschwarz.hh:787
std::vector< subdomain_type, typename std::allocator_traits< TA >::template rebind_alloc< subdomain_type > > subdomain_vector
The vector type containing the subdomain to row index mapping.
Definition: overlappingschwarz.hh:795
std::vector< subdomain_list, typename std::allocator_traits< TA >::template rebind_alloc< subdomain_list > > rowtodomain_vector
The vector type containing the row index to subdomain mapping.
Definition: overlappingschwarz.hh:801
matrix_type::size_type size_type
The return type of the size method.
Definition: overlappingschwarz.hh:784
Definition: overlappingschwarz.hh:692
Tag that the tells the Schwarz method to be additive.
Definition: overlappingschwarz.hh:118
Tag that tells the Schwarz method to be multiplicative.
Definition: overlappingschwarz.hh:124
Tag that tells the Schwarz method to be multiplicative and symmetric.
Definition: overlappingschwarz.hh:131
Exact subdomain solver using Dune::DynamicMatrix<T>::solve.
Definition: overlappingschwarz.hh:138
std::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition: overlappingschwarz.hh:147
X::field_type field_type
Definition: overlappingschwarz.hh:148
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:151
Y range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:153
void setSubMatrix(const M &BCRS, S &rowset)
Set the data of the local problem.
Definition: overlappingschwarz.hh:182
void apply(DynamicVector< field_type > &v, DynamicVector< field_type > &d)
Apply the subdomain solver.
Definition: overlappingschwarz.hh:160
std::remove_const< M >::type rilu_type
Definition: overlappingschwarz.hh:149
Definition: overlappingschwarz.hh:213
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:227
X::field_type field_type
Definition: overlappingschwarz.hh:224
BCRSMatrix< K, Al > matrix_type
Definition: overlappingschwarz.hh:223
Y range_type
Definition: overlappingschwarz.hh:225
range_type::block_type block_type
Definition: overlappingschwarz.hh:226
S< BCRSMatrix< T, A > >::range_type range_type
Definition: overlappingschwarz.hh:313
range_type::block_type block_type
Definition: overlappingschwarz.hh:315
range_type::field_type field_type
Definition: overlappingschwarz.hh:314
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:317
BCRSMatrix< T, A > matrix_type
Definition: overlappingschwarz.hh:312
Definition: overlappingschwarz.hh:398
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:406
Y::field_type field_type
Definition: overlappingschwarz.hh:402
Y::block_type block_type
Definition: overlappingschwarz.hh:404
M matrix_type
Definition: overlappingschwarz.hh:400
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:491
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:510
Definition: overlappingschwarz.hh:518
std::decay_t< decltype(Impl::asVector(std::declval< T >()))>::field_type field_type
Definition: overlappingschwarz.hh:524
A::size_type size_type
Definition: overlappingschwarz.hh:523
Definition: overlappingschwarz.hh:540
A::size_type size_type
Definition: overlappingschwarz.hh:545
std::decay_t< decltype(Impl::asVector(std::declval< T >()))>::field_type field_type
Definition: overlappingschwarz.hh:546
template meta program for choosing how to add the correction.
Definition: overlappingschwarz.hh:570
AdditiveAdder< S, X > Adder
Definition: overlappingschwarz.hh:575
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:581
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:587
Helper template meta program for application of overlapping Schwarz.
Definition: overlappingschwarz.hh:603
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:609
solver_vector::iterator solver_iterator
Definition: overlappingschwarz.hh:605
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:623
subdomain_vector::const_iterator domain_iterator
Definition: overlappingschwarz.hh:607
T1 solver_vector
Definition: overlappingschwarz.hh:604
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:618
T2 subdomain_vector
Definition: overlappingschwarz.hh:606
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:614
T2 subdomain_vector
Definition: overlappingschwarz.hh:634
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:642
solver_vector::reverse_iterator solver_iterator
Definition: overlappingschwarz.hh:633
subdomain_vector::const_reverse_iterator domain_iterator
Definition: overlappingschwarz.hh:635
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:637
T1 solver_vector
Definition: overlappingschwarz.hh:632
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:646
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:651
Helper template meta program for application of overlapping Schwarz.
Definition: overlappingschwarz.hh:667
smoother::range_type range_type
Definition: overlappingschwarz.hh:669
T smoother
Definition: overlappingschwarz.hh:668
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:671
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:683
SeqOverlappingSchwarz< M, X, SymmetricMultiplicativeSchwarzMode, TD, TA > smoother
Definition: overlappingschwarz.hh:680
smoother::range_type range_type
Definition: overlappingschwarz.hh:681
BCRSMatrix< K, Al > matrix_type
Definition: overlappingschwarz.hh:700
BCRSMatrix< T, A > matrix_type
Definition: overlappingschwarz.hh:711
Definition: overlappingschwarz.hh:721
M matrix_type
Definition: overlappingschwarz.hh:722
Definition: overlappingschwarz.hh:1101
static int size(const Domain &d)
Definition: overlappingschwarz.hh:1109
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:30
Category
Definition: solvercategory.hh:21
@ sequential
Category for sequential solvers.
Definition: solvercategory.hh:23