diff --git a/dumux/assembly/boxlocalassembler.hh b/dumux/assembly/boxlocalassembler.hh index 1bc3f59c1653a4ca26339adbc609f3ddfb249aec..e407740aa46d0edcf8a1093548ba774f9f929239 100644 --- a/dumux/assembly/boxlocalassembler.hh +++ b/dumux/assembly/boxlocalassembler.hh @@ -44,10 +44,10 @@ namespace Dumux { * \tparam Assembler the assembler type * \tparam Assembler The acutal Implementation */ -template<class TypeTag, class Assembler, class Implementation> -class BoxLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Assembler, Implementation> +template<class TypeTag, class Assembler, class Implementation, bool implicit> +class BoxLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Assembler, Implementation, implicit> { - using ParentType = FVLocalAssemblerBase<TypeTag, Assembler, Implementation>; + using ParentType = FVLocalAssemblerBase<TypeTag, Assembler, Implementation, implicit>; using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); @@ -147,10 +147,6 @@ public: { return this->evalLocalStorageResidual(); } - - constexpr bool isImplicit() const - { return Implementation::isImplicit(); } - }; /*! @@ -172,10 +168,10 @@ class BoxLocalAssembler; template<class TypeTag, class Assembler> class BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/true> : public BoxLocalAssemblerBase<TypeTag, Assembler, - BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, true> > + BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, true>, true> { using ThisType = BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, true>; - using ParentType = BoxLocalAssemblerBase<TypeTag, Assembler, ThisType>; + using ParentType = BoxLocalAssemblerBase<TypeTag, Assembler, ThisType, true>; using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity; using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); @@ -196,9 +192,6 @@ public: using ParentType::ParentType; - static constexpr bool isImplicit() - { return true; } - /*! * \brief Computes the derivatives with respect to the given element and adds them * to the global matrix. @@ -299,10 +292,10 @@ public: template<class TypeTag, class Assembler> class BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/false> : public BoxLocalAssemblerBase<TypeTag, Assembler, - BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, false> > + BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, false>, false> { using ThisType = BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, false>; - using ParentType = BoxLocalAssemblerBase<TypeTag, Assembler, ThisType>; + using ParentType = BoxLocalAssemblerBase<TypeTag, Assembler, ThisType, false>; using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity; using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); @@ -323,9 +316,6 @@ public: using ParentType::ParentType; - static constexpr bool isImplicit() - { return false; } - /*! * \brief Computes the derivatives with respect to the given element and adds them * to the global matrix. diff --git a/dumux/assembly/cclocalassembler.hh b/dumux/assembly/cclocalassembler.hh index 53beaaef337e6f4b7777d091970487c76f062330..a10d358e17b5a257cb1de003db2c6195500784ef 100644 --- a/dumux/assembly/cclocalassembler.hh +++ b/dumux/assembly/cclocalassembler.hh @@ -49,10 +49,10 @@ namespace Dumux { * \tparam TypeTag the TypeTag * \tparam Assembler the assembler type */ -template<class TypeTag, class Assembler, class Implementation> -class CCLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Assembler, Implementation> +template<class TypeTag, class Assembler, class Implementation, bool implicit> +class CCLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Assembler, Implementation, implicit> { - using ParentType = FVLocalAssemblerBase<TypeTag, Assembler, Implementation>; + using ParentType = FVLocalAssemblerBase<TypeTag, Assembler, Implementation, implicit>; using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); @@ -106,9 +106,6 @@ public: { return this->evalLocalStorageResidual()[0]; } - - constexpr bool isImplicit() const - { return Implementation::isImplicit(); } }; /*! @@ -130,10 +127,10 @@ class CCLocalAssembler; template<class TypeTag, class Assembler> class CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/true> : public CCLocalAssemblerBase<TypeTag, Assembler, - CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, true> > + CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, true>, true > { using ThisType = CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, true>; - using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType>; + using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType, true>; using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using LocalResidualValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity; @@ -153,11 +150,6 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/tru public: - struct IsImplicit { static constexpr bool value = true; }; - - static constexpr bool isImplicit() - { return true; } - using ParentType::ParentType; /*! @@ -302,10 +294,10 @@ public: template<class TypeTag, class Assembler> class CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/false> : public CCLocalAssemblerBase<TypeTag, Assembler, - CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, false> > + CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, false>, false> { using ThisType = CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, false>; - using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType>; + using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType, false>; using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using LocalResidualValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity; @@ -322,9 +314,6 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/fal public: using ParentType::ParentType; - static constexpr bool isImplicit() - { return false; } - /*! * \brief Computes the derivatives with respect to the given element and adds them * to the global matrix. @@ -417,10 +406,10 @@ public: template<class TypeTag, class Assembler> class CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/true> : public CCLocalAssemblerBase<TypeTag, Assembler, - CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, true> > + CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, true>, true> { using ThisType = CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, true>; - using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType>; + using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType, true>; using LocalResidualValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); @@ -428,9 +417,6 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/tr public: using ParentType::ParentType; - static constexpr bool isImplicit() - { return true; } - /*! * \brief Computes the derivatives with respect to the given element and adds them * to the global matrix. @@ -499,10 +485,10 @@ public: template<class TypeTag, class Assembler> class CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/false> : public CCLocalAssemblerBase<TypeTag, Assembler, - CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, false> > + CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, false>, false> { using ThisType = CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, false>; - using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType>; + using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType, false>; using LocalResidualValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); @@ -510,9 +496,6 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/fa public: using ParentType::ParentType; - static constexpr bool isImplicit() - { return false; } - /*! * \brief Computes the derivatives with respect to the given element and adds them * to the global matrix. diff --git a/dumux/assembly/fvlocalassemblerbase.hh b/dumux/assembly/fvlocalassemblerbase.hh index 77c8f119a7e6638afbaa7e9286575bb224e17010..3343b4a87494c3b7823feddd680d125807cceed5 100644 --- a/dumux/assembly/fvlocalassemblerbase.hh +++ b/dumux/assembly/fvlocalassemblerbase.hh @@ -47,7 +47,7 @@ namespace Dumux { * \tparam TypeTag the TypeTag * \tparam Assembler the assembler type */ -template<class TypeTag, class Assembler, class Implementation> +template<class TypeTag, class Assembler, class Implementation, bool implicit> class FVLocalAssemblerBase { using Problem = typename GET_PROP_TYPE(TypeTag, Problem); @@ -222,8 +222,7 @@ public: { return gridVolVars.volVars(scv); } constexpr bool isImplicit() const - { return Implementation::isImplicit(); } - // { return Implementation::IsImplicit::value; } + { return implicit; } protected: Implementation &asImp_()