Loading...
Searching...
No Matches
solvercategory.hh
Go to the documentation of this file.
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_ISTL_SOLVERCATEGORY_HH
#define DUNE_ISTL_SOLVERCATEGORY_HH
#include <dune/common/exceptions.hh>
namespace Dune {
struct SolverCategory
{
enum Category {
sequential,
nonoverlapping,
overlapping
};
template<typename OP>
static Category category(const OP& op, decltype(op.category())* = nullptr)
{
return op.category();
}
#ifndef DOXYGEN
// template<typename OP>
// static Category category(const OP& op, decltype(op.getSolverCategory())* = nullptr)
// {
// return op.getSolverCategory();
// }
template<typename OP>
static Category category(const OP& op, decltype(op.category)* = nullptr)
{
return OP::category;
}
#endif
};
class InvalidSolverCategory : public InvalidStateException{};
} // end namespace
#endif
Dune
Definition allocator.hh:11
Dune::SolverCategory
Categories for the solvers.
Definition solvercategory.hh:22
Dune::SolverCategory::Category
Category
Definition solvercategory.hh:23
Dune::SolverCategory::sequential
@ sequential
Category for sequential solvers.
Definition solvercategory.hh:25
Dune::SolverCategory::nonoverlapping
@ nonoverlapping
Category for non-overlapping solvers.
Definition solvercategory.hh:27
Dune::SolverCategory::overlapping
@ overlapping
Category for overlapping solvers.
Definition solvercategory.hh:29
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:34
Dune::InvalidSolverCategory
Definition solvercategory.hh:54