25 #ifndef EWOMS_OVERLAPPING_PRECONDITIONER_HH
26 #define EWOMS_OVERLAPPING_PRECONDITIONER_HH
30 #include <opm/common/Exceptions.hpp>
31 #include <opm/common/ErrorMacros.hpp>
33 #include <dune/istl/preconditioners.hh>
41 template <
class SeqPreCond,
class Overlap>
43 :
public Dune::Preconditioner<typename SeqPreCond::domain_type,
44 typename SeqPreCond::range_type>
50 enum {
category = Dune::SolverCategory::overlapping };
53 : seqPreCond_(seqPreCond), overlap_(&overlap)
56 void pre(domain_type &x, range_type &y)
62 seqPreCond_.pre(x, y);
63 short localSuccess = 1;
64 MPI_Allreduce(&localSuccess,
73 short localSuccess = 0;
74 MPI_Allreduce(&localSuccess,
86 OPM_THROW(Opm::NumericalProblem,
87 "Preconditioner threw an exception in pre() method on some process.");
89 seqPreCond_.pre(x, y);
97 void apply(domain_type &x,
const range_type &d)
100 if (overlap_->peerSet().size() > 0) {
108 seqPreCond_.apply(x, d);
109 short localSuccess = 1;
110 MPI_Allreduce(&localSuccess,
119 short localSuccess = 0;
120 MPI_Allreduce(&localSuccess,
132 OPM_THROW(Opm::NumericalProblem,
133 "Preconditioner threw an exception on some process.");
137 seqPreCond_.apply(x, d);
147 short localSuccess = 1;
148 MPI_Allreduce(&localSuccess,
157 short localSuccess = 0;
158 MPI_Allreduce(&localSuccess,
170 OPM_THROW(Opm::NumericalProblem,
"Preconditioner threw an "
171 "exception in post() method on "
179 SeqPreCond &seqPreCond_;
180 const Overlap *overlap_;
SeqPreCond::range_type range_type
Definition: overlappingpreconditioner.hh:48
void pre(domain_type &x, range_type &y)
Definition: overlappingpreconditioner.hh:56
An overlap aware preconditioner for any ISTL linear solver.
Definition: overlappingpreconditioner.hh:42
void post(domain_type &x)
Definition: overlappingpreconditioner.hh:140
An overlap aware ISTL scalar product.
Definition: baseauxiliarymodule.hh:35
void apply(domain_type &x, const range_type &d)
Definition: overlappingpreconditioner.hh:97
Definition: overlappingpreconditioner.hh:50
SeqPreCond::domain_type domain_type
Definition: overlappingpreconditioner.hh:47
OverlappingPreconditioner(SeqPreCond &seqPreCond, const Overlap &overlap)
Definition: overlappingpreconditioner.hh:52