Dune Core Modules (unstable)

solvercategory.hh
1 // SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
2 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 // vi: set et ts=4 sw=2 sts=2:
5 #ifndef DUNE_ISTL_SOLVERCATEGORY_HH
6 #define DUNE_ISTL_SOLVERCATEGORY_HH
7 
9 
10 
11 namespace Dune {
12 
22  {
23  enum Category {
30  };
31 
33  template<typename OP>
34  static Category category(const OP& op, decltype(op.category())* = nullptr)
35  {
36  return op.category();
37  }
38 
39 #ifndef DOXYGEN
40  // template<typename OP>
41  // static Category category(const OP& op, decltype(op.getSolverCategory())* = nullptr)
42  // {
43  // return op.getSolverCategory();
44  // }
45 
46  template<typename OP>
47  static Category category(const OP& op, decltype(op.category)* = nullptr)
48  {
49  return OP::category;
50  }
51 #endif
52  };
53 
54  class InvalidSolverCategory : public InvalidStateException{};
55 
58 } // end namespace
59 
60 #endif
A few common exception classes.
Dune namespace.
Definition: alignedallocator.hh:13
Categories for the solvers.
Definition: solvercategory.hh:22
Category
Definition: solvercategory.hh:23
@ sequential
Category for sequential solvers.
Definition: solvercategory.hh:25
@ nonoverlapping
Category for non-overlapping solvers.
Definition: solvercategory.hh:27
@ overlapping
Category for overlapping solvers.
Definition: solvercategory.hh:29
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:34
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 24, 22:30, 2024)