mortar_schur.hpp
Go to the documentation of this file.
1 //==============================================================================
11 //==============================================================================
12 #ifndef MORTAR_SCHUR_HPP_
13 #define MORTAR_SCHUR_HPP_
14 
15 #include <dune/istl/matrixmatrix.hh>
18 
19 namespace Opm {
20 namespace Elasticity {
21 
26  template<class T>
27 class MortarBlockEvaluator : public Dune::LinearOperator<Vector, Vector> {
28  public:
29  // define the category
30  enum {
32  category=Dune::SolverCategory::sequential
33  };
34 
39  const Matrix& B_) :
40  Ai(Ai_), B(B_), op(Ai)
41  {
42  }
43 
47  void apply(const Vector& x, Vector& y) const
48  {
49  y = 0;
50  applyscaleadd(1.0, x, y);
51  }
52 
57  void applyscaleadd(field_type alpha, const Vector& x, Vector& y) const
58  {
59  Vector temp1(B.N());
60  B.mv(x, temp1);
61  Vector temp(temp1.size());
62  op.pre(temp, temp1);
63  Dune::InverseOperatorResult res;
64  temp = 0;
65  op.pre(temp, temp1);
66  op.apply(temp, temp1);
67  op.post(temp);
68  B.usmtv(alpha, temp, y);
69  }
70  protected:
71  T& Ai;
72  const Matrix& B;
74 };
75 
76 }
77 }
78 
79 #endif
void applyscaleadd(field_type alpha, const Vector &x, Vector &y) const
Apply the multiplier block with an embedded axpy.
Definition: mortar_schur.hpp:57
Definition: applier.hpp:18
Helper class for abstracting differences between inverse operators and preconditioners in DUNE...
T & Ai
Reference to solver or evaluator for inverse operator.
Definition: mortar_schur.hpp:71
Class abstracting a preconditioner or an inverse operator.
Definition: applier.hpp:23
void apply(const Vector &x, Vector &y) const
Apply the multiplier block.
Definition: mortar_schur.hpp:47
Definition: mortar_schur.hpp:27
Dune::BCRSMatrix< Dune::FieldMatrix< double, 1, 1 > > Matrix
A sparse matrix holding our operator.
Definition: matrixops.hpp:23
Helper class with some matrix operations.
MortarBlockEvaluator(T &Ai_, const Matrix &B_)
Constructor.
Definition: mortar_schur.hpp:38
const Matrix & B
Reference to the mortar coupling matrix.
Definition: mortar_schur.hpp:72
The category the preconditioner is part of.
Definition: mortar_schur.hpp:32
Dune::BlockVector< Dune::FieldVector< double, 1 > > Vector
A vector holding our RHS.
Definition: matrixops.hpp:29
OperatorApplier< T > op
Applier for the preconditioner / inverse solver.
Definition: mortar_schur.hpp:73