Loading...
Searching...
No Matches
mortar_schur.hpp
Go to the documentation of this file.
//==============================================================================
//==============================================================================
#ifndef MORTAR_SCHUR_HPP_
#define MORTAR_SCHUR_HPP_
#include <dune/istl/matrixmatrix.hh>
#include <opm/elasticity/applier.hpp>
#include <opm/elasticity/matrixops.hpp>
namespace Opm {
namespace Elasticity {
template<class T>
class MortarBlockEvaluator : public Dune::LinearOperator<Vector, Vector> {
public:
MortarBlockEvaluator(T& Ai_,
const Matrix& B_) :
Ai(Ai_), B(B_), op(Ai)
{
}
void apply(const Vector& x, Vector& y) const override
{
y = 0;
applyscaleadd(1.0, x, y);
}
void applyscaleadd(field_type alpha, const Vector& x, Vector& y) const override
{
Vector temp1(B.N());
B.mv(x, temp1);
Vector temp(temp1.size());
op.pre(temp, temp1);
Dune::InverseOperatorResult res;
temp = 0;
op.pre(temp, temp1);
op.apply(temp, temp1);
op.post(temp);
B.usmtv(alpha, temp, y);
}
Dune::SolverCategory::Category category() const override
{
return Dune::SolverCategory::sequential;
}
protected:
T& Ai;
const Matrix& B;
mutable OperatorApplier<T> op;
};
}
}
#endif
applier.hpp
Helper class for abstracting differences between inverse operators and preconditioners in DUNE.
Opm::Elasticity::MortarBlockEvaluator::apply
void apply(const Vector &x, Vector &y) const override
Apply the multiplier block.
Definition mortar_schur.hpp:42
Opm::Elasticity::MortarBlockEvaluator< Dune::Preconditioner< Vector, Vector > >::op
OperatorApplier< Dune::Preconditioner< Vector, Vector > > op
Definition mortar_schur.hpp:74
Opm::Elasticity::MortarBlockEvaluator::applyscaleadd
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
Opm::Elasticity::MortarBlockEvaluator< Dune::Preconditioner< Vector, Vector > >::B
const Matrix & B
Definition mortar_schur.hpp:73
Opm::Elasticity::MortarBlockEvaluator< Dune::Preconditioner< Vector, Vector > >::Ai
Dune::Preconditioner< Vector, Vector > & Ai
Definition mortar_schur.hpp:72
Opm::Elasticity::MortarBlockEvaluator::MortarBlockEvaluator
MortarBlockEvaluator(T &Ai_, const Matrix &B_)
Constructor.
Definition mortar_schur.hpp:33
matrixops.hpp
Helper class with some matrix operations.
Opm::Elasticity::Matrix
Dune::BCRSMatrix< Dune::FieldMatrix< double, 1, 1 > > Matrix
A sparse matrix holding our operator.
Definition matrixops.hpp:27
Opm::Elasticity::Vector
Dune::BlockVector< Dune::FieldVector< double, 1 > > Vector
A vector holding our RHS.
Definition matrixops.hpp:33
Opm
Inverting small matrices.
Definition ImplicitAssembly.hpp:43
Opm::Elasticity::OperatorApplier
Class abstracting a preconditioner or an inverse operator.
Definition applier.hpp:26