My Project
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 
34  const Matrix& B_) :
35  Ai(Ai_), B(B_), op(Ai)
36  {
37  }
38 
42  void apply(const Vector& x, Vector& y) const override
43  {
44  y = 0;
45  applyscaleadd(1.0, x, y);
46  }
47 
52  void applyscaleadd(field_type alpha, const Vector& x, Vector& y) const override
53  {
54  Vector temp1(B.N());
55  B.mv(x, temp1);
56  Vector temp(temp1.size());
57  op.pre(temp, temp1);
58  Dune::InverseOperatorResult res;
59  temp = 0;
60  op.pre(temp, temp1);
61  op.apply(temp, temp1);
62  op.post(temp);
63  B.usmtv(alpha, temp, y);
64  }
65 
66  Dune::SolverCategory::Category category() const override
67  {
68  return Dune::SolverCategory::sequential;
69  }
70 
71  protected:
72  T& Ai;
73  const Matrix& B;
75 };
76 
77 }
78 }
79 
80 #endif
Helper class for abstracting differences between inverse operators and preconditioners in DUNE.
This implements a operator evaluation for the schur mortar-block S = B^T*A^-1*B !
Definition: mortar_schur.hpp:27
void apply(const Vector &x, Vector &y) const override
Apply the multiplier block.
Definition: mortar_schur.hpp:42
OperatorApplier< T > op
Applier for the preconditioner / inverse solver.
Definition: mortar_schur.hpp:74
void applyscaleadd(field_type alpha, const Vector &x, Vector &y) const override
Apply the multiplier block with an embedded axpy.
Definition: mortar_schur.hpp:52
const Matrix & B
Reference to the mortar coupling matrix.
Definition: mortar_schur.hpp:73
T & Ai
Reference to solver or evaluator for inverse operator.
Definition: mortar_schur.hpp:72
MortarBlockEvaluator(T &Ai_, const Matrix &B_)
Constructor.
Definition: mortar_schur.hpp:33
Helper class with some matrix operations.
Dune::BCRSMatrix< Dune::FieldMatrix< double, 1, 1 > > Matrix
A sparse matrix holding our operator.
Definition: matrixops.hpp:27
Dune::BlockVector< Dune::FieldVector< double, 1 > > Vector
A vector holding our RHS.
Definition: matrixops.hpp:33
Inverting small matrices.
Definition: ImplicitAssembly.hpp:43
Class abstracting a preconditioner or an inverse operator.
Definition: applier.hpp:24