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>
32 class ParallelRestrictedOverlappingSchwarz;
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;
58 #if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
71 construct(Arguments& args)
74 #if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
78 <Range,Domain,ParallelInfo,SeqPreconditioner>(*SeqConstructionTraits ::construct(args),
80 #
if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
89 <Range,Domain,ParallelInfo,SeqPreconditioner>* bp)
92 ::deconstruct(
static_cast<SeqPreconditioner*
>(&bp->preconditioner));
104 template<
class Range,
class Domain,
class ParallelInfo,
class SeqPreconditioner>
105 struct SmootherTraits<
Opm::ParallelRestrictedOverlappingSchwarz<Range,
110 typedef DefaultSmootherArgs<typename SeqPreconditioner::matrix_type::field_type> Arguments;
140 template<
class Range,
class Domain,
class ParallelInfo,
class SeqPreconditioner=Dune::Preconditioner<Range,Domain> >
142 :
public Dune::Preconditioner<Range,Domain> {
143 friend class Dune::Amg
144 ::ConstructionTraits<ParallelRestrictedOverlappingSchwarz<Range,
147 SeqPreconditioner> >;
161 category=Dune::SolverCategory::overlapping
172 : preconditioner_(p), communication_(c)
180 virtual void pre (Domain& x, Range& b)
182 communication_.copyOwnerToAll(x,x);
183 preconditioner_.pre(x,b);
191 virtual void apply (Domain& v,
const Range& d)
196 template<
bool forward>
197 void apply (Domain& v,
const Range& d)
200 Range& md =
const_cast<Range&
>(d);
201 communication_.copyOwnerToAll(md,md);
202 preconditioner_.template apply<forward>(v,d);
203 communication_.copyOwnerToAll(v,v);
205 communication_.project(md);
215 preconditioner_.post(x);
220 SeqPreconditioner& preconditioner_;
Block parallel preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:142
ParallelRestrictedOverlappingSchwarz(SeqPreconditioner &p, const communication_type &c)
Constructor.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:171
virtual void post(Range &x)
Clean up.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:213
Domain::field_type field_type
The field type of the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:154
Domain domain_type
The domain type of the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:150
Range range_type
The range type of the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:152
ParallelInfo communication_type
The type of the communication object.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:156
virtual void apply(Domain &v, const Range &d)
Apply the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:191
virtual void pre(Domain &x, Range &b)
Prepare the preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:180
@ category
The category the precondtioner is part of.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:161
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27
Opm::ParallelRestrictedOverlappingSchwarz< Range, Domain, ParallelInfo, SeqPreconditioner > * ParallelRestrictedOverlappingSchwarzPointer
Construct a parallel restricted overlapping schwarz preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:67
static void deconstruct(Opm::ParallelRestrictedOverlappingSchwarz< Range, Domain, ParallelInfo, SeqPreconditioner > *bp)
Deconstruct and free a parallel restricted overlapping schwarz preconditioner.
Definition: ParallelRestrictedAdditiveSchwarz.hpp:88