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)
169 communication_.copyOwnerToAll(x,x);
170 preconditioner_.pre(x,
b);
178 virtual void apply (Domain&
v,
const Range&
d)
183 template<
bool forward>
184 void apply (Domain&
v,
const Range&
d)
188 Range&
md =
const_cast<Range&
>(
d);
189 communication_.copyOwnerToAll(
md,
md);
191 communication_.copyOwnerToAll(
v,
v);
193 communication_.project(
md);
204 preconditioner_.post(x);
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:201
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:178
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 blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
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