From 77e2505f9cd7c32f117ecb9fc800c1923bdceb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Gl=C3=A4ser?= <dennis.glaeser@iws.uni-stuttgart.de> Date: Thu, 28 Sep 2023 16:36:19 +0200 Subject: [PATCH] [md][assemblerview] fix enable_if for isImplicit() --- dumux/multidomain/assemblerview.hh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dumux/multidomain/assemblerview.hh b/dumux/multidomain/assemblerview.hh index 6ebde2752b..b853076f4a 100644 --- a/dumux/multidomain/assemblerview.hh +++ b/dumux/multidomain/assemblerview.hh @@ -13,6 +13,8 @@ #ifndef DUMUX_MULTIDOMAIN_ASSEMBLER_VIEW_HH #define DUMUX_MULTIDOMAIN_ASSEMBLER_VIEW_HH +#include <dune/common/std/type_traits.hh> + namespace Dumux { /*! @@ -28,6 +30,12 @@ class MultiDomainAssemblerSubDomainView { static constexpr Dune::index_constant<domainId> myId{}; + template<class A> + using HasStaticIsImplicitCheck = decltype(A::isImplicit()); + + template<class A> + static constexpr bool hasStaticIsImplicit = Dune::Std::is_detected<HasStaticIsImplicitCheck, A>::value; + public: using CouplingManager = typename MDAssembler::CouplingManager; using SolutionVector = typename MDAssembler::SolutionVector; @@ -55,9 +63,10 @@ public: const auto& prevSol() const { return assembler_.prevSol(); } bool isStationaryProblem() const { return assembler_.isStationaryProblem(); } - template<class A = MDAssembler, typename std::enable_if_t<A::isImplicit(), int> = 0> + template<class A = MDAssembler, typename std::enable_if_t<hasStaticIsImplicit<A>, int> = 0> static constexpr bool isImplicit() { return MDAssembler::isImplicit(); } + template<class A = MDAssembler, typename std::enable_if_t<!hasStaticIsImplicit<A>, int> = 0> bool isImplicit() const { return assembler_.isImplicit(); } private: -- GitLab