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;
58 const IndexSet& indices,
59 const subdomain_vector& domains);
78 typedef std::map<size_type,size_type> Map;
79 typedef typename Map::iterator iterator;
80 typedef typename Map::const_iterator const_iterator;
84 void insert(size_type grow);
86 const_iterator find(size_type grow)
const;
88 iterator find(size_type grow);
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;
106 InitializerList* initializers;
107 const IndexSet *indices;
108 mutable std::vector<IndexMap> indexMaps;
109 const subdomain_vector& domains;
135 template<
class M,
class X,
class Y>
139 template<
class K,
int n,
class Al,
class X,
class Y>
157 void apply (DynamicVector<field_type>& v, DynamicVector<field_type>& d)
159 assert(v.size() > 0);
160 assert(v.size() == d.size());
161 assert(
A.rows() <= v.size());
162 assert(
A.cols() <= v.size());
163 size_t sz =
A.rows();
167 v.resize(v.capacity());
168 d.resize(d.capacity());
181 size_t sz = rowset.size();
183 typedef typename S::const_iterator SIter;
185 for(SIter rowIdx = rowset.begin(), rowEnd=rowset.end();
186 rowIdx!= rowEnd; ++rowIdx, r++)
189 for(SIter colIdx = rowset.begin(), colEnd=rowset.end();
190 colIdx!= colEnd; ++colIdx, c++)
192 if (BCRS[*rowIdx].find(*colIdx) == BCRS[*rowIdx].
end())
194 for (
size_t i=0; i<n; i++)
196 for (
size_t j=0; j<n; j++)
198 A[r*n+i][c*n+j] = BCRS[*rowIdx][*colIdx][i][j];
208 template<
typename T,
bool tag>
217 const typename T::range_type& b,
typename T::range_type& x)
224 template<
class K,
int n,
class Al,
class X,
class Y>
253 void resetIndexForNextDomain();
260 DynamicVector<K> & lhs();
267 DynamicVector<K> & rhs();
274 void relaxResult(field_type relax);
280 void operator()(
const size_type& domainIndex);
290 void assignResult(block_type& res);
296 const matrix_type*
mat;
299 DynamicVector<field_type> * rhs_;
302 DynamicVector<field_type> * lhs_;
310 std::size_t maxlength_;
313 #if HAVE_SUPERLU || HAVE_UMFPACK
314 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
332 const range_type& b, range_type& x);
343 void resetIndexForNextDomain();
361 void relaxResult(field_type relax);
367 void operator()(
const size_type& domain);
376 void assignResult(block_type& res);
382 const matrix_type*
mat;
394 std::size_t maxlength_;
399 template<
class M,
class X,
class Y>
482 template<
class M,
class X,
class Y>
501 template<
class M,
class X,
class Y>
519 template<
typename S,
typename T>
523 template<
typename S,
typename T,
typename A,
int n>
529 void operator()(
const size_type& domain);
539 template<
typename S,
typename T>
543 template<
typename S,
typename T,
typename A,
int n>
549 void operator()(
const size_type& domain);
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>
608 static solver_iterator
begin(solver_vector& sv)
613 static solver_iterator
end(solver_vector& sv)
617 static domain_iterator
begin(
const subdomain_vector& sv)
622 static domain_iterator
end(
const subdomain_vector& sv)
628 template<
typename T1,
typename T2>
636 static solver_iterator
begin(solver_vector& sv)
641 static solver_iterator
end(solver_vector& sv)
645 static domain_iterator
begin(
const subdomain_vector& sv)
650 static domain_iterator
end(
const subdomain_vector& sv)
670 static void apply(smoother& sm, range_type& v,
const range_type& b)
672 sm.template apply<true>(v, b);
676 template<
class M,
class X,
class TD,
class TA>
682 static void apply(smoother& sm, range_type& v,
const range_type& b)
684 sm.template apply<true>(v, b);
685 sm.template apply<false>(v, b);
689 template<
class T,
bool tag>
699 template<
class K,
int n,
class Al,
class X,
class Y>
703 template<
class RowToDomain,
class Solvers,
class SubDomains>
704 static std::size_t assembleLocalProblems(
const RowToDomain& rowToDomain,
const matrix_type&
mat,
705 Solvers& solvers,
const SubDomains& domains,
709 template<
template<
class>
class S,
typename T,
typename A,
int m,
int n>
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 TA::template rebind<size_type>::other>
795 typedef std::vector<subdomain_type, typename TA::template rebind<subdomain_type>::other>
subdomain_vector;
798 typedef SLList<size_type, typename TA::template rebind<size_type>::other>
subdomain_list;
801 typedef std::vector<subdomain_list, typename TA::template rebind<subdomain_list>::other >
rowtodomain_vector;
807 typedef std::vector<slu, typename TA::template rebind<slu>::other>
slu_vector;
828 field_type relaxationFactor=1,
bool onTheFly_=
true);
842 field_type relaxationFactor=1,
bool onTheFly_=
true);
849 virtual void pre (X& x, X& b)
851 DUNE_UNUSED_PARAMETER(x);
852 DUNE_UNUSED_PARAMETER(b);
860 virtual void apply (X& v,
const X& d);
869 DUNE_UNUSED_PARAMETER(x);
872 template<
bool forward>
873 void apply(X& v,
const X& d);
878 subdomain_vector subDomains;
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 std::for_each(initializers->begin(), initializers->end(),
910 std::mem_fun_ref(&AtomInitializer::allocateMatrixStorage));
911 std::for_each(initializers->begin(), initializers->end(),
912 std::mem_fun_ref(&AtomInitializer::allocateMarker));
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 std::for_each(initializers->begin(), initializers->end(),
931 std::mem_fun_ref(&AtomInitializer::calcColstart));
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 std::for_each(initializers->begin(), initializers->end(),
953 std::mem_fun_ref(&AtomInitializer::createMatrix));
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,
int n,
int m>
1110 template<
class Domain>
1118 template<
class K,
int n,
class Al,
class X,
class Y>
1119 template<
class RowToDomain,
class Solvers,
class SubDomains>
1121 SeqOverlappingSchwarzAssemblerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>::
1122 assembleLocalProblems(
const RowToDomain& rowToDomain,
1125 const SubDomains& subDomains,
1128 DUNE_UNUSED_PARAMETER(onTheFly);
1129 DUNE_UNUSED_PARAMETER(rowToDomain);
1130 DUNE_UNUSED_PARAMETER(mat);
1131 DUNE_UNUSED_PARAMETER(solvers);
1132 typedef typename SubDomains::const_iterator DomainIterator;
1133 std::size_t maxlength = 0;
1137 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1138 maxlength=std::max(maxlength, domain->size());
1144 #if HAVE_SUPERLU || HAVE_UMFPACK
1145 template<
template<
class>
class S,
typename T,
typename A,
int m,
int n>
1146 template<
class RowToDomain,
class Solvers,
class SubDomains>
1150 const SubDomains& subDomains,
1153 typedef typename S<BCRSMatrix<FieldMatrix<T,m,n>,A> >::MatrixInitializer MatrixInitializer;
1154 typedef typename std::vector<MatrixInitializer>::iterator InitializerIterator;
1155 typedef typename SubDomains::const_iterator DomainIterator;
1156 typedef typename Solvers::iterator SolverIterator;
1157 std::size_t maxlength = 0;
1160 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1161 maxlength=std::max(maxlength, domain->size());
1162 maxlength*=mat[0].
begin()->N();
1165 DomainIterator domain=subDomains.begin();
1168 std::vector<MatrixInitializer> initializers(subDomains.size());
1170 SolverIterator solver=solvers.begin();
1171 for(InitializerIterator initializer=initializers.begin(); initializer!=initializers.end();
1172 ++initializer, ++solver, ++domain) {
1176 *initializer=MatrixInitializer(solver->getInternalMatrix());
1181 RowToDomain, SubDomains> Initializer;
1183 Initializer initializer(initializers, rowToDomain, subDomains);
1188 for(SolverIterator solver=solvers.begin(); solver!=solvers.end(); ++solver) {
1189 assert(solver->getInternalMatrix().N()==solver->getInternalMatrix().M());
1190 maxlength=std::max(maxlength, solver->getInternalMatrix().N());
1198 template<
class M,
class X,
class Y>
1199 template<
class RowToDomain,
class Solvers,
class SubDomains>
1203 const SubDomains& subDomains,
1206 DUNE_UNUSED_PARAMETER(rowToDomain);
1207 typedef typename SubDomains::const_iterator DomainIterator;
1208 typedef typename Solvers::iterator SolverIterator;
1209 std::size_t maxlength = 0;
1212 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1213 maxlength=std::max(maxlength, domain->size());
1216 SolverIterator solver=solvers.begin();
1217 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end();
1218 ++domain, ++solver) {
1219 solver->setSubMatrix(mat, *domain);
1220 maxlength=std::max(maxlength, domain->size());
1229 template<
class M,
class X,
class TM,
class TD,
class TA>
1235 template<
class M,
class X,
class TM,
class TD,
class TA>
1236 template<
bool forward>
1239 typedef slu_vector solver_vector;
1252 Adder adder(v, x, assigner, relax);
1256 std::for_each(domain->begin(), domain->end(), assigner);
1257 assigner.resetIndexForNextDomain();
1261 sdsolver.setSubMatrix(
mat, *domain);
1263 sdsolver.apply(assigner.lhs(), assigner.rhs());
1265 solver->apply(assigner.lhs(), assigner.rhs());
1270 std::for_each(domain->begin(), domain->end(), adder);
1271 assigner.resetIndexForNextDomain();
1276 assigner.deallocate();
1279 template<
class K,
int n,
class Al,
class X,
class Y>
1280 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>
1282 const X& b_, Y& x_) :
1284 rhs_( new DynamicVector<
field_type>(maxlength, 42) ),
1285 lhs_( new DynamicVector<
field_type>(maxlength, -42) ),
1289 maxlength_(maxlength)
1292 template<
class K,
int n,
class Al,
class X,
class Y>
1294 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>
1301 template<
class K,
int n,
class Al,
class X,
class Y>
1303 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>
1304 ::resetIndexForNextDomain()
1309 template<
class K,
int n,
class Al,
class X,
class Y>
1311 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>
1317 template<
class K,
int n,
class Al,
class X,
class Y>
1319 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>
1325 template<
class K,
int n,
class Al,
class X,
class Y>
1327 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>
1333 template<
class K,
int n,
class Al,
class X,
class Y>
1335 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>
1342 assert(i<maxlength_);
1343 rhs()[i]=(*b)[domainIndex][j];
1350 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1352 (*col).mv((*x)[
col.index()], tmp);
1355 assert(i<maxlength_);
1362 assert(i<maxlength_);
1363 rhs()[i]=(*b)[domainIndex][j];
1369 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1371 rhs()[i]-=(*col)[j][k] * (*x)[
col.index()][k];
1378 template<
class K,
int n,
class Al,
class X,
class Y>
1380 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>
1385 assert(i<maxlength_);
1390 #if HAVE_SUPERLU || HAVE_UMFPACK
1392 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1400 x(&x_), i(0), maxlength_(maxlength)
1407 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1408 void OverlappingAssignerHelper<S<BCRSMatrix<FieldMatrix<T,n,m>,A> >,
true>::deallocate()
1414 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1415 void OverlappingAssignerHelper<S<BCRSMatrix<FieldMatrix<T,n,m>,A> >,
true>::operator()(
const size_type& domainIndex)
1421 assert(i<maxlength_);
1422 rhs_[i]=(*b)[domainIndex][j];
1430 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1432 (*col).mv((*x)[
col.index()], tmp);
1435 assert(i<maxlength_);
1443 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1444 void OverlappingAssignerHelper<S<BCRSMatrix<FieldMatrix<T,n,m>,A> >,
true>::relaxResult(
field_type relax)
1447 assert(i<maxlength_);
1453 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1454 void OverlappingAssignerHelper<S<BCRSMatrix<FieldMatrix<T,n,m>,A> >,
true>::assignResult(
block_type& res)
1458 assert(i<maxlength_);
1463 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1464 void OverlappingAssignerHelper<S<BCRSMatrix<FieldMatrix<T,n,m>,A> >,
true>::resetIndexForNextDomain()
1469 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1470 typename OverlappingAssignerHelper<S<BCRSMatrix<FieldMatrix<T,n,m>,A> >,
true>::field_type*
1471 OverlappingAssignerHelper<S<BCRSMatrix<FieldMatrix<T,n,m>,A> >,
true>::lhs()
1476 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1477 typename OverlappingAssignerHelper<S<BCRSMatrix<FieldMatrix<T,n,m>,A> >,
true>::field_type*
1478 OverlappingAssignerHelper<S<BCRSMatrix<FieldMatrix<T,n,m>,A> >,
true>::rhs()
1485 template<
class M,
class X,
class Y>
1494 rhs_=
new Y(maxlength);
1495 lhs_ =
new X(maxlength);
1498 template<
class M,
class X,
class Y>
1505 template<
class M,
class X,
class Y>
1508 (*rhs_)[i]=(*b)[domainIndex];
1511 typedef typename matrix_type::ConstColIterator col_iterator;
1514 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1515 (*col).mmv((*x)[
col.index()], (*rhs_)[i]);
1521 template<
class M,
class X,
class Y>
1527 template<
class M,
class X,
class Y>
1533 template<
class M,
class X,
class Y>
1539 template<
class M,
class X,
class Y>
1545 template<
class M,
class X,
class Y>
1551 template<
typename S,
typename T,
typename A,
int n>
1556 : v(&v_), x(&x_), assigner(&assigner_), relax(relax_)
1559 template<
typename S,
typename T,
typename A,
int n>
1563 assigner->assignResult((*v)[domainIndex]);
1567 template<
typename S,
typename T,
typename A,
int n>
1568 void AdditiveAdder<S,BlockVector<FieldVector<T,n>,A> >::axpy()
1575 template<
typename S,
typename T,
typename A,
int n>
1580 : x(&x_), assigner(&assigner_), relax(relax_)
1582 DUNE_UNUSED_PARAMETER(v_);
1586 template<
typename S,
typename T,
typename A,
int n>
1587 void MultiplicativeAdder<S,BlockVector<FieldVector<T,n>,A> >::operator()(
const size_type& domainIndex)
1590 assigner->relaxResult(relax);
1591 assigner->assignResult((*x)[domainIndex]);
1595 template<
typename S,
typename T,
typename A,
int n>
1596 void MultiplicativeAdder<S,BlockVector<FieldVector<T,n>,A> >::axpy()
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:622
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:513
void apply(DynamicVector< field_type > &v, DynamicVector< field_type > &d)
Apply the subdomain solver.
Definition: overlappingschwarz.hh:157
Matrix::const_iterator Iter
Definition: overlappingschwarz.hh:51
S IndexSet
Definition: overlappingschwarz.hh:54
Tag that the tells the schwarz method to be additive.
Definition: overlappingschwarz.hh:115
Y range_type
Definition: overlappingschwarz.hh:230
virtual void pre(X &x, X &b)
Prepare the preconditioner.
Definition: overlappingschwarz.hh:849
Exact subdomain solver using ILU(p) with appropriate p.
Definition: ilusubdomainsolver.hh:74
smoother::range_type range_type
Definition: overlappingschwarz.hh:668
D subdomain_vector
The vector type containing the subdomain to row index mapping.
Definition: overlappingschwarz.hh:46
range_type::block_type block_type
Definition: overlappingschwarz.hh:320
Implementation of the BCRSMatrix class.
Definition: overlappingschwarz.hh:209
Row row
Definition: matrixmatrix.hh:345
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
Definition: basearray.hh:19
Definition: overlappingschwarz.hh:540
template meta program for choosing how to add the correction.
Definition: overlappingschwarz.hh:568
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:1528
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:682
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:792
Dune::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition: overlappingschwarz.hh:145
I InitializerList
Definition: overlappingschwarz.hh:48
AdditiveAdder< S, X > Adder
Definition: overlappingschwarz.hh:574
Tag that tells the Schwarz method to be multiplicative and symmetric.
Definition: overlappingschwarz.hh:128
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:322
A::size_type size_type
The type for the index access and the size.
Definition: bcrsmatrix.hh:447
Definition: overlappingschwarz.hh:1105
K field_type
Definition: overlappingschwarz.hh:146
This file implements a vector space as a tensor product of a given vector space. The number of compon...
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:580
Matrix & mat
Definition: matrixmatrix.hh:343
Dune::remove_const< M >::type rilu_type
Definition: overlappingschwarz.hh:147
X::field_type field_type
The field type of the preconditioner.
Definition: overlappingschwarz.hh:781
A::size_type size_type
Definition: overlappingschwarz.hh:546
A vector of blocks with memory management.
Definition: bvector.hh:252
void copyValue(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:935
OverlappingSchwarzInitializer(InitializerList &il, const IndexSet &indices, const subdomain_vector &domains)
Definition: overlappingschwarz.hh:889
T2 subdomain_vector
Definition: overlappingschwarz.hh:605
Helper template meta program for application of overlapping schwarz.
Definition: overlappingschwarz.hh:665
range_type::field_type field_type
Definition: overlappingschwarz.hh:319
void setSubMatrix(const M &BCRS, S &rowset)
Set the data of the local problem.
Definition: overlappingschwarz.hh:179
TM Mode
The mode (additive or multiplicative) of the Schwarz method.
Definition: overlappingschwarz.hh:776
static std::size_t assembleLocalProblems(const RowToDomain &rowToDomain, const matrix_type &mat, Solvers &solvers, const SubDomains &domains, bool onTheFly)
Definition: overlappingschwarz.hh:1200
Col col
Definition: matrixmatrix.hh:347
virtual void apply(X &v, const X &d)
Apply the precondtioner.
Definition: overlappingschwarz.hh:1230
void addRowNnz(const Iter &row)
Definition: overlappingschwarz.hh:897
A sparse block matrix with compressed row storage.
Definition: bcrsmatrix.hh:412
Definition: overlappingschwarz.hh:690
Y::block_type block_type
Definition: overlappingschwarz.hh:407
Iterator end()
Get iterator to one beyond last row.
Definition: bcrsmatrix.hh:630
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:232
Matrix & A
Definition: matrixmatrix.hh:216
Definition: overlappingschwarz.hh:720
A::size_type size_type
Definition: overlappingschwarz.hh:526
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:763
M matrix_type
The type of the matrix to precondition.
Definition: overlappingschwarz.hh:758
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:494
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:149
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:795
Classes for using SuperLU with ISTL matrices.
BCRSMatrix< FieldMatrix< T, m, n >, A > matrix_type
Definition: overlappingschwarz.hh:712
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:608
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:636
IndexSet::size_type size_type
Definition: overlappingschwarz.hh:55
Helper template meta program for application of overlapping schwarz.
Definition: overlappingschwarz.hh:601
Definition: overlappingschwarz.hh:213
void countEntries(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:916
void calcColstart() const
Definition: overlappingschwarz.hh:928
Category for sequential solvers.
Definition: solvercategory.hh:21
Exact subdomain solver using Dune::DynamicMatrix::solve.
Definition: overlappingschwarz.hh:136
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:617
iterator class for sequential access
Definition: basearray.hh:580
void relaxResult(field_type relax)
relax the result.
Definition: overlappingschwarz.hh:1522
void createMatrix() const
Definition: overlappingschwarz.hh:949
Definition: colcompmatrix.hh:160
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:26
Tag that tells the Schwarz method to be multiplicative.
Definition: overlappingschwarz.hh:121
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:641
void operator()(const size_type &domain)
calculate one entry of the local defect.
Definition: overlappingschwarz.hh:1506
T2 subdomain_vector
Definition: overlappingschwarz.hh:633
static int size(const Domain &d)
Definition: overlappingschwarz.hh:1111
The category the precondtioner is part of.
Definition: overlappingschwarz.hh:811
Definition: overlappingschwarz.hh:400
solver_vector::reverse_iterator solver_iterator
Definition: overlappingschwarz.hh:632
M matrix_type
Definition: overlappingschwarz.hh:722
Definition: matrixutils.hh:24
Sequential overlapping Schwarz preconditioner.
Definition: colcompmatrix.hh:157
K field_type
Definition: overlappingschwarz.hh:229
X & lhs()
Get the local left hand side.
Definition: overlappingschwarz.hh:1534
BCRSMatrix< FieldMatrix< T, n, m >, A > matrix_type
Definition: overlappingschwarz.hh:317
virtual void post(X &x)
Postprocess the preconditioner.
Definition: overlappingschwarz.hh:867
T smoother
Definition: overlappingschwarz.hh:667
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:645
M::field_type field_type
Definition: overlappingschwarz.hh:405
AtomInitializer::Matrix Matrix
Definition: overlappingschwarz.hh:50
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:650
Classes for using UMFPack with ISTL matrices.
S< BCRSMatrix< FieldMatrix< T, n, m >, A > >::range_type range_type
Definition: overlappingschwarz.hh:318
OverlappingAssigner(std::size_t maxlength, const typename T::matrix_type &mat, const typename T::range_type &b, typename T::range_type &x)
Definition: overlappingschwarz.hh:216
SLList< size_type, typename TA::template rebind< size_type >::other > subdomain_list
The type for the row to subdomain mapping.
Definition: overlappingschwarz.hh:798
subdomain_vector::const_reverse_iterator domain_iterator
Definition: overlappingschwarz.hh:634
OverlappingAssignerILUBase(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:1486
void resetIndexForNextDomain()
Resets the local index to zero.
Definition: overlappingschwarz.hh:1546
Definition: ilusubdomainsolver.hh:107
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:613
Y & rhs()
Get the local right hand side.
Definition: overlappingschwarz.hh:1540
std::vector< slu, typename TA::template rebind< slu >::other > slu_vector
The vector type containing subdomain solvers.
Definition: overlappingschwarz.hh:807
void copyToColCompMatrix(F &initializer, const MRS &mrs)
Definition: colcompmatrix.hh:431
Iterator begin()
Get iterator to first row.
Definition: bcrsmatrix.hh:624
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:409
BCRSMatrix< FieldMatrix< K, n, n >, Al > matrix_type
Definition: overlappingschwarz.hh:228
M matrix_type
Definition: overlappingschwarz.hh:403
solver_vector::iterator solver_iterator
Definition: overlappingschwarz.hh:604
T1 solver_vector
Definition: overlappingschwarz.hh:603
SeqOverlappingSchwarz< M, X, SymmetricMultiplicativeSchwarzMode, TD, TA > smoother
Definition: overlappingschwarz.hh:679
range_type::block_type block_type
Definition: overlappingschwarz.hh:231
void deallocate()
Deallocates memory of the local vector.
Definition: overlappingschwarz.hh:1499
BCRSMatrix< FieldMatrix< K, n, n >, Al > matrix_type
Definition: overlappingschwarz.hh:702
Various local subdomain solvers based on ILU for SeqOverlappingSchwarz.
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:670
Y range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:151
Definition: overlappingschwarz.hh:520
Initializer for SuperLU Matrices representing the subdomains.
Definition: overlappingschwarz.hh:42
Templates characterizing the type of a solver.
Definition: solvertype.hh:27
X range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:768
void allocate()
Definition: overlappingschwarz.hh:907
TD slu
The type for the subdomain solver in use.
Definition: overlappingschwarz.hh:804
Matrix::row_type::const_iterator CIter
Definition: overlappingschwarz.hh:52
smoother::range_type range_type
Definition: overlappingschwarz.hh:680
T1 solver_vector
Definition: overlappingschwarz.hh:631
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:801
matrix_type::size_type size_type
The return type of the size method.
Definition: overlappingschwarz.hh:784
InitializerList::value_type AtomInitializer
Definition: overlappingschwarz.hh:49
Define general preconditioner interface.
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:586
TA allocator
The allocator to use.
Definition: overlappingschwarz.hh:787
subdomain_vector::const_iterator domain_iterator
Definition: overlappingschwarz.hh:606