3 #ifndef DUNE_ISTL_OVERLAPPINGSCHWARZ_HH
4 #define DUNE_ISTL_OVERLAPPINGSCHWARZ_HH
11 #include <dune/common/dynmatrix.hh>
12 #include <dune/common/sllist.hh>
13 #include <dune/common/unused.hh>
36 template<
class M,
class X,
class TM,
class TD,
class TA>
37 class SeqOverlappingSchwarz;
42 template<
class I,
class S,
class D>
51 typedef typename AtomInitializer::Matrix
Matrix;
52 typedef typename Matrix::const_iterator
Iter;
53 typedef typename Matrix::row_type::const_iterator
CIter;
79 typedef std::map<size_type,size_type> Map;
80 typedef typename Map::iterator iterator;
81 typedef typename Map::const_iterator const_iterator;
87 const_iterator find(
size_type grow)
const;
93 const_iterator begin()
const;
97 const_iterator end()
const;
100 std::map<size_type,size_type> map_;
105 typedef typename InitializerList::iterator InitIterator;
106 typedef typename IndexSet::const_iterator IndexIteratur;
109 mutable std::vector<IndexMap> indexMaps;
136 template<
class M,
class X,
class Y>
140 template<
class K,
class Al,
class X,
class Y>
153 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<K>()))>::rows;
159 void apply (DynamicVector<field_type>& v, DynamicVector<field_type>& d)
161 assert(v.size() > 0);
162 assert(v.size() == d.size());
163 assert(A.rows() <= v.size());
164 assert(A.cols() <= v.size());
165 size_t sz = A.rows();
169 v.resize(v.capacity());
170 d.resize(d.capacity());
183 size_t sz = rowset.size();
185 typedef typename S::const_iterator SIter;
187 for(SIter rowIdx = rowset.begin(), rowEnd=rowset.end();
188 rowIdx!= rowEnd; ++rowIdx, r++)
191 for(SIter colIdx = rowset.begin(), colEnd=rowset.end();
192 colIdx!= colEnd; ++colIdx, c++)
194 if (BCRS[*rowIdx].find(*colIdx) == BCRS[*rowIdx].end())
196 for (
size_t i=0; i<n; i++)
198 for (
size_t j=0; j<n; j++)
200 A[r*n+i][c*n+j] = Impl::asMatrix(BCRS[*rowIdx][*colIdx])[i][j];
210 template<
typename T,
bool tag>
218 template<
class K,
class Al,
class X,
class Y>
227 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<K>()))>::rows;
247 void resetIndexForNextDomain();
254 DynamicVector<field_type> & lhs();
261 DynamicVector<field_type> & rhs();
274 void operator()(
const size_type& domainIndex);
293 DynamicVector<field_type> * rhs_;
296 DynamicVector<field_type> * lhs_;
304 std::size_t maxlength_;
307 #if HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
308 template<
template<
class>
class S,
typename T,
typename A>
318 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::rows;
319 static constexpr
size_t m = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::cols;
339 void resetIndexForNextDomain();
363 void operator()(
const size_type& domain);
390 std::size_t maxlength_;
395 template<
class M,
class X,
class Y>
478 template<
class M,
class X,
class Y>
497 template<
class M,
class X,
class Y>
515 template<
typename S,
typename T>
519 template<
typename S,
typename T,
typename A>
526 void operator()(
const size_type& domain);
528 static constexpr
size_t n = std::decay_t<decltype(Impl::asVector(std::declval<T>()))>::dimension;
537 template<
typename S,
typename T>
541 template<
typename S,
typename T,
typename A>
548 void operator()(
const size_type& domain);
550 static constexpr
size_t n = std::decay_t<decltype(Impl::asVector(std::declval<T>()))>::dimension;
567 template<
typename T,
class X,
class S>
571 template<
class X,
class S>
577 template<
class X,
class S>
583 template<
class X,
class S>
600 template<
typename T1,
typename T2,
bool forward>
628 template<
typename T1,
typename T2>
672 sm.template apply<true>(v, b);
676 template<
class M,
class X,
class TD,
class TA>
684 sm.template apply<true>(v, b);
685 sm.template apply<false>(v, b);
689 template<
class T,
bool tag>
696 template<
class K,
class Al,
class X,
class Y>
700 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<K>()))>::rows;
701 template<
class RowToDomain,
class Solvers,
class SubDomains>
702 static std::size_t assembleLocalProblems(
const RowToDomain& rowToDomain,
const matrix_type&
mat,
703 Solvers& solvers,
const SubDomains& domains,
707 template<
template<
class>
class S,
typename T,
typename A>
711 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::rows;
712 template<
class RowToDomain,
class Solvers,
class SubDomains>
713 static std::size_t assembleLocalProblems(
const RowToDomain& rowToDomain,
const matrix_type&
mat,
714 Solvers& solvers,
const SubDomains& domains,
718 template<
class M,
class X,
class Y>
722 template<
class RowToDomain,
class Solvers,
class SubDomains>
724 Solvers& solvers,
const SubDomains& domains,
728 template<
class M,
class X,
class Y>
733 template<
class M,
class X,
class Y>
789 typedef std::set<size_type, std::less<size_type>,
790 typename std::allocator_traits<TA>::template rebind_alloc<size_type> >
794 typedef std::vector<subdomain_type, typename std::allocator_traits<TA>::template rebind_alloc<subdomain_type> >
subdomain_vector;
797 typedef SLList<size_type, typename std::allocator_traits<TA>::template rebind_alloc<size_type> >
subdomain_list;
800 typedef std::vector<subdomain_list, typename std::allocator_traits<TA>::template rebind_alloc<subdomain_list> >
rowtodomain_vector;
806 typedef std::vector<slu, typename std::allocator_traits<TA>::template rebind_alloc<slu> >
slu_vector;
822 field_type relaxationFactor=1,
bool onTheFly_=
true);
836 field_type relaxationFactor=1,
bool onTheFly_=
true);
843 virtual void pre (X& x, X& b)
845 DUNE_UNUSED_PARAMETER(x);
846 DUNE_UNUSED_PARAMETER(b);
854 virtual void apply (X& v,
const X& d);
863 DUNE_UNUSED_PARAMETER(x);
866 template<
bool forward>
881 typename M::size_type maxlength;
888 template<
class I,
class S,
class D>
892 : initializers(&il), indices(&idx), indexMaps(il.size()), domains(domains_)
896 template<
class I,
class S,
class D>
899 typedef typename IndexSet::value_type::const_iterator iterator;
900 for(iterator domain=(*indices)[row.index()].begin(); domain != (*indices)[row.index()].end(); ++domain) {
901 (*initializers)[*domain].addRowNnz(row, domains[*domain]);
902 indexMaps[*domain].insert(row.index());
906 template<
class I,
class S,
class D>
909 for(
auto&& i: *initializers)
910 i.allocateMatrixStorage();
911 for(
auto&& i: *initializers)
915 template<
class I,
class S,
class D>
918 typedef typename IndexSet::value_type::const_iterator iterator;
919 for(iterator domain=(*indices)[row.index()].begin(); domain != (*indices)[row.index()].end(); ++domain) {
920 typename std::map<size_type,size_type>::const_iterator v = indexMaps[*domain].find(
col.index());
921 if(v!= indexMaps[*domain].end()) {
922 (*initializers)[*domain].countEntries(indexMaps[*domain].find(
col.index())->second);
927 template<
class I,
class S,
class D>
930 for(
auto&& i : *initializers)
934 template<
class I,
class S,
class D>
937 typedef typename IndexSet::value_type::const_iterator iterator;
938 for(iterator domain=(*indices)[row.index()].begin(); domain!= (*indices)[row.index()].end(); ++domain) {
939 typename std::map<size_type,size_type>::const_iterator v = indexMaps[*domain].find(
col.index());
940 if(v!= indexMaps[*domain].end()) {
941 assert(indexMaps[*domain].end()!=indexMaps[*domain].find(row.index()));
942 (*initializers)[*domain].copyValue(
col, indexMaps[*domain].find(row.index())->second,
948 template<
class I,
class S,
class D>
951 std::vector<IndexMap>().swap(indexMaps);
952 for(
auto&& i: *initializers)
956 template<
class I,
class S,
class D>
961 template<
class I,
class S,
class D>
964 assert(map_.find(grow)==map_.end());
965 map_.insert(std::make_pair(grow, row++));
968 template<
class I,
class S,
class D>
969 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::const_iterator
972 return map_.find(grow);
975 template<
class I,
class S,
class D>
976 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::iterator
979 return map_.find(grow);
982 template<
class I,
class S,
class D>
983 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::const_iterator
989 template<
class I,
class S,
class D>
990 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::iterator
996 template<
class I,
class S,
class D>
997 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::const_iterator
1000 return map_.begin();
1003 template<
class I,
class S,
class D>
1004 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::iterator
1007 return map_.begin();
1010 template<
class M,
class X,
class TM,
class TD,
class TA>
1013 :
mat(mat_), relax(relaxationFactor), onTheFly(fly)
1015 typedef typename rowtodomain_vector::const_iterator RowDomainIterator;
1016 typedef typename subdomain_list::const_iterator DomainIterator;
1017 #ifdef DUNE_ISTL_WITH_CHECKING
1018 assert(rowToDomain.size()==mat.N());
1019 assert(rowToDomain.size()==mat.M());
1021 for(RowDomainIterator iter=rowToDomain.begin(); iter != rowToDomain.end(); ++iter)
1022 assert(iter->size()>0);
1027 for(RowDomainIterator iter=rowToDomain.begin(); iter != rowToDomain.end(); ++iter)
1028 for(DomainIterator d=iter->begin(); d != iter->end(); ++d)
1029 domains=std::max(domains, *d);
1032 solvers.resize(domains);
1033 subDomains.resize(domains);
1037 for(RowDomainIterator iter=rowToDomain.begin(); iter != rowToDomain.end(); ++iter, ++row)
1038 for(DomainIterator d=iter->begin(); d != iter->end(); ++d)
1039 subDomains[*d].insert(row);
1041 #ifdef DUNE_ISTL_WITH_CHECKING
1043 typedef typename subdomain_vector::const_iterator iterator;
1044 for(iterator iter=subDomains.begin(); iter != subDomains.end(); ++iter) {
1045 typedef typename subdomain_type::const_iterator entry_iterator;
1046 Dune::dvverb<<
"domain "<<i++<<
":";
1047 for(entry_iterator entry = iter->begin(); entry != iter->end(); ++entry) {
1048 Dune::dvverb<<
" "<<*entry;
1050 Dune::dvverb<<std::endl;
1057 template<
class M,
class X,
class TM,
class TD,
class TA>
1062 :
mat(mat_), solvers(sd.size()), subDomains(sd), relax(relaxationFactor),
1065 typedef typename subdomain_vector::const_iterator DomainIterator;
1067 #ifdef DUNE_ISTL_WITH_CHECKING
1070 for(DomainIterator d=sd.begin(); d != sd.end(); ++d,++i) {
1072 assert(d->size()>0);
1073 typedef typename DomainIterator::value_type::const_iterator entry_iterator;
1074 Dune::dvverb<<
"domain "<<i<<
":";
1075 for(entry_iterator entry = d->begin(); entry != d->end(); ++entry) {
1076 Dune::dvverb<<
" "<<*entry;
1078 Dune::dvverb<<std::endl;
1088 for(DomainIterator domain=sd.begin(); domain != sd.end(); ++domain, ++domainId) {
1089 typedef typename subdomain_type::const_iterator iterator;
1090 for(iterator row=domain->begin(); row != domain->end(); ++row)
1091 rowToDomain[*row].push_back(domainId);
1107 template<
typename T,
typename A>
1110 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::rows;
1111 static constexpr
size_t m = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::cols;
1112 template<
class Domain>
1120 template<
class K,
class Al,
class X,
class Y>
1121 template<
class RowToDomain,
class Solvers,
class SubDomains>
1124 assembleLocalProblems(
const RowToDomain& rowToDomain,
1127 const SubDomains& subDomains,
1130 DUNE_UNUSED_PARAMETER(onTheFly);
1131 DUNE_UNUSED_PARAMETER(rowToDomain);
1132 DUNE_UNUSED_PARAMETER(
mat);
1133 DUNE_UNUSED_PARAMETER(solvers);
1134 typedef typename SubDomains::const_iterator DomainIterator;
1135 std::size_t maxlength = 0;
1139 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1140 maxlength=std::max(maxlength, domain->size());
1146 #if HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
1147 template<
template<
class>
class S,
typename T,
typename A>
1148 template<
class RowToDomain,
class Solvers,
class SubDomains>
1152 const SubDomains& subDomains,
1155 typedef typename S<BCRSMatrix<T,A>>::MatrixInitializer MatrixInitializer;
1156 typedef typename std::vector<MatrixInitializer>::iterator InitializerIterator;
1157 typedef typename SubDomains::const_iterator DomainIterator;
1158 typedef typename Solvers::iterator SolverIterator;
1159 std::size_t maxlength = 0;
1162 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1163 maxlength=std::max(maxlength, domain->size());
1164 maxlength*=Impl::asMatrix(*
mat[0].begin()).N();
1167 DomainIterator domain=subDomains.begin();
1170 std::vector<MatrixInitializer> initializers(subDomains.size());
1172 SolverIterator solver=solvers.begin();
1173 for(InitializerIterator initializer=initializers.begin(); initializer!=initializers.end();
1174 ++initializer, ++solver, ++domain) {
1178 *initializer=MatrixInitializer(solver->getInternalMatrix());
1183 RowToDomain, SubDomains> Initializer;
1185 Initializer initializer(initializers, rowToDomain, subDomains);
1189 for(
auto&& s: solvers)
1191 for (SolverIterator solverIt = solvers.begin(); solverIt != solvers.end(); ++solverIt)
1193 assert(solverIt->getInternalMatrix().N() == solverIt->getInternalMatrix().M());
1194 maxlength = std::max(maxlength, solverIt->getInternalMatrix().N());
1202 template<
class M,
class X,
class Y>
1203 template<
class RowToDomain,
class Solvers,
class SubDomains>
1207 const SubDomains& subDomains,
1210 DUNE_UNUSED_PARAMETER(rowToDomain);
1211 typedef typename SubDomains::const_iterator DomainIterator;
1212 typedef typename Solvers::iterator SolverIterator;
1213 std::size_t maxlength = 0;
1216 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1217 maxlength=std::max(maxlength, domain->size());
1220 SolverIterator solver=solvers.begin();
1221 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end();
1222 ++domain, ++solver) {
1223 solver->setSubMatrix(
mat, *domain);
1224 maxlength=std::max(maxlength, domain->size());
1233 template<
class M,
class X,
class TM,
class TD,
class TA>
1239 template<
class M,
class X,
class TM,
class TD,
class TA>
1240 template<
bool forward>
1243 typedef slu_vector solver_vector;
1256 Adder adder(v, x, assigner, relax);
1260 std::for_each(domain->begin(), domain->end(), assigner);
1261 assigner.resetIndexForNextDomain();
1265 sdsolver.setSubMatrix(
mat, *domain);
1267 sdsolver.apply(assigner.lhs(), assigner.rhs());
1269 solver->apply(assigner.lhs(), assigner.rhs());
1274 std::for_each(domain->begin(), domain->end(), adder);
1275 assigner.resetIndexForNextDomain();
1280 assigner.deallocate();
1283 template<
class K,
class Al,
class X,
class Y>
1284 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< K, Al>, X, Y >,
false>
1286 const X& b_, Y& x_) :
1288 rhs_( new DynamicVector<
field_type>(maxlength, 42) ),
1289 lhs_( new DynamicVector<
field_type>(maxlength, -42) ),
1293 maxlength_(maxlength)
1296 template<
class K,
class Al,
class X,
class Y>
1305 template<
class K,
class Al,
class X,
class Y>
1308 ::resetIndexForNextDomain()
1313 template<
class K,
class Al,
class X,
class Y>
1314 DynamicVector<typename X::field_type> &
1321 template<
class K,
class Al,
class X,
class Y>
1322 DynamicVector<typename X::field_type> &
1329 template<
class K,
class Al,
class X,
class Y>
1337 template<
class K,
class Al,
class X,
class Y>
1346 assert(i<maxlength_);
1347 rhs()[i]=(*b)[domainIndex][j];
1354 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1356 (*col).mv((*x)[
col.index()], tmp);
1359 assert(i<maxlength_);
1366 assert(i<maxlength_);
1367 rhs()[i]=Impl::asVector((*b)[domainIndex])[j];
1373 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1375 rhs()[i]-=Impl::asMatrix(*
col)[j][k] * Impl::asVector((*x)[
col.index()])[k];
1382 template<
class K,
class Al,
class X,
class Y>
1389 assert(i<maxlength_);
1390 Impl::asVector(res)[j]+=lhs()[i];
1394 #if HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
1396 template<
template<
class>
class S,
typename T,
typename A>
1404 x(&x_), i(0), maxlength_(maxlength)
1411 template<
template<
class>
class S,
typename T,
typename A>
1418 template<
template<
class>
class S,
typename T,
typename A>
1425 assert(i<maxlength_);
1426 rhs_[i]=Impl::asVector((*b)[domainIndex])[j];
1434 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1436 Impl::asMatrix(*col).mv((*x)[
col.index()], tmp);
1439 assert(i<maxlength_);
1440 rhs_[i]-=Impl::asVector(tmp)[j];
1447 template<
template<
class>
class S,
typename T,
typename A>
1451 assert(i<maxlength_);
1457 template<
template<
class>
class S,
typename T,
typename A>
1462 assert(i<maxlength_);
1463 Impl::asVector(res)[j]+=lhs_[i];
1467 template<
template<
class>
class S,
typename T,
typename A>
1473 template<
template<
class>
class S,
typename T,
typename A>
1480 template<
template<
class>
class S,
typename T,
typename A>
1489 template<
class M,
class X,
class Y>
1498 rhs_=
new Y(maxlength);
1499 lhs_ =
new X(maxlength);
1502 template<
class M,
class X,
class Y>
1509 template<
class M,
class X,
class Y>
1512 (*rhs_)[i]=(*b)[domainIndex];
1515 typedef typename matrix_type::ConstColIterator col_iterator;
1518 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1519 Impl::asMatrix(*col).mmv((*x)[
col.index()], (*rhs_)[i]);
1525 template<
class M,
class X,
class Y>
1531 template<
class M,
class X,
class Y>
1537 template<
class M,
class X,
class Y>
1543 template<
class M,
class X,
class Y>
1549 template<
class M,
class X,
class Y>
1555 template<
typename S,
typename T,
typename A>
1560 : v(&v_), x(&x_), assigner(&assigner_), relax(relax_)
1563 template<
typename S,
typename T,
typename A>
1567 assigner->assignResult((*v)[domainIndex]);
1571 template<
typename S,
typename T,
typename A>
1579 template<
typename S,
typename T,
typename A>
1584 : x(&x_), assigner(&assigner_), relax(relax_)
1586 DUNE_UNUSED_PARAMETER(v_);
1590 template<
typename S,
typename T,
typename A>
1594 assigner->relaxResult(relax);
1595 assigner->assignResult((*x)[domainIndex]);
1599 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:897
X & lhs()
Get the local left hand side.
Definition: overlappingschwarz.hh:1538
void calcColstart() const
Definition: overlappingschwarz.hh:928
Y & rhs()
Get the local right hand side.
Definition: overlappingschwarz.hh:1544
void resetIndexForNextDomain()
Resets the local index to zero.
Definition: overlappingschwarz.hh:1550
void copyValue(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:935
void createMatrix() const
Definition: overlappingschwarz.hh:949
OverlappingSchwarzInitializer(InitializerList &il, const IndexSet &indices, const subdomain_vector &domains)
Definition: overlappingschwarz.hh:889
virtual void apply(X &v, const X &d)
Apply the precondtioner.
Definition: overlappingschwarz.hh:1234
OverlappingAssignerILUBase(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:1490
void operator()(const size_type &domain)
calculate one entry of the local defect.
Definition: overlappingschwarz.hh:1510
SeqOverlappingSchwarz(const matrix_type &mat, const subdomain_vector &subDomains, field_type relaxationFactor=1, bool onTheFly_=true)
Construct the overlapping Schwarz method.
Definition: overlappingschwarz.hh:1058
void allocate()
Definition: overlappingschwarz.hh:907
void deallocate()
Deallocates memory of the local vector.
Definition: overlappingschwarz.hh:1503
void countEntries(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:916
static std::size_t assembleLocalProblems(const RowToDomain &rowToDomain, const matrix_type &mat, Solvers &solvers, const SubDomains &domains, bool onTheFly)
Definition: overlappingschwarz.hh:1204
void relaxResult(field_type relax)
relax the result.
Definition: overlappingschwarz.hh:1526
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:1532
SeqOverlappingSchwarz(const matrix_type &mat, const rowtodomain_vector &rowToDomain, field_type relaxationFactor=1, bool onTheFly_=true)
Definition: overlappingschwarz.hh:1011
Definition: allocator.hh:7
void copyToColCompMatrix(F &initializer, const MRS &mrs)
Definition: colcompmatrix.hh:473
A sparse block matrix with compressed row storage.
Definition: bcrsmatrix.hh:426
A::size_type size_type
The type for the index access and the size.
Definition: bcrsmatrix.hh:460
row_type::ConstIterator ConstColIterator
Const iterator to the entries of a row.
Definition: bcrsmatrix.hh:700
A vector of blocks with memory management.
Definition: bvector.hh:403
Sequential overlapping Schwarz preconditioner.
Definition: overlappingschwarz.hh:752
X::field_type field_type
The field type of the preconditioner.
Definition: overlappingschwarz.hh:780
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:797
std::vector< slu, typename std::allocator_traits< TA >::template rebind_alloc< slu > > slu_vector
The vector type containing subdomain solvers.
Definition: overlappingschwarz.hh:806
M matrix_type
The type of the matrix to precondition.
Definition: overlappingschwarz.hh:757
TM Mode
The mode (additive or multiplicative) of the Schwarz method.
Definition: overlappingschwarz.hh:775
X range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:767
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:791
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:762
TD slu
The type for the subdomain solver in use.
Definition: overlappingschwarz.hh:803
virtual SolverCategory::Category category() const
Category of the preconditioner (see SolverCategory::Category)
Definition: overlappingschwarz.hh:870
virtual void pre(X &x, X &b)
Prepare the preconditioner.
Definition: overlappingschwarz.hh:843
virtual void post(X &x)
Postprocess the preconditioner.
Definition: overlappingschwarz.hh:861
TA allocator
The allocator to use.
Definition: overlappingschwarz.hh:786
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:794
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:800
matrix_type::size_type size_type
The return type of the size method.
Definition: overlappingschwarz.hh:783
Definition: overlappingschwarz.hh:691
Exact subdomain solver using ILU(p) with appropriate p.
Definition: ilusubdomainsolver.hh:75
Definition: ilusubdomainsolver.hh:108
Initializer for SuperLU Matrices representing the subdomains.
Definition: overlappingschwarz.hh:44
Matrix::row_type::const_iterator CIter
Definition: overlappingschwarz.hh:53
S IndexSet
Definition: overlappingschwarz.hh:55
Matrix::const_iterator Iter
Definition: overlappingschwarz.hh:52
IndexSet::size_type size_type
Definition: overlappingschwarz.hh:56
I InitializerList
Definition: overlappingschwarz.hh:49
AtomInitializer::Matrix Matrix
Definition: overlappingschwarz.hh:51
InitializerList::value_type AtomInitializer
Definition: overlappingschwarz.hh:50
D subdomain_vector
The vector type containing the subdomain to row index mapping.
Definition: overlappingschwarz.hh:47
Tag that the tells the Schwarz method to be additive.
Definition: overlappingschwarz.hh:117
Tag that tells the Schwarz method to be multiplicative.
Definition: overlappingschwarz.hh:123
Tag that tells the Schwarz method to be multiplicative and symmetric.
Definition: overlappingschwarz.hh:130
Exact subdomain solver using Dune::DynamicMatrix<T>::solve.
Definition: overlappingschwarz.hh:137
std::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition: overlappingschwarz.hh:146
X::field_type field_type
Definition: overlappingschwarz.hh:147
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:150
Y range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:152
void setSubMatrix(const M &BCRS, S &rowset)
Set the data of the local problem.
Definition: overlappingschwarz.hh:181
void apply(DynamicVector< field_type > &v, DynamicVector< field_type > &d)
Apply the subdomain solver.
Definition: overlappingschwarz.hh:159
std::remove_const< M >::type rilu_type
Definition: overlappingschwarz.hh:148
Definition: overlappingschwarz.hh:212
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:226
X::field_type field_type
Definition: overlappingschwarz.hh:223
BCRSMatrix< K, Al > matrix_type
Definition: overlappingschwarz.hh:222
Y range_type
Definition: overlappingschwarz.hh:224
range_type::block_type block_type
Definition: overlappingschwarz.hh:225
S< BCRSMatrix< T, A > >::range_type range_type
Definition: overlappingschwarz.hh:312
range_type::block_type block_type
Definition: overlappingschwarz.hh:314
range_type::field_type field_type
Definition: overlappingschwarz.hh:313
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:316
BCRSMatrix< T, A > matrix_type
Definition: overlappingschwarz.hh:311
Definition: overlappingschwarz.hh:397
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:405
Y::field_type field_type
Definition: overlappingschwarz.hh:401
Y::block_type block_type
Definition: overlappingschwarz.hh:403
M matrix_type
Definition: overlappingschwarz.hh:399
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:490
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:509
Definition: overlappingschwarz.hh:517
std::decay_t< decltype(Impl::asVector(std::declval< T >)))>::field_type field_type
Definition: overlappingschwarz.hh:523
A::size_type size_type
Definition: overlappingschwarz.hh:522
Definition: overlappingschwarz.hh:539
std::decay_t< decltype(Impl::asVector(std::declval< T >)))>::field_type field_type
Definition: overlappingschwarz.hh:545
A::size_type size_type
Definition: overlappingschwarz.hh:544
template meta program for choosing how to add the correction.
Definition: overlappingschwarz.hh:569
AdditiveAdder< S, X > Adder
Definition: overlappingschwarz.hh:574
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:580
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:586
Helper template meta program for application of overlapping Schwarz.
Definition: overlappingschwarz.hh:602
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:608
solver_vector::iterator solver_iterator
Definition: overlappingschwarz.hh:604
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:622
subdomain_vector::const_iterator domain_iterator
Definition: overlappingschwarz.hh:606
T1 solver_vector
Definition: overlappingschwarz.hh:603
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:617
T2 subdomain_vector
Definition: overlappingschwarz.hh:605
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:613
T2 subdomain_vector
Definition: overlappingschwarz.hh:633
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:641
solver_vector::reverse_iterator solver_iterator
Definition: overlappingschwarz.hh:632
subdomain_vector::const_reverse_iterator domain_iterator
Definition: overlappingschwarz.hh:634
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:636
T1 solver_vector
Definition: overlappingschwarz.hh:631
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:645
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:650
Helper template meta program for application of overlapping Schwarz.
Definition: overlappingschwarz.hh:666
smoother::range_type range_type
Definition: overlappingschwarz.hh:668
T smoother
Definition: overlappingschwarz.hh:667
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:670
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:682
SeqOverlappingSchwarz< M, X, SymmetricMultiplicativeSchwarzMode, TD, TA > smoother
Definition: overlappingschwarz.hh:679
smoother::range_type range_type
Definition: overlappingschwarz.hh:680
BCRSMatrix< K, Al > matrix_type
Definition: overlappingschwarz.hh:699
BCRSMatrix< T, A > matrix_type
Definition: overlappingschwarz.hh:710
Definition: overlappingschwarz.hh:720
M matrix_type
Definition: overlappingschwarz.hh:721
Definition: overlappingschwarz.hh:1105
static int size(const Domain &d)
Definition: overlappingschwarz.hh:1113
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