20 #ifndef OPM_PARALLELRESTRICTEDADDITIVESCHWARZ_HEADER_INCLUDED
21 #define OPM_PARALLELRESTRICTEDADDITIVESCHWARZ_HEADER_INCLUDED
23 #include <opm/common/utility/platform_dependent/disable_warnings.h>
24 #include <dune/istl/preconditioner.hh>
25 #include <dune/istl/paamg/smoother.hh>
26 #include <opm/common/utility/platform_dependent/reenable_warnings.h>
31 template<
class X,
class Y,
class C,
class T>
48 template<
class Range,
class Domain,
class ParallelInfo,
class SeqPreconditioner>
49 struct ConstructionTraits<Opm::ParallelRestrictedOverlappingSchwarz<Range,
54 typedef DefaultParallelConstructionArgs<SeqPreconditioner,ParallelInfo> Arguments;
55 typedef ConstructionTraits<SeqPreconditioner> SeqConstructionTraits;
65 <Range,Domain,ParallelInfo,SeqPreconditioner>(*SeqConstructionTraits
72 <Range,Domain,ParallelInfo,SeqPreconditioner>* bp)
75 ::deconstruct(static_cast<SeqPreconditioner*>(&bp->preconditioner));
87 template<
class Range,
class Domain,
class ParallelInfo,
class SeqPreconditioner>
88 struct SmootherTraits<Opm::ParallelRestrictedOverlappingSchwarz<Range,
93 typedef DefaultSmootherArgs<typename SeqPreconditioner::matrix_type::field_type> Arguments;
123 template<
class Range,
class Domain,
class ParallelInfo,
class SeqPreconditioner=Dune::Preconditioner<Range,Domain> >
124 class ParallelRestrictedOverlappingSchwarz
125 :
public Dune::Preconditioner<Range,Domain> {
126 friend class Dune::Amg
127 ::ConstructionTraits<ParallelRestrictedOverlappingSchwarz<Range,
130 SeqPreconditioner> >;
155 : preconditioner_(p), communication_(c)
163 virtual void pre (Domain& x, Range& b)
165 communication_.copyOwnerToAll(x,x);
166 preconditioner_.pre(x,b);
174 virtual void apply (Domain& v,
const Range& d)
179 template<
bool forward>
180 void apply (Domain& v,
const Range& d)
183 Range& md =
const_cast<Range&
>(d);
184 communication_.copyOwnerToAll(md,md);
185 preconditioner_.template apply<forward>(v,d);
186 communication_.copyOwnerToAll(v,v);
188 communication_.project(md);
198 preconditioner_.post(x);
203 SeqPreconditioner& preconditioner_;
ParallelInfo communication_type
The type of the communication object.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:139
ParallelRestrictedOverlappingSchwarz(SeqPreconditioner &p, const communication_type &c)
Constructor.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:154
virtual void pre(Domain &x, Range &b)
Prepare the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:163
static void deconstruct(Opm::ParallelRestrictedOverlappingSchwarz< Range, Domain, ParallelInfo, SeqPreconditioner > *bp)
Deconstruct and free a parallel restricted overlapping schwarz preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:71
Block parallel preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:32
virtual void apply(Domain &v, const Range &d)
Apply the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:174
Domain domain_type
The domain type of the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:133
virtual void post(Range &x)
Clean up.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:196
The category the precondtioner is part of.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:144
Range range_type
The range type of the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:135
Domain::field_type field_type
The field type of the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:137
static Opm::ParallelRestrictedOverlappingSchwarz< Range, Domain, ParallelInfo, SeqPreconditioner > * construct(Arguments &args)
Construct a parallel restricted overlapping schwarz preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:62