Skip to content
Snippets Groups Projects
Commit 77e2505f authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[md][assemblerview] fix enable_if for isImplicit()

parent 772f99b0
No related branches found
No related tags found
1 merge request!3608[experimental] Multistage assembler
Pipeline #36118 passed
+3
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#ifndef DUMUX_MULTIDOMAIN_ASSEMBLER_VIEW_HH #ifndef DUMUX_MULTIDOMAIN_ASSEMBLER_VIEW_HH
#define DUMUX_MULTIDOMAIN_ASSEMBLER_VIEW_HH #define DUMUX_MULTIDOMAIN_ASSEMBLER_VIEW_HH
#include <dune/common/std/type_traits.hh>
namespace Dumux { namespace Dumux {
/*! /*!
...@@ -28,6 +30,12 @@ class MultiDomainAssemblerSubDomainView ...@@ -28,6 +30,12 @@ class MultiDomainAssemblerSubDomainView
{ {
static constexpr Dune::index_constant<domainId> myId{}; 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: public:
using CouplingManager = typename MDAssembler::CouplingManager; using CouplingManager = typename MDAssembler::CouplingManager;
using SolutionVector = typename MDAssembler::SolutionVector; using SolutionVector = typename MDAssembler::SolutionVector;
...@@ -55,9 +63,10 @@ public: ...@@ -55,9 +63,10 @@ public:
const auto& prevSol() const { return assembler_.prevSol(); } const auto& prevSol() const { return assembler_.prevSol(); }
bool isStationaryProblem() const { return assembler_.isStationaryProblem(); } 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(); } 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(); } bool isImplicit() const { return assembler_.isImplicit(); }
private: private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment