dune-istl 2.9.0
solvercategory.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 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
8#include <dune/common/exceptions.hh>
9
10
11namespace 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
Definition: allocator.hh:11
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
Definition: solvercategory.hh:54