dune-istl  2.7.0
solvercategory.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_ISTL_SOLVERCATEGORY_HH
4 #define DUNE_ISTL_SOLVERCATEGORY_HH
5 
6 #include <dune/common/exceptions.hh>
7 
8 
9 namespace Dune {
10 
20  {
21  enum Category {
28  };
29 
31  template<typename OP>
32  static Category category(const OP& op, decltype(op.category())* = nullptr)
33  {
34  return op.category();
35  }
36 
37 #ifndef DOXYGEN
38  // template<typename OP>
39  // static Category category(const OP& op, decltype(op.getSolverCategory())* = nullptr)
40  // {
41  // return op.getSolverCategory();
42  // }
43 
44  template<typename OP>
45  static Category category(const OP& op, decltype(op.category)* = nullptr)
46  {
47  return OP::category;
48  }
49 #endif
50  };
51 
52  class InvalidSolverCategory : public InvalidStateException{};
53 
56 } // end namespace
57 
58 #endif
Dune::SolverCategory::sequential
@ sequential
Category for sequential solvers.
Definition: solvercategory.hh:23
Dune::SolverCategory::overlapping
@ overlapping
Category for overlapping solvers.
Definition: solvercategory.hh:27
Dune::SolverCategory
Categories for the solvers.
Definition: solvercategory.hh:19
Dune::SolverCategory::nonoverlapping
@ nonoverlapping
Category for non-overlapping solvers.
Definition: solvercategory.hh:25
Dune
Definition: allocator.hh:7
Dune::SolverCategory::category
static Category category(const OP &op, decltype(op.category()) *=nullptr)
Helperfunction to extract the solver category either from an enum, or from the newly introduced virtu...
Definition: solvercategory.hh:32
Dune::InvalidSolverCategory
Definition: solvercategory.hh:52
Dune::SolverCategory::Category
Category
Definition: solvercategory.hh:21