Skip to content
Snippets Groups Projects
Commit ef3deb1f authored by Markus Blatt's avatar Markus Blatt
Browse files

Removed base class Operator because of name clash with Operator in FEM

code of Freiburg.

[[Imported from SVN: r334]]
parent 637073cc
No related branches found
No related tags found
No related merge requests found
...@@ -28,10 +28,15 @@ namespace Dune { ...@@ -28,10 +28,15 @@ namespace Dune {
// Abstract operator interface // Abstract operator interface
//===================================================================== //=====================================================================
/*! Abstract base class defining an operator \f$ A : X\to Y\f$. The
/*!
@brief A linear operator.
Abstract base class defining a linear operator \f$ A : X\to Y\f$,
i.e. \f$ A(\alpha x) = \alpha A(x) \f$ and
\f$ A(x+y) = A(x)+A(y)\f$ hold. The
simplest solvers just need the application \f$ A(x)\f$ of simplest solvers just need the application \f$ A(x)\f$ of
the operator. The operator might even be nonlinear (but is not in the operator.
our application here).
- enables on the fly computation through operator concept. If explicit - enables on the fly computation through operator concept. If explicit
representation of the operator is required use AssembledLinearOperator representation of the operator is required use AssembledLinearOperator
...@@ -41,37 +46,21 @@ namespace Dune { ...@@ -41,37 +46,21 @@ namespace Dune {
derived class derived class
*/ */
template<class X, class Y> template<class X, class Y>
class Operator { class LinearOperator {
public: public:
//! export types, they come from the derived class //! The type of the domain of the operator.
typedef X domain_type; typedef X domain_type;
//! The type of the range of the operator.
typedef Y range_type; typedef Y range_type;
//! The field type of the operator.
typedef typename X::field_type field_type; typedef typename X::field_type field_type;
/*! \brief apply operator to x: \f$ y = A(x) \f$ /*! \brief apply operator to x: \f$ y = A(x) \f$
The input vector is consistent and the output must also be The input vector is consistent and the output must also be
consistent on the interior+border partition. consistent on the interior+border partition.
*/ */
virtual void apply (const X& x, Y& y) const = 0; virtual void apply (const X& x, Y& y) const = 0;
//! every abstract base class has a virtual destructor
virtual ~Operator () {}
};
/*! This type ensures that the operator \f$ A \f$ is a
linear operator, i.e. \f$ A(\alpha x) = \alpha A(x) \f$ and
\f$ A(x+y) = A(x)+A(y)\f$. The additional interface function
reflects this fact.
*/
template<class X, class Y>
class LinearOperator : public Operator<X,Y> {
public:
//! export types, they come from the derived class
typedef X domain_type;
typedef Y range_type;
typedef typename X::field_type field_type;
//! apply operator to x, scale and add: \f$ y = y + \alpha A(x) \f$ //! apply operator to x, scale and add: \f$ y = y + \alpha A(x) \f$
virtual void applyscaleadd (field_type alpha, const X& x, Y& y) const = 0; virtual void applyscaleadd (field_type alpha, const X& x, Y& y) const = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment