opm-upscaling
applier.hpp
Go to the documentation of this file.
1 //==============================================================================
12 //==============================================================================
13 #ifndef APPLIER_H_
14 #define APPLIER_H_
15 
16 #include <dune/istl/solver.hh>
17 
19 
20 namespace Opm {
21  namespace Elasticity {
22 
24  template<class T>
26 {
29  explicit OperatorApplier(T& t) : A(t)
30  {
31  }
32 
36  void apply(Vector& v, Vector& d);
37 
41  void pre(Vector& x, Vector& b);
42 
45  void post(Vector& x);
46 
47  T& A;
48 };
49 
50 typedef OperatorApplier<Dune::InverseOperator<Vector, Vector> > InverseApplier;
51 typedef OperatorApplier<Dune::Preconditioner<Vector, Vector> > PreApplier;
52 
53  template<>
55 {
56  Dune::InverseOperatorResult r;
57  A.apply(v, d, r);
58 }
59 
60  template<>
61 void PreApplier::apply(Vector& v, Vector& d)
62 {
63  A.apply(v, d);
64 }
65 
66  template<>
67 void InverseApplier::pre(Vector& /* x */, Vector& /* b */)
68 {
69 }
70 
71  template<>
72 void PreApplier::pre(Vector& x, Vector& b)
73 {
74  A.pre(x,b);
75 }
76 
77  template<>
79 {
80 }
81 
82  template<>
83 void PreApplier::post(Vector& x)
84 {
85  A.post(x);
86 }
87 
88 }
89 }
90 
91 #endif
void post(Vector &x)
Postprocess a preconditioner, noop for an inverse operator.
Definition: applier.hpp:78
Helper class with some matrix operations.
OperatorApplier(T &t)
Constructor.
Definition: applier.hpp:29
Dune::BlockVector< Dune::FieldVector< double, 1 > > Vector
A vector holding our RHS.
Definition: matrixops.hpp:33
void apply(Vector &v, Vector &d)
Apply the given operator to a vector.
Definition: applier.hpp:54
Class abstracting a preconditioner or an inverse operator.
Definition: applier.hpp:25
Inverting small matrices.
Definition: ImplicitAssembly.hpp:43
void pre(Vector &x, Vector &b)
Preprocess a preconditioner, noop for an inverse operator.
Definition: applier.hpp:67