Skip to content
Snippets Groups Projects
Commit ba71efe8 authored by Christian Engwer's avatar Christian Engwer
Browse files

[compatibility] allow to disable the compatibility layer

depending on a preprocessor define we switch the base classes to be
pure virtual, or implement a dummy category(). If the classes are pure
virtual the old interface with an enum is not possible anymore.

To enable/disable the backwards compatibility check we provide a cmake
flag DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE, which defaults to 1
(e.g. backwards compatibility enabled).
parent b558896c
No related branches found
No related tags found
No related merge requests found
......@@ -12,3 +12,7 @@ find_package(ARPACKPP)
include(AddARPACKPPFlags)
find_package(SuiteSparse OPTIONAL_COMPONENTS LDL SPQR UMFPACK)
include(AddSuiteSparseFlags)
# enable / disable backwards compatibility w.r.t. category
set(DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE 1
"Enable/Disable the backwards compatibility of the category enum/method in dune-istl solvers, preconditioner, etc. '1'")
......@@ -84,9 +84,13 @@ namespace Dune {
//! Category of the linear operator (see SolverCategory::Category)
virtual SolverCategory::Category category() const
#ifdef DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE
{
DUNE_THROW(Dune::Exception,"It is necessary to implement the category method in a derived classes, in the future this method will pure virtual.");
};
#else
= 0;
#endif
};
......
......@@ -77,9 +77,13 @@ namespace Dune {
//! Category of the preconditioner (see SolverCategory::Category)
virtual SolverCategory::Category category() const
#ifdef DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE
{
DUNE_THROW(Dune::Exception,"It is necessary to implement the category method in a derived classes, in the future this method will pure virtual.");
}
#else
= 0;
#endif
//! every abstract base class has a virtual destructor
virtual ~Preconditioner () {}
......
......@@ -128,9 +128,13 @@ namespace Dune
//! Category of the solver (see SolverCategory::Category)
virtual SolverCategory::Category category() const
#ifdef DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE
{
DUNE_THROW(Dune::Exception,"It is necessary to implement the category method in a derived classes, in the future this method will pure virtual.");
}
#else
= 0;
#endif
//! \brief Destructor
virtual ~InverseOperator () {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment