Loading...
Searching...
No Matches
applier.hpp
Go to the documentation of this file.
//==============================================================================
//==============================================================================
#ifndef APPLIER_H_
#define APPLIER_H_
#include <dune/istl/solver.hh>
#include <opm/elasticity/matrixops.hpp>
namespace Opm {
namespace Elasticity {
template<class T>
struct OperatorApplier
{
explicit OperatorApplier(T& t) : A(t)
{
}
void apply(Vector& v, Vector& d);
void pre(Vector& x, Vector& b);
void post(Vector& x);
T& A;
};
typedef OperatorApplier<Dune::InverseOperator<Vector, Vector> > InverseApplier;
typedef OperatorApplier<Dune::Preconditioner<Vector, Vector> > PreApplier;
template<>
void InverseApplier::apply(Vector& v, Vector& d)
{
Dune::InverseOperatorResult r;
A.apply(v, d, r);
}
template<>
void PreApplier::apply(Vector& v, Vector& d)
{
A.apply(v, d);
}
template<>
void InverseApplier::pre(Vector& /* x */, Vector& /* b */)
{
}
template<>
void PreApplier::pre(Vector& x, Vector& b)
{
A.pre(x,b);
}
template<>
void InverseApplier::post(Vector& /* x */)
{
}
template<>
void PreApplier::post(Vector& x)
{
A.post(x);
}
}
}
#endif
matrixops.hpp
Helper class with some matrix operations.
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
Opm::Elasticity::OperatorApplier::post
void post(Vector &x)
Postprocess a preconditioner, noop for an inverse operator.
Opm::Elasticity::OperatorApplier::OperatorApplier
OperatorApplier(T &t)
Constructor.
Definition applier.hpp:29
Opm::Elasticity::OperatorApplier::pre
void pre(Vector &x, Vector &b)
Preprocess a preconditioner, noop for an inverse operator.
Opm::Elasticity::OperatorApplier::apply
void apply(Vector &v, Vector &d)
Apply the given operator to a vector.