27 #ifndef EWOMS_OVERLAPPING_PRECONDITIONER_HH 28 #define EWOMS_OVERLAPPING_PRECONDITIONER_HH 32 #include <opm/common/Exceptions.hpp> 33 #include <opm/simulators/linalg/ilufirstelement.hh> 34 #include <dune/istl/preconditioner.hh> 36 #include <dune/common/version.hh> 44 template <
class SeqPreCond,
class Overlap>
46 :
public Dune::Preconditioner<typename SeqPreCond::domain_type,
47 typename SeqPreCond::range_type>
50 using domain_type =
typename SeqPreCond::domain_type;
51 using range_type =
typename SeqPreCond::range_type;
54 Dune::SolverCategory::Category
category()
const override 55 {
return Dune::SolverCategory::overlapping; }
58 : seqPreCond_(seqPreCond), overlap_(&overlap)
61 void pre(domain_type& x, range_type& y)
override 67 seqPreCond_.pre(x, y);
68 short localSuccess = 1;
69 MPI_Allreduce(&localSuccess,
78 short localSuccess = 0;
79 MPI_Allreduce(&localSuccess,
91 throw NumericalProblem(
"Preconditioner threw an exception in pre() method on some process.");
93 seqPreCond_.pre(x, y);
101 void apply(domain_type& x,
const range_type& d)
override 104 if (overlap_->peerSet().size() > 0) {
112 seqPreCond_.apply(x, d);
113 short localSuccess = 1;
114 MPI_Allreduce(&localSuccess,
123 short localSuccess = 0;
124 MPI_Allreduce(&localSuccess,
136 throw NumericalProblem(
"Preconditioner threw an exception on some process.");
140 seqPreCond_.apply(x, d);
143 void post(domain_type& x)
override 150 short localSuccess = 1;
151 MPI_Allreduce(&localSuccess,
160 short localSuccess = 0;
161 MPI_Allreduce(&localSuccess,
173 throw NumericalProblem(
"Preconditioner threw an exception in post() method on " 181 SeqPreCond& seqPreCond_;
182 const Overlap *overlap_;
An overlap aware preconditioner for any ISTL linear solver.
Definition: overlappingpreconditioner.hh:45
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Dune::SolverCategory::Category category() const override
the kind of computations supported by the operator. Either overlapping or non-overlapping ...
Definition: overlappingpreconditioner.hh:54
An overlap aware ISTL scalar product.