Go to the documentation of this file.
3 #ifndef DUNE_ISTL_OVERLAPPINGSCHWARZ_HH
4 #define DUNE_ISTL_OVERLAPPINGSCHWARZ_HH
10 #include <dune/common/dynmatrix.hh>
11 #include <dune/common/sllist.hh>
12 #include <dune/common/unused.hh>
35 template<
class M,
class X,
class TM,
class TD,
class TA>
36 class SeqOverlappingSchwarz;
41 template<
class I,
class S,
class D>
50 typedef typename AtomInitializer::Matrix
Matrix;
51 typedef typename Matrix::const_iterator
Iter;
52 typedef typename Matrix::row_type::const_iterator
CIter;
78 typedef std::map<size_type,size_type> Map;
79 typedef typename Map::iterator iterator;
80 typedef typename Map::const_iterator const_iterator;
86 const_iterator find(
size_type grow)
const;
92 const_iterator begin()
const;
96 const_iterator end()
const;
99 std::map<size_type,size_type> map_;
104 typedef typename InitializerList::iterator InitIterator;
105 typedef typename IndexSet::const_iterator IndexIteratur;
108 mutable std::vector<IndexMap> indexMaps;
135 template<
class M,
class X,
class Y>
139 template<
class K,
class Al,
class X,
class Y>
152 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<K>()))>::rows;
158 void apply (DynamicVector<field_type>& v, DynamicVector<field_type>& d)
160 assert(v.size() > 0);
161 assert(v.size() == d.size());
162 assert(A.rows() <= v.size());
163 assert(A.cols() <= v.size());
164 size_t sz = A.rows();
168 v.resize(v.capacity());
169 d.resize(d.capacity());
182 size_t sz = rowset.size();
184 typedef typename S::const_iterator SIter;
186 for(SIter rowIdx = rowset.begin(), rowEnd=rowset.end();
187 rowIdx!= rowEnd; ++rowIdx, r++)
190 for(SIter colIdx = rowset.begin(), colEnd=rowset.end();
191 colIdx!= colEnd; ++colIdx, c++)
193 if (BCRS[*rowIdx].find(*colIdx) == BCRS[*rowIdx].end())
195 for (
size_t i=0; i<n; i++)
197 for (
size_t j=0; j<n; j++)
199 A[r*n+i][c*n+j] = Impl::asMatrix(BCRS[*rowIdx][*colIdx])[i][j];
209 template<
typename T,
bool tag>
217 template<
class K,
class Al,
class X,
class Y>
226 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<K>()))>::rows;
246 void resetIndexForNextDomain();
253 DynamicVector<field_type> & lhs();
260 DynamicVector<field_type> & rhs();
273 void operator()(
const size_type& domainIndex);
292 DynamicVector<field_type> * rhs_;
295 DynamicVector<field_type> * lhs_;
303 std::size_t maxlength_;
306 #if HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
307 template<
template<
class>
class S,
typename T,
typename A>
317 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::rows;
318 static constexpr
size_t m = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::cols;
338 void resetIndexForNextDomain();
362 void operator()(
const size_type& domain);
389 std::size_t maxlength_;
392 #endif // HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
394 template<
class M,
class X,
class Y>
477 template<
class M,
class X,
class Y>
496 template<
class M,
class X,
class Y>
514 template<
typename S,
typename T>
518 template<
typename S,
typename T,
typename A>
525 void operator()(
const size_type& domain);
527 static constexpr
size_t n = std::decay_t<decltype(Impl::asVector(std::declval<T>()))>::dimension;
536 template<
typename S,
typename T>
540 template<
typename S,
typename T,
typename A>
547 void operator()(
const size_type& domain);
549 static constexpr
size_t n = std::decay_t<decltype(Impl::asVector(std::declval<T>()))>::dimension;
566 template<
typename T,
class X,
class S>
570 template<
class X,
class S>
576 template<
class X,
class S>
582 template<
class X,
class S>
599 template<
typename T1,
typename T2,
bool forward>
627 template<
typename T1,
typename T2>
671 sm.template apply<true>(v, b);
675 template<
class M,
class X,
class TD,
class TA>
683 sm.template apply<true>(v, b);
684 sm.template apply<false>(v, b);
688 template<
class T,
bool tag>
689 struct SeqOverlappingSchwarzAssemblerHelper
695 template<
class K,
class Al,
class X,
class Y>
699 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<K>()))>::rows;
700 template<
class RowToDomain,
class Solvers,
class SubDomains>
701 static std::size_t assembleLocalProblems(
const RowToDomain& rowToDomain,
const matrix_type&
mat,
702 Solvers& solvers,
const SubDomains& domains,
706 template<
template<
class>
class S,
typename T,
typename A>
710 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::rows;
711 template<
class RowToDomain,
class Solvers,
class SubDomains>
712 static std::size_t assembleLocalProblems(
const RowToDomain& rowToDomain,
const matrix_type&
mat,
713 Solvers& solvers,
const SubDomains& domains,
717 template<
class M,
class X,
class Y>
721 template<
class RowToDomain,
class Solvers,
class SubDomains>
723 Solvers& solvers,
const SubDomains& domains,
727 template<
class M,
class X,
class Y>
732 template<
class M,
class X,
class Y>
788 typedef std::set<size_type, std::less<size_type>,
789 typename TA::template rebind<size_type>::other>
793 typedef std::vector<subdomain_type, typename TA::template rebind<subdomain_type>::other>
subdomain_vector;
796 typedef SLList<size_type, typename TA::template rebind<size_type>::other>
subdomain_list;
799 typedef std::vector<subdomain_list, typename TA::template rebind<subdomain_list>::other >
rowtodomain_vector;
805 typedef std::vector<slu, typename TA::template rebind<slu>::other>
slu_vector;
821 field_type relaxationFactor=1,
bool onTheFly_=
true);
835 field_type relaxationFactor=1,
bool onTheFly_=
true);
842 virtual void pre (X& x, X& b)
844 DUNE_UNUSED_PARAMETER(x);
845 DUNE_UNUSED_PARAMETER(b);
853 virtual void apply (X& v,
const X& d);
862 DUNE_UNUSED_PARAMETER(x);
865 template<
bool forward>
866 void apply(X& v,
const X& d);
880 typename M::size_type maxlength;
887 template<
class I,
class S,
class D>
891 : initializers(&il), indices(&idx), indexMaps(il.size()), domains(domains_)
895 template<
class I,
class S,
class D>
898 typedef typename IndexSet::value_type::const_iterator iterator;
899 for(iterator domain=(*indices)[row.index()].begin(); domain != (*indices)[row.index()].end(); ++domain) {
900 (*initializers)[*domain].addRowNnz(row, domains[*domain]);
901 indexMaps[*domain].insert(row.index());
905 template<
class I,
class S,
class D>
908 for(
auto&& i: *initializers)
909 i.allocateMatrixStorage();
910 for(
auto&& i: *initializers)
914 template<
class I,
class S,
class D>
917 typedef typename IndexSet::value_type::const_iterator iterator;
918 for(iterator domain=(*indices)[row.index()].begin(); domain != (*indices)[row.index()].end(); ++domain) {
919 typename std::map<size_type,size_type>::const_iterator v = indexMaps[*domain].find(
col.index());
920 if(v!= indexMaps[*domain].end()) {
921 (*initializers)[*domain].countEntries(indexMaps[*domain].find(
col.index())->second);
926 template<
class I,
class S,
class D>
929 for(
auto&& i : *initializers)
933 template<
class I,
class S,
class D>
936 typedef typename IndexSet::value_type::const_iterator iterator;
937 for(iterator domain=(*indices)[row.index()].begin(); domain!= (*indices)[row.index()].end(); ++domain) {
938 typename std::map<size_type,size_type>::const_iterator v = indexMaps[*domain].find(
col.index());
939 if(v!= indexMaps[*domain].end()) {
940 assert(indexMaps[*domain].end()!=indexMaps[*domain].find(row.index()));
941 (*initializers)[*domain].copyValue(
col, indexMaps[*domain].find(row.index())->second,
947 template<
class I,
class S,
class D>
950 std::vector<IndexMap>().swap(indexMaps);
951 for(
auto&& i: *initializers)
955 template<
class I,
class S,
class D>
960 template<
class I,
class S,
class D>
963 assert(map_.find(grow)==map_.end());
964 map_.insert(std::make_pair(grow, row++));
967 template<
class I,
class S,
class D>
968 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::const_iterator
971 return map_.find(grow);
974 template<
class I,
class S,
class D>
975 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::iterator
978 return map_.find(grow);
981 template<
class I,
class S,
class D>
982 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::const_iterator
988 template<
class I,
class S,
class D>
989 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::iterator
995 template<
class I,
class S,
class D>
996 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::const_iterator
1002 template<
class I,
class S,
class D>
1003 typename OverlappingSchwarzInitializer<I,S,D>::IndexMap::iterator
1006 return map_.begin();
1009 template<
class M,
class X,
class TM,
class TD,
class TA>
1012 :
mat(mat_), relax(relaxationFactor), onTheFly(fly)
1014 typedef typename rowtodomain_vector::const_iterator RowDomainIterator;
1015 typedef typename subdomain_list::const_iterator DomainIterator;
1016 #ifdef DUNE_ISTL_WITH_CHECKING
1017 assert(rowToDomain.size()==
mat.N());
1018 assert(rowToDomain.size()==
mat.M());
1020 for(RowDomainIterator iter=rowToDomain.begin(); iter != rowToDomain.end(); ++iter)
1021 assert(iter->size()>0);
1026 for(RowDomainIterator iter=rowToDomain.begin(); iter != rowToDomain.end(); ++iter)
1027 for(DomainIterator d=iter->begin(); d != iter->end(); ++d)
1028 domains=std::max(domains, *d);
1031 solvers.resize(domains);
1032 subDomains.resize(domains);
1036 for(RowDomainIterator iter=rowToDomain.begin(); iter != rowToDomain.end(); ++iter, ++row)
1037 for(DomainIterator d=iter->begin(); d != iter->end(); ++d)
1038 subDomains[*d].insert(row);
1040 #ifdef DUNE_ISTL_WITH_CHECKING
1042 typedef typename subdomain_vector::const_iterator iterator;
1043 for(iterator iter=subDomains.begin(); iter != subDomains.end(); ++iter) {
1044 typedef typename subdomain_type::const_iterator entry_iterator;
1045 Dune::dvverb<<
"domain "<<i++<<
":";
1046 for(entry_iterator entry = iter->begin(); entry != iter->end(); ++entry) {
1047 Dune::dvverb<<
" "<<*entry;
1049 Dune::dvverb<<std::endl;
1056 template<
class M,
class X,
class TM,
class TD,
class TA>
1061 :
mat(mat_), solvers(sd.size()), subDomains(sd), relax(relaxationFactor),
1064 typedef typename subdomain_vector::const_iterator DomainIterator;
1066 #ifdef DUNE_ISTL_WITH_CHECKING
1069 for(DomainIterator d=sd.begin(); d != sd.end(); ++d,++i) {
1071 assert(d->size()>0);
1072 typedef typename DomainIterator::value_type::const_iterator entry_iterator;
1073 Dune::dvverb<<
"domain "<<i<<
":";
1074 for(entry_iterator entry = d->begin(); entry != d->end(); ++entry) {
1075 Dune::dvverb<<
" "<<*entry;
1077 Dune::dvverb<<std::endl;
1087 for(DomainIterator domain=sd.begin(); domain != sd.end(); ++domain, ++domainId) {
1088 typedef typename subdomain_type::const_iterator iterator;
1089 for(iterator row=domain->begin(); row != domain->end(); ++row)
1090 rowToDomain[*row].push_back(domainId);
1106 template<
typename T,
typename A>
1109 static constexpr
size_t n = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::rows;
1110 static constexpr
size_t m = std::decay_t<decltype(Impl::asMatrix(std::declval<T>()))>::cols;
1111 template<
class Domain>
1119 template<
class K,
class Al,
class X,
class Y>
1120 template<
class RowToDomain,
class Solvers,
class SubDomains>
1122 SeqOverlappingSchwarzAssemblerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< K, Al>, X, Y >,
false>::
1123 assembleLocalProblems(
const RowToDomain& rowToDomain,
1126 const SubDomains& subDomains,
1129 DUNE_UNUSED_PARAMETER(onTheFly);
1130 DUNE_UNUSED_PARAMETER(rowToDomain);
1131 DUNE_UNUSED_PARAMETER(
mat);
1132 DUNE_UNUSED_PARAMETER(solvers);
1133 typedef typename SubDomains::const_iterator DomainIterator;
1134 std::size_t maxlength = 0;
1138 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1139 maxlength=std::max(maxlength, domain->size());
1145 #if HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
1146 template<
template<
class>
class S,
typename T,
typename A>
1147 template<
class RowToDomain,
class Solvers,
class SubDomains>
1151 const SubDomains& subDomains,
1154 typedef typename S<BCRSMatrix<T,A>>::MatrixInitializer MatrixInitializer;
1155 typedef typename std::vector<MatrixInitializer>::iterator InitializerIterator;
1156 typedef typename SubDomains::const_iterator DomainIterator;
1157 typedef typename Solvers::iterator SolverIterator;
1158 std::size_t maxlength = 0;
1161 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1162 maxlength=std::max(maxlength, domain->size());
1163 maxlength*=Impl::asMatrix(*
mat[0].begin()).N();
1166 DomainIterator domain=subDomains.begin();
1169 std::vector<MatrixInitializer> initializers(subDomains.size());
1171 SolverIterator solver=solvers.begin();
1172 for(InitializerIterator initializer=initializers.begin(); initializer!=initializers.end();
1173 ++initializer, ++solver, ++domain) {
1177 *initializer=MatrixInitializer(solver->getInternalMatrix());
1182 RowToDomain, SubDomains> Initializer;
1184 Initializer initializer(initializers, rowToDomain, subDomains);
1188 for(
auto&& s: solvers)
1190 for (SolverIterator solverIt = solvers.begin(); solverIt != solvers.end(); ++solverIt)
1192 assert(solverIt->getInternalMatrix().N() == solverIt->getInternalMatrix().M());
1193 maxlength = std::max(maxlength, solverIt->getInternalMatrix().N());
1199 #endif // HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
1201 template<
class M,
class X,
class Y>
1202 template<
class RowToDomain,
class Solvers,
class SubDomains>
1206 const SubDomains& subDomains,
1209 DUNE_UNUSED_PARAMETER(rowToDomain);
1210 typedef typename SubDomains::const_iterator DomainIterator;
1211 typedef typename Solvers::iterator SolverIterator;
1212 std::size_t maxlength = 0;
1215 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1216 maxlength=std::max(maxlength, domain->size());
1219 SolverIterator solver=solvers.begin();
1220 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end();
1221 ++domain, ++solver) {
1222 solver->setSubMatrix(
mat, *domain);
1223 maxlength=std::max(maxlength, domain->size());
1232 template<
class M,
class X,
class TM,
class TD,
class TA>
1238 template<
class M,
class X,
class TM,
class TD,
class TA>
1239 template<
bool forward>
1242 typedef slu_vector solver_vector;
1255 Adder adder(v, x, assigner, relax);
1259 std::for_each(domain->begin(), domain->end(), assigner);
1260 assigner.resetIndexForNextDomain();
1264 sdsolver.setSubMatrix(
mat, *domain);
1266 sdsolver.apply(assigner.lhs(), assigner.rhs());
1268 solver->apply(assigner.lhs(), assigner.rhs());
1273 std::for_each(domain->begin(), domain->end(), adder);
1274 assigner.resetIndexForNextDomain();
1279 assigner.deallocate();
1282 template<
class K,
class Al,
class X,
class Y>
1283 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< K, Al>, X, Y >,
false>
1285 const X& b_, Y& x_) :
1287 rhs_( new DynamicVector<
field_type>(maxlength, 42) ),
1288 lhs_( new DynamicVector<
field_type>(maxlength, -42) ),
1292 maxlength_(maxlength)
1295 template<
class K,
class Al,
class X,
class Y>
1304 template<
class K,
class Al,
class X,
class Y>
1307 ::resetIndexForNextDomain()
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>
1321 DynamicVector<typename X::field_type> &
1328 template<
class K,
class Al,
class X,
class Y>
1336 template<
class K,
class Al,
class X,
class Y>
1345 assert(i<maxlength_);
1346 rhs()[i]=(*b)[domainIndex][j];
1353 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1355 (*col).mv((*x)[
col.index()], tmp);
1358 assert(i<maxlength_);
1365 assert(i<maxlength_);
1366 rhs()[i]=Impl::asVector((*b)[domainIndex])[j];
1372 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1374 rhs()[i]-=Impl::asMatrix(*
col)[j][k] * Impl::asVector((*x)[
col.index()])[k];
1381 template<
class K,
class Al,
class X,
class Y>
1388 assert(i<maxlength_);
1389 Impl::asVector(res)[j]+=lhs()[i];
1393 #if HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
1395 template<
template<
class>
class S,
typename T,
typename A>
1403 x(&x_), i(0), maxlength_(maxlength)
1410 template<
template<
class>
class S,
typename T,
typename A>
1417 template<
template<
class>
class S,
typename T,
typename A>
1424 assert(i<maxlength_);
1425 rhs_[i]=Impl::asVector((*b)[domainIndex])[j];
1433 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1435 Impl::asMatrix(*col).mv((*x)[
col.index()], tmp);
1438 assert(i<maxlength_);
1439 rhs_[i]-=Impl::asVector(tmp)[j];
1446 template<
template<
class>
class S,
typename T,
typename A>
1450 assert(i<maxlength_);
1456 template<
template<
class>
class S,
typename T,
typename A>
1461 assert(i<maxlength_);
1462 Impl::asVector(res)[j]+=lhs_[i];
1466 template<
template<
class>
class S,
typename T,
typename A>
1472 template<
template<
class>
class S,
typename T,
typename A>
1479 template<
template<
class>
class S,
typename T,
typename A>
1486 #endif // HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK
1488 template<
class M,
class X,
class Y>
1497 rhs_=
new Y(maxlength);
1498 lhs_ =
new X(maxlength);
1501 template<
class M,
class X,
class Y>
1508 template<
class M,
class X,
class Y>
1511 (*rhs_)[i]=(*b)[domainIndex];
1514 typedef typename matrix_type::ConstColIterator col_iterator;
1517 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1518 Impl::asMatrix(*col).mmv((*x)[
col.index()], (*rhs_)[i]);
1524 template<
class M,
class X,
class Y>
1530 template<
class M,
class X,
class Y>
1536 template<
class M,
class X,
class Y>
1542 template<
class M,
class X,
class Y>
1548 template<
class M,
class X,
class Y>
1554 template<
typename S,
typename T,
typename A>
1559 : v(&v_), x(&x_), assigner(&assigner_), relax(relax_)
1562 template<
typename S,
typename T,
typename A>
1566 assigner->assignResult((*v)[domainIndex]);
1570 template<
typename S,
typename T,
typename A>
1578 template<
typename S,
typename T,
typename A>
1583 : x(&x_), assigner(&assigner_), relax(relax_)
1585 DUNE_UNUSED_PARAMETER(v_);
1589 template<
typename S,
typename T,
typename A>
1593 assigner->relaxResult(relax);
1594 assigner->assignResult((*x)[domainIndex]);
1598 template<
typename S,
typename T,
typename A>
SeqOverlappingSchwarz(const matrix_type &mat, const subdomain_vector &subDomains, field_type relaxationFactor=1, bool onTheFly_=true)
Construct the overlapping Schwarz method.
Definition: overlappingschwarz.hh:1057
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:1531
TA allocator
The allocator to use.
Definition: overlappingschwarz.hh:785
Definition: overlappingschwarz.hh:210
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:585
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:621
Col col
Definition: matrixmatrix.hh:349
@ sequential
Category for sequential solvers.
Definition: solvercategory.hh:23
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:579
T2 subdomain_vector
Definition: overlappingschwarz.hh:604
T1 solver_vector
Definition: overlappingschwarz.hh:602
Definition: overlappingschwarz.hh:718
Tag that the tells the Schwarz method to be additive.
Definition: overlappingschwarz.hh:115
OverlappingSchwarzInitializer(InitializerList &il, const IndexSet &indices, const subdomain_vector &domains)
Definition: overlappingschwarz.hh:888
Helper template meta program for application of overlapping Schwarz.
Definition: overlappingschwarz.hh:664
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:616
Exact subdomain solver using ILU(p) with appropriate p.
Definition: ilusubdomainsolver.hh:74
std::decay_t< decltype(Impl::asVector(std::declval< T >)))>::field_type field_type
Definition: overlappingschwarz.hh:544
Sequential overlapping Schwarz preconditioner.
Definition: colcompmatrix.hh:150
void createMatrix() const
Definition: overlappingschwarz.hh:948
virtual void pre(X &x, X &b)
Prepare the preconditioner.
Definition: overlappingschwarz.hh:842
AtomInitializer::Matrix Matrix
Definition: overlappingschwarz.hh:50
X::field_type field_type
Definition: overlappingschwarz.hh:146
void apply(DynamicVector< field_type > &v, DynamicVector< field_type > &d)
Apply the subdomain solver.
Definition: overlappingschwarz.hh:158
InitializerList::value_type AtomInitializer
Definition: overlappingschwarz.hh:49
matrix_type::size_type size_type
The return type of the size method.
Definition: overlappingschwarz.hh:782
range_type::field_type field_type
Definition: overlappingschwarz.hh:312
Y range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:151
Tag that tells the Schwarz method to be multiplicative and symmetric.
Definition: overlappingschwarz.hh:128
void operator()(const size_type &domain)
calculate one entry of the local defect.
Definition: overlappingschwarz.hh:1509
M matrix_type
Definition: overlappingschwarz.hh:398
TD slu
The type for the subdomain solver in use.
Definition: overlappingschwarz.hh:802
std::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition: overlappingschwarz.hh:145
Definition: overlappingschwarz.hh:537
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:761
SeqOverlappingSchwarz< M, X, SymmetricMultiplicativeSchwarzMode, TD, TA > smoother
Definition: overlappingschwarz.hh:678
BCRSMatrix< T, A > matrix_type
Definition: overlappingschwarz.hh:709
std::vector< subdomain_list, typename TA::template rebind< subdomain_list >::other > rowtodomain_vector
The vector type containing the row index to subdomain mapping.
Definition: overlappingschwarz.hh:799
X::field_type field_type
Definition: overlappingschwarz.hh:222
std::remove_const< M >::type rilu_type
Definition: overlappingschwarz.hh:147
Definition: overlappingschwarz.hh:515
solver_vector::reverse_iterator solver_iterator
Definition: overlappingschwarz.hh:631
void setSubMatrix(const M &BCRS, S &rowset)
Set the data of the local problem.
Definition: overlappingschwarz.hh:180
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:640
smoother::range_type range_type
Definition: overlappingschwarz.hh:667
AdditiveAdder< S, X > Adder
Definition: overlappingschwarz.hh:573
void relaxResult(field_type relax)
relax the result.
Definition: overlappingschwarz.hh:1525
X::field_type field_type
The field type of the preconditioner.
Definition: overlappingschwarz.hh:779
IndexSet::size_type size_type
Definition: overlappingschwarz.hh:55
T smoother
Definition: overlappingschwarz.hh:666
M matrix_type
Definition: overlappingschwarz.hh:720
void resetIndexForNextDomain()
Resets the local index to zero.
Definition: overlappingschwarz.hh:1549
virtual SolverCategory::Category category() const
Category of the preconditioner (see SolverCategory::Category)
Definition: overlappingschwarz.hh:869
std::vector< slu, typename TA::template rebind< slu >::other > slu_vector
The vector type containing subdomain solvers.
Definition: overlappingschwarz.hh:805
A::size_type size_type
The type for the index access and the size.
Definition: bcrsmatrix.hh:459
BCRSMatrix< K, Al > matrix_type
Definition: overlappingschwarz.hh:221
std::vector< subdomain_type, typename TA::template rebind< subdomain_type >::other > subdomain_vector
The vector type containing the subdomain to row index mapping.
Definition: overlappingschwarz.hh:793
virtual void post(X &x)
Postprocess the preconditioner.
Definition: overlappingschwarz.hh:860
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:649
subdomain_vector::const_iterator domain_iterator
Definition: overlappingschwarz.hh:605
SLList< size_type, typename TA::template rebind< size_type >::other > subdomain_list
The type for the row to subdomain mapping.
Definition: overlappingschwarz.hh:796
void copyValue(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:934
X range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:766
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:404
subdomain_vector::const_reverse_iterator domain_iterator
Definition: overlappingschwarz.hh:633
void copyToColCompMatrix(F &initializer, const MRS &mrs)
Definition: colcompmatrix.hh:473
Y::field_type field_type
Definition: overlappingschwarz.hh:400
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:635
Implementation of the BCRSMatrix class.
A sparse block matrix with compressed row storage.
Definition: bcrsmatrix.hh:424
template meta program for choosing how to add the correction.
Definition: overlappingschwarz.hh:567
S IndexSet
Definition: overlappingschwarz.hh:54
A::size_type size_type
Definition: overlappingschwarz.hh:521
BCRSMatrix< K, Al > matrix_type
Definition: overlappingschwarz.hh:698
virtual void apply(X &v, const X &d)
Apply the precondtioner.
Definition: overlappingschwarz.hh:1233
Y & rhs()
Get the local right hand side.
Definition: overlappingschwarz.hh:1543
Matrix::const_iterator Iter
Definition: overlappingschwarz.hh:51
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:225
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:612
Definition: ilusubdomainsolver.hh:107
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:607
Definition: colcompmatrix.hh:153
void countEntries(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:915
Helper template meta program for application of overlapping Schwarz.
Definition: overlappingschwarz.hh:600
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:681
A::size_type size_type
Definition: overlappingschwarz.hh:543
Definition: allocator.hh:7
smoother::range_type range_type
Definition: overlappingschwarz.hh:679
range_type::block_type block_type
Definition: overlappingschwarz.hh:224
void allocate()
Definition: overlappingschwarz.hh:906
D subdomain_vector
The vector type containing the subdomain to row index mapping.
Definition: overlappingschwarz.hh:46
Classes for using SuperLU with ISTL matrices.
Y::block_type block_type
Definition: overlappingschwarz.hh:402
solver_vector::iterator solver_iterator
Definition: overlappingschwarz.hh:603
Definition: overlappingschwarz.hh:395
void addRowNnz(const Iter &row)
Definition: overlappingschwarz.hh:896
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:644
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:149
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:315
X & lhs()
Get the local left hand side.
Definition: overlappingschwarz.hh:1537
std::set< size_type, std::less< size_type >, typename TA::template rebind< size_type >::other > subdomain_type
The type for the subdomain to row index mapping.
Definition: overlappingschwarz.hh:790
Matrix & mat
Definition: matrixmatrix.hh:345
void deallocate()
Deallocates memory of the local vector.
Definition: overlappingschwarz.hh:1502
OverlappingAssignerILUBase(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:1489
Y range_type
Definition: overlappingschwarz.hh:223
Definition: overlappingschwarz.hh:1104
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:489
Exact subdomain solver using Dune::DynamicMatrix<T>::solve.
Definition: overlappingschwarz.hh:136
Classes for using UMFPack with ISTL matrices.
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:30
row_type::ConstIterator ConstColIterator
Const iterator to the entries of a row.
Definition: bcrsmatrix.hh:699
Templates characterizing the type of a solver.
Define general preconditioner interface.
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:669
A vector of blocks with memory management.
Definition: bvector.hh:402
Tag that tells the Schwarz method to be multiplicative.
Definition: overlappingschwarz.hh:121
Category
Definition: solvercategory.hh:21
S< BCRSMatrix< T, A > >::range_type range_type
Definition: overlappingschwarz.hh:311
M matrix_type
The type of the matrix to precondition.
Definition: overlappingschwarz.hh:756
Initializer for SuperLU Matrices representing the subdomains.
Definition: overlappingschwarz.hh:42
range_type::block_type block_type
Definition: overlappingschwarz.hh:313
T2 subdomain_vector
Definition: overlappingschwarz.hh:632
static std::size_t assembleLocalProblems(const RowToDomain &rowToDomain, const matrix_type &mat, Solvers &solvers, const SubDomains &domains, bool onTheFly)
Definition: overlappingschwarz.hh:1203
This file implements a vector space as a tensor product of a given vector space. The number of compon...
void calcColstart() const
Definition: overlappingschwarz.hh:927
static int size(const Domain &d)
Definition: overlappingschwarz.hh:1112
T1 solver_vector
Definition: overlappingschwarz.hh:630
Various local subdomain solvers based on ILU for SeqOverlappingSchwarz.
Matrix::row_type::const_iterator CIter
Definition: overlappingschwarz.hh:52
std::decay_t< decltype(Impl::asVector(std::declval< T >)))>::field_type field_type
Definition: overlappingschwarz.hh:522
I InitializerList
Definition: overlappingschwarz.hh:48
BCRSMatrix< T, A > matrix_type
Definition: overlappingschwarz.hh:310
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:508
TM Mode
The mode (additive or multiplicative) of the Schwarz method.
Definition: overlappingschwarz.hh:774