dune-istl  2.7.1
About: dune-istl - DUNE (Distributed and Unified Numerics Environment) is a modular toolbox for solving partial differential equations (PDEs) with grid-based methods: DUNE Iterative Solver Template Library.
  Fossies Dox: dune-istl-2.7.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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 
11  /**
12  @addtogroup ISTL_Solvers
13  @{
14  */
15 
16  /**
17  * @brief Categories for the solvers.
18  */
20  {
21  enum Category {
22  //! \brief Category for sequential solvers
24  //! \brief Category for non-overlapping solvers
26  //! \brief Category for overlapping solvers
28  };
29 
30  /** \brief Helperfunction to extract the solver category either from an enum, or from the newly introduced virtual member function */
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 
54  /** @} end documentation */
55 
56 } // end namespace
57 
58 #endif
Definition: allocator.hh:7
Categories for the solvers.
static Category category(const OP &op, decltype(op.category) *=nullptr)
@ sequential
Category for sequential solvers.
@ nonoverlapping
Category for non-overlapping solvers.
@ overlapping
Category for overlapping solvers.
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...