3 #ifndef DUNE_OVERLAPPINGSCHWARZ_HH
4 #define DUNE_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,
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();
280 void operator()(
const size_type& domainIndex);
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>
343 void resetIndexForNextDomain();
367 void operator()(
const size_type& domain);
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>
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>
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);
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(rowToDomain);
1129 DUNE_UNUSED_PARAMETER(mat);
1130 DUNE_UNUSED_PARAMETER(solvers);
1131 typedef typename SubDomains::const_iterator DomainIterator;
1132 std::size_t maxlength = 0;
1136 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1137 maxlength=std::max(maxlength, domain->size());
1143 #if HAVE_SUPERLU || HAVE_UMFPACK
1144 template<
template<
class>
class S,
typename T,
typename A,
int m,
int n>
1145 template<
class RowToDomain,
class Solvers,
class SubDomains>
1149 const SubDomains& subDomains,
1152 typedef typename S<BCRSMatrix<FieldMatrix<T,m,n>,
A> >::MatrixInitializer MatrixInitializer;
1153 typedef typename std::vector<MatrixInitializer>::iterator InitializerIterator;
1154 typedef typename SubDomains::const_iterator DomainIterator;
1155 typedef typename Solvers::iterator SolverIterator;
1156 std::size_t maxlength = 0;
1159 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1160 maxlength=std::max(maxlength, domain->size());
1161 maxlength*=mat[0].
begin()->N();
1164 DomainIterator domain=subDomains.begin();
1167 std::vector<MatrixInitializer> initializers(subDomains.size());
1169 SolverIterator solver=solvers.begin();
1170 for(InitializerIterator initializer=initializers.begin(); initializer!=initializers.end();
1171 ++initializer, ++solver, ++domain) {
1175 *initializer=MatrixInitializer(solver->mat);
1180 RowToDomain, SubDomains> Initializer;
1182 Initializer initializer(initializers, rowToDomain, subDomains);
1187 for(SolverIterator solver=solvers.begin(); solver!=solvers.end(); ++solver) {
1188 assert(solver->mat.N()==solver->mat.M());
1189 maxlength=std::max(maxlength, solver->mat.N());
1197 template<
class M,
class X,
class Y>
1198 template<
class RowToDomain,
class Solvers,
class SubDomains>
1202 const SubDomains& subDomains,
1205 DUNE_UNUSED_PARAMETER(rowToDomain);
1206 typedef typename SubDomains::const_iterator DomainIterator;
1207 typedef typename Solvers::iterator SolverIterator;
1208 std::size_t maxlength = 0;
1211 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end(); ++domain)
1212 maxlength=std::max(maxlength, domain->size());
1215 SolverIterator solver=solvers.begin();
1216 for(DomainIterator domain=subDomains.begin(); domain!=subDomains.end();
1217 ++domain, ++solver) {
1218 solver->setSubMatrix(mat, *domain);
1219 maxlength=std::max(maxlength, domain->size());
1228 template<
class M,
class X,
class TM,
class TD,
class TA>
1234 template<
class M,
class X,
class TM,
class TD,
class TA>
1235 template<
bool forward>
1238 typedef slu_vector solver_vector;
1251 Adder adder(v, x, assigner, relax);
1255 std::for_each(domain->begin(), domain->end(), assigner);
1256 assigner.resetIndexForNextDomain();
1260 sdsolver.setSubMatrix(
mat, *domain);
1262 sdsolver.apply(assigner.lhs(), assigner.rhs());
1264 solver->apply(assigner.lhs(), assigner.rhs());
1269 std::for_each(domain->begin(), domain->end(), adder);
1270 assigner.resetIndexForNextDomain();
1275 assigner.deallocate();
1278 template<
class K,
int n,
class Al,
class X,
class Y>
1279 OverlappingAssignerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< FieldMatrix<K,n,n>, Al>, X, Y >,
false>
1281 const X& b_, Y& x_) :
1283 rhs_( new DynamicVector<
field_type>(maxlength, 42) ),
1284 lhs_( new DynamicVector<
field_type>(maxlength, -42) ),
1288 maxlength_(maxlength)
1291 template<
class K,
int n,
class Al,
class X,
class Y>
1300 template<
class K,
int n,
class Al,
class X,
class Y>
1303 ::resetIndexForNextDomain()
1308 template<
class K,
int n,
class Al,
class X,
class Y>
1316 template<
class K,
int n,
class Al,
class X,
class Y>
1324 template<
class K,
int n,
class Al,
class X,
class Y>
1332 template<
class K,
int n,
class Al,
class X,
class Y>
1341 assert(i<maxlength_);
1342 rhs()[i]=(*b)[domainIndex][j];
1349 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1351 (*col).mv((*x)[
col.index()], tmp);
1354 assert(i<maxlength_);
1361 assert(i<maxlength_);
1362 rhs()[i]=(*b)[domainIndex][j];
1368 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1370 rhs()[i]-=(*col)[j][k] * (*x)[
col.index()][k];
1377 template<
class K,
int n,
class Al,
class X,
class Y>
1384 assert(i<maxlength_);
1389 #if HAVE_SUPERLU || HAVE_UMFPACK
1391 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1399 x(&x_), i(0), maxlength_(maxlength)
1406 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1413 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1420 assert(i<maxlength_);
1421 rhs_[i]=(*b)[domainIndex][j];
1429 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1431 (*col).mv((*x)[
col.index()], tmp);
1434 assert(i<maxlength_);
1442 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1446 assert(i<maxlength_);
1452 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1457 assert(i<maxlength_);
1462 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1468 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1475 template<
template<
class>
class S,
int n,
int m,
typename T,
typename A>
1484 template<
class M,
class X,
class Y>
1493 rhs_=
new Y(maxlength);
1494 lhs_ =
new X(maxlength);
1497 template<
class M,
class X,
class Y>
1504 template<
class M,
class X,
class Y>
1507 (*rhs_)[i]=(*b)[domainIndex];
1510 typedef typename matrix_type::ConstColIterator col_iterator;
1513 for(col_iterator
col=(*
mat)[domainIndex].begin();
col!=(*mat)[domainIndex].end(); ++
col) {
1514 (*col).mmv((*x)[
col.index()], (*rhs_)[i]);
1520 template<
class M,
class X,
class Y>
1526 template<
class M,
class X,
class Y>
1532 template<
class M,
class X,
class Y>
1538 template<
class M,
class X,
class Y>
1544 template<
class M,
class X,
class Y>
1550 template<
typename S,
typename T,
typename A,
int n>
1555 : v(&v_), x(&x_), assigner(&assigner_), relax(relax_)
1558 template<
typename S,
typename T,
typename A,
int n>
1562 assigner->assignResult((*v)[domainIndex]);
1566 template<
typename S,
typename T,
typename A,
int n>
1574 template<
typename S,
typename T,
typename A,
int n>
1579 : x(&x_), assigner(&assigner_), relax(relax_)
1581 DUNE_UNUSED_PARAMETER(v_);
1585 template<
typename S,
typename T,
typename A,
int n>
1589 assigner->relaxResult(relax);
1590 assigner->assignResult((*x)[domainIndex]);
1594 template<
typename S,
typename T,
typename A,
int n>
solver_vector::iterator solver_iterator
Definition: overlappingschwarz.hh:604
smoother::range_type range_type
Definition: overlappingschwarz.hh:668
std::vector< slu, typename TA::template rebind< slu >::other > slu_vector
The vector type containing subdomain solvers.
Definition: overlappingschwarz.hh:807
Matrix::const_iterator Iter
Definition: overlappingschwarz.hh:51
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:26
void copyToColCompMatrix(F &initializer, const MRS &mrs)
Definition: colcompmatrix.hh:431
Tag that the tells the schwarz method to be additive.
Definition: overlappingschwarz.hh:115
TM Mode
The mode (additive or multiplicative) of the Schwarz method.
Definition: overlappingschwarz.hh:776
Initializer for SuperLU Matrices representing the subdomains.
Definition: overlappingschwarz.hh:42
M matrix_type
Definition: overlappingschwarz.hh:722
Definition: ilusubdomainsolver.hh:107
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:149
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:670
T2 subdomain_vector
Definition: overlappingschwarz.hh:633
template meta program for choosing how to add the correction.
Definition: overlappingschwarz.hh:568
Definition: overlappingschwarz.hh:213
subdomain_vector::const_reverse_iterator domain_iterator
Definition: overlappingschwarz.hh:634
solver_vector::reverse_iterator solver_iterator
Definition: overlappingschwarz.hh:632
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
AdditiveAdder< S, X > Adder
Definition: overlappingschwarz.hh:574
S< BCRSMatrix< FieldMatrix< T, n, m >, A > >::range_type range_type
Definition: overlappingschwarz.hh:318
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:448
subdomain_vector::const_iterator domain_iterator
Definition: overlappingschwarz.hh:606
Helper template meta program for application of overlapping schwarz.
Definition: overlappingschwarz.hh:601
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
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:580
void resetIndexForNextDomain()
Resets the local index to zero.
Definition: overlappingschwarz.hh:1545
SeqOverlappingSchwarz< M, X, SymmetricMultiplicativeSchwarzMode, TD, TA > smoother
Definition: overlappingschwarz.hh:679
T smoother
Definition: overlappingschwarz.hh:667
OverlappingAssignerILUBase(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:1485
void operator()(const size_type &domain)
calculate one entry of the local defect.
Definition: overlappingschwarz.hh:1505
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:645
virtual void apply(X &v, const X &d)
Apply the precondtioner.
Definition: overlappingschwarz.hh:1229
Definition: overlappingschwarz.hh:1105
This file implements a vector space as a tensor product of a given vector space. The number of compon...
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:650
iterator class for sequential access
Definition: basearray.hh:594
K field_type
Definition: overlappingschwarz.hh:146
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:1527
A vector of blocks with memory management.
Definition: bvector.hh:253
BCRSMatrix< FieldMatrix< T, m, n >, A > matrix_type
Definition: overlappingschwarz.hh:712
Y range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:151
Tag that tells the Schwarz method to be multiplicative.
Definition: overlappingschwarz.hh:121
Templates characterizing the type of a solver.
Definition: solvertype.hh:27
Helper template meta program for application of overlapping schwarz.
Definition: overlappingschwarz.hh:665
static int size(const Domain &d)
Definition: overlappingschwarz.hh:1111
A sparse block matrix with compressed row storage.
Definition: bcrsmatrix.hh:413
K field_type
Definition: overlappingschwarz.hh:229
I InitializerList
Definition: overlappingschwarz.hh:48
Iterator end()
Get iterator to one beyond last row.
Definition: bcrsmatrix.hh:632
void copyValue(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:935
T1 solver_vector
Definition: overlappingschwarz.hh:631
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:494
Tag that tells the Schwarz method to be multiplicative and symmetric.
Definition: overlappingschwarz.hh:128
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:641
void deallocate()
Deallocates memory of the local vector.
Definition: overlappingschwarz.hh:1498
BCRSMatrix< FieldMatrix< T, n, m >, A > matrix_type
Definition: overlappingschwarz.hh:317
BCRSMatrix< FieldMatrix< K, n, n >, Al > matrix_type
Definition: overlappingschwarz.hh:702
virtual void pre(X &x, X &b)
Prepare the preconditioner.
Definition: overlappingschwarz.hh:849
A::size_type size_type
Definition: overlappingschwarz.hh:526
M matrix_type
The type of the matrix to precondition.
Definition: overlappingschwarz.hh:758
Col col
Definition: matrixmatrix.hh:347
Definition: overlappingschwarz.hh:720
Exact subdomain solver using ILU(p) with appropriate p.
Definition: ilusubdomainsolver.hh:74
Definition: overlappingschwarz.hh:400
range_type::block_type block_type
Definition: overlappingschwarz.hh:320
T1 solver_vector
Definition: overlappingschwarz.hh:603
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:409
Y & rhs()
Get the local right hand side.
Definition: overlappingschwarz.hh:1539
OverlappingSchwarzInitializer(InitializerList &il, const IndexSet &indices, const subdomain_vector &domains)
Definition: overlappingschwarz.hh:889
Dune::remove_const< M >::type rilu_type
Definition: overlappingschwarz.hh:147
Definition: overlappingschwarz.hh:690
static std::size_t assembleLocalProblems(const RowToDomain &rowToDomain, const matrix_type &mat, Solvers &solvers, const SubDomains &domains, bool onTheFly)
Definition: overlappingschwarz.hh:1199
Matrix & A
Definition: matrixmatrix.hh:216
Category for sequential solvers.
Definition: solvercategory.hh:22
void calcColstart() const
Definition: overlappingschwarz.hh:928
M::field_type field_type
Definition: overlappingschwarz.hh:405
Implementation of the BCRSMatrix class.
static void apply(smoother &sm, range_type &v, const range_type &b)
Definition: overlappingschwarz.hh:682
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:608
TD slu
The type for the subdomain solver in use.
Definition: overlappingschwarz.hh:804
range_type::block_type block_type
Definition: overlappingschwarz.hh:231
void relaxResult(field_type relax)
relax the result.
Definition: overlappingschwarz.hh:1521
MM_TYPE type
Definition: matrixmarket.hh:267
The category the precondtioner is part of.
Definition: overlappingschwarz.hh:811
T2 subdomain_vector
Definition: overlappingschwarz.hh:605
matrix_type::size_type size_type
Definition: overlappingschwarz.hh:232
AtomInitializer::Matrix Matrix
Definition: overlappingschwarz.hh:50
Sequential overlapping Schwarz preconditioner.
Definition: colcompmatrix.hh:157
X range_type
The range type of the preconditioner.
Definition: overlappingschwarz.hh:768
Row row
Definition: matrixmatrix.hh:345
D subdomain_vector
The vector type containing the subdomain to row index mapping.
Definition: overlappingschwarz.hh:46
OverlappingAssignerHelper(std::size_t maxlength, const M &mat, const Y &b, X &x)
Constructor.
Definition: overlappingschwarz.hh:513
void addRowNnz(const Iter &row)
Definition: overlappingschwarz.hh:897
void apply(DynamicVector< field_type > &v, DynamicVector< field_type > &d)
Apply the subdomain solver.
Definition: overlappingschwarz.hh:157
Matrix::row_type::const_iterator CIter
Definition: overlappingschwarz.hh:52
Exact subdomain solver using Dune::DynamicMatrix::solve.
Definition: overlappingschwarz.hh:136
Iterator begin()
Get iterator to first row.
Definition: bcrsmatrix.hh:626
X domain_type
The domain type of the preconditioner.
Definition: overlappingschwarz.hh:763
matrix_type::size_type size_type
The return type of the size method.
Definition: overlappingschwarz.hh:784
M matrix_type
Definition: overlappingschwarz.hh:403
InitializerList::value_type AtomInitializer
Definition: overlappingschwarz.hh:49
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
X & lhs()
Get the local left hand side.
Definition: overlappingschwarz.hh:1533
Definition: colcompmatrix.hh:160
Y range_type
Definition: overlappingschwarz.hh:230
void createMatrix() const
Definition: overlappingschwarz.hh:949
static domain_iterator begin(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:617
Definition: overlappingschwarz.hh:520
void setSubMatrix(const M &BCRS, S &rowset)
Set the data of the local problem.
Definition: overlappingschwarz.hh:179
Classes for using UMFPack with ISTL matrices.
void countEntries(const Iter &row, const CIter &col) const
Definition: overlappingschwarz.hh:916
BCRSMatrix< FieldMatrix< K, n, n >, Al > matrix_type
Definition: overlappingschwarz.hh:228
virtual void post(X &x)
Postprocess the preconditioner.
Definition: overlappingschwarz.hh:867
SLList< size_type, typename TA::template rebind< size_type >::other > subdomain_list
The type for the row to subdomain mapping.
Definition: overlappingschwarz.hh:798
S IndexSet
Definition: overlappingschwarz.hh:54
Definition: overlappingschwarz.hh:540
smoother::range_type range_type
Definition: overlappingschwarz.hh:680
TA allocator
The allocator to use.
Definition: overlappingschwarz.hh:787
A::size_type size_type
Definition: overlappingschwarz.hh:546
Matrix & mat
Definition: matrixmatrix.hh:343
Various local subdomain solvers based on ILU for SeqOverlappingSchwarz.
IndexSet::size_type size_type
Definition: overlappingschwarz.hh:55
Dune::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition: overlappingschwarz.hh:145
Definition: overlappingschwarz.hh:209
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
void allocate()
Definition: overlappingschwarz.hh:907
X::field_type field_type
The field type of the preconditioner.
Definition: overlappingschwarz.hh:781
static domain_iterator end(const subdomain_vector &sv)
Definition: overlappingschwarz.hh:622
MultiplicativeAdder< S, X > Adder
Definition: overlappingschwarz.hh:586
Y::block_type block_type
Definition: overlappingschwarz.hh:407
Classes for using SuperLU with ISTL matrices.
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
Define general preconditioner interface.
static solver_iterator begin(solver_vector &sv)
Definition: overlappingschwarz.hh:636
static solver_iterator end(solver_vector &sv)
Definition: overlappingschwarz.hh:613
Definition: matrixutils.hh:25
range_type::field_type field_type
Definition: overlappingschwarz.hh:319