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>
31template<
class X,
class Y,
class C,
class T>
32class ParallelRestrictedOverlappingSchwarz;
48template<
class Range,
class Domain,
class ParallelInfo,
class SeqPreconditioner>
49struct ConstructionTraits<
Opm::ParallelRestrictedOverlappingSchwarz<Range,
54 typedef DefaultParallelConstructionArgs<SeqPreconditioner,ParallelInfo> Arguments;
55 typedef ConstructionTraits<SeqPreconditioner> SeqConstructionTraits;
64 construct(Arguments& args)
68 ParallelInfo,SeqPreconditioner>;
69 return std::make_shared<PROS>(*SeqConstructionTraits::construct(args),
75 <Range,Domain,ParallelInfo,SeqPreconditioner>* bp)
78 ::deconstruct(
static_cast<SeqPreconditioner*
>(&bp->preconditioner));
90template<
class Range,
class Domain,
class ParallelInfo,
class SeqPreconditioner>
91struct SmootherTraits<
Opm::ParallelRestrictedOverlappingSchwarz<Range,
96 typedef DefaultSmootherArgs<typename SeqPreconditioner::matrix_type::field_type> Arguments;
126template<
class Range,
class Domain,
class ParallelInfo,
class SeqPreconditioner=Dune::Preconditioner<Range,Domain> >
128 :
public Dune::Preconditioner<Range,Domain> {
129 friend class Dune::Amg
133 SeqPreconditioner> >;
147 category=Dune::SolverCategory::overlapping
158 : preconditioner_(
p), communication_(
c)
166 virtual void pre (Domain& x, Range&
b)
168 communication_.copyOwnerToAll(x,x);
169 preconditioner_.pre(x,
b);
177 virtual void apply (Domain&
v,
const Range&
d)
182 template<
bool forward>
183 void apply (Domain&
v,
const Range&
d)
186 Range&
md =
const_cast<Range&
>(
d);
187 communication_.copyOwnerToAll(
md,
md);
189 communication_.copyOwnerToAll(
v,
v);
191 communication_.project(
md);
201 preconditioner_.post(x);
Definition AquiferInterface.hpp:35
Block parallel preconditioner.
Definition ParallelRestrictedAdditiveSchwarz.hpp:128
ParallelRestrictedOverlappingSchwarz(SeqPreconditioner &p, const communication_type &c)
Constructor.
Definition ParallelRestrictedAdditiveSchwarz.hpp:157
virtual void post(Range &x)
Clean up.
Definition ParallelRestrictedAdditiveSchwarz.hpp:199
Domain::field_type field_type
The field type of the preconditioner.
Definition ParallelRestrictedAdditiveSchwarz.hpp:140
Domain domain_type
The domain type of the preconditioner.
Definition ParallelRestrictedAdditiveSchwarz.hpp:136
Range range_type
The range type of the preconditioner.
Definition ParallelRestrictedAdditiveSchwarz.hpp:138
ParallelInfo communication_type
The type of the communication object.
Definition ParallelRestrictedAdditiveSchwarz.hpp:142
virtual void apply(Domain &v, const Range &d)
Apply the preconditioner.
Definition ParallelRestrictedAdditiveSchwarz.hpp:177
virtual void pre(Domain &x, Range &b)
Prepare the preconditioner.
Definition ParallelRestrictedAdditiveSchwarz.hpp:166
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27
static void deconstruct(Opm::ParallelRestrictedOverlappingSchwarz< Range, Domain, ParallelInfo, SeqPreconditioner > *bp)
Deconstruct and free a parallel restricted overlapping schwarz preconditioner.
Definition ParallelRestrictedAdditiveSchwarz.hpp:74
std::shared_ptr< Opm::ParallelRestrictedOverlappingSchwarz< Range, Domain, ParallelInfo, SeqPreconditioner > > ParallelRestrictedOverlappingSchwarzPointer
Construct a parallel restricted overlapping schwarz preconditioner.
Definition ParallelRestrictedAdditiveSchwarz.hpp:61