diff --git a/dumux/discretization/cellcentered/mpfa/lmethod/interactionvolume.hh b/dumux/discretization/cellcentered/mpfa/lmethod/interactionvolume.hh index 6ab3030efd62216e261933b8b7cb2e4d56fe7e6c..c5647e7b05c14c65e93ccd35e5b656c3e4aa6b20 100644 --- a/dumux/discretization/cellcentered/mpfa/lmethod/interactionvolume.hh +++ b/dumux/discretization/cellcentered/mpfa/lmethod/interactionvolume.hh @@ -66,7 +66,8 @@ public: * \brief Base class for the interaction volumes of the mpfa-l method. */ template<class TypeTag> -class CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::lMethod> : public CCMpfaInteractionVolumeBase<TypeTag, CCMpfaLInteractionVolumeTraits<TypeTag>> +class CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::lMethod> + : public CCMpfaInteractionVolumeBase<TypeTag, CCMpfaLInteractionVolumeTraits<TypeTag>> { // The interaction volume implementation has to be friend friend typename GET_PROP_TYPE(TypeTag, InteractionVolume); diff --git a/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh b/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh index 532846a65f6f19e134da70c4cc14557a3cf570d9..28d37d8079dcfc47aac441cef31417f44ca05657 100644 --- a/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh +++ b/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh @@ -61,7 +61,8 @@ public: }; //! Forward declaration of the mpfa-o interaction volume -template<class TypeTag, class Traits> class CCMpfaOInteractionVolume; +template<class TypeTag, class Traits, class Implementation> +class CCMpfaOInteractionVolume; /*! * \ingroup Mpfa @@ -71,10 +72,14 @@ template<class TypeTag, class Traits> class CCMpfaOInteractionVolume; * traits class. */ template<class TypeTag> -class CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethod> : public CCMpfaOInteractionVolume<TypeTag, CCMpfaOInteractionVolumeTraits<TypeTag>> +class CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethod> + : public CCMpfaOInteractionVolume<TypeTag, + CCMpfaOInteractionVolumeTraits<TypeTag>, + CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethod>> { + using ThisType = CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethod>; using TraitsType = CCMpfaOInteractionVolumeTraits<TypeTag>; - using ParentType = CCMpfaOInteractionVolume<TypeTag, TraitsType>; + using ParentType = CCMpfaOInteractionVolume<TypeTag, TraitsType, ThisType>; using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); @@ -94,18 +99,13 @@ public: }; -template<class TypeTag, class Traits> +template<class TypeTag, class Traits, class Implementation> class CCMpfaOInteractionVolume : public CCMpfaInteractionVolumeBase<TypeTag, Traits> { - // The interaction volume implementations have to be friend, - // because some methods use the mpfa-o interaction volume as base - friend typename GET_PROP_TYPE(TypeTag, InteractionVolume); - friend typename Traits::BoundaryInteractionVolume; + // The actual implementation has to be friend + friend Implementation; - // We assume the actual implementation always to be the boundary-specific implementation - using Implementation = typename Traits::BoundaryInteractionVolume; using ParentType = CCMpfaInteractionVolumeBase<TypeTag, Traits>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); diff --git a/dumux/discretization/cellcentered/mpfa/omethodfps/interactionvolume.hh b/dumux/discretization/cellcentered/mpfa/omethodfps/interactionvolume.hh index add7c081b8fd5a458291dd4ba7c775ce03e9adb2..8ff3f3186a8b186ab5ddf423c180a15c1c63f303 100644 --- a/dumux/discretization/cellcentered/mpfa/omethodfps/interactionvolume.hh +++ b/dumux/discretization/cellcentered/mpfa/omethodfps/interactionvolume.hh @@ -43,8 +43,9 @@ class CCMpfaOFpsInteractionVolumeTraits : public CCMpfaOInteractionVolumeTraits< public: // Interior boundaries can not yet be handled by the currend o-method fps implementation // In that case we use the o-interactionvolume, otherwise we use its own interaction volumes at the boundary - // TODO Implement this using std::conditional - using BoundaryInteractionVolume = CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethodFps>; + using BoundaryInteractionVolume = typename std::conditional<GET_PROP_VALUE(TypeTag, EnableInteriorBoundaries), + CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethod>, + CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethodFps>>::type; // The local sub-control volume type differs from the standard mpfa-o method using LocalScvType = CCMpfaOFpsLocalScv<TypeTag>; @@ -54,10 +55,14 @@ public: * \brief Base class for the interaction volumes of the mpfa-o method with full pressure support. */ template<class TypeTag> -class CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethodFps> : public CCMpfaOInteractionVolume<TypeTag, CCMpfaOFpsInteractionVolumeTraits<TypeTag>> +class CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethodFps> + : public CCMpfaOInteractionVolume<TypeTag, + CCMpfaOFpsInteractionVolumeTraits<TypeTag>, + CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethodFps>> { using Traits = CCMpfaOFpsInteractionVolumeTraits<TypeTag>; - using ParentType = CCMpfaOInteractionVolume<TypeTag, Traits>; + using ThisType = CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethodFps>; + using ParentType = CCMpfaOInteractionVolume<TypeTag, Traits, ThisType>; using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using Problem = typename GET_PROP_TYPE(TypeTag, Problem); diff --git a/dumux/mixeddimension/facet/mpfa/interactionvolume.hh b/dumux/mixeddimension/facet/mpfa/interactionvolume.hh index 5a4a58f2b08e51f1a9987bea241e81d444444e1d..a0831c8a92a69113433480d9861103dc26d9a062 100644 --- a/dumux/mixeddimension/facet/mpfa/interactionvolume.hh +++ b/dumux/mixeddimension/facet/mpfa/interactionvolume.hh @@ -20,8 +20,8 @@ * \file * \brief Base classes for interaction volumes of mpfa models with active coupling over the element facets. */ -#ifndef DUMUX_MIXEDDIMENSION_FACET_INTERACTIONVOLUME_HH -#define DUMUX_MIXEDDIMENSION_FACET_INTERACTIONVOLUME_HH +#ifndef DUMUX_MIXEDDIMENSION_FACET_MPFA_O_INTERACTIONVOLUME_HH +#define DUMUX_MIXEDDIMENSION_FACET_MPFA_O_INTERACTIONVOLUME_HH #include <dumux/discretization/cellcentered/mpfa/interactionvolume.hh> #include <dumux/discretization/cellcentered/mpfa/facetypes.hh> @@ -29,54 +29,27 @@ namespace Dumux { -// forward declaration of the implementation -template<class TypeTag, MpfaMethods Method> -class CCMpfaFacetCouplingInteractionVolumeImplementation; +//! Forward declaration +template<class TypeTag> class CCMpfaOFacetCouplingInteractionVolume; -/*! - * \ingroup MixedDimension - * \brief Base class for the interaction volumes of the mpfa method with active coupling over the element facets. - */ -template<class TypeTag> -using CCMpfaFacetCouplingInteractionVolume = CCMpfaFacetCouplingInteractionVolumeImplementation<TypeTag, GET_PROP_VALUE(TypeTag, MpfaMethod)>; - -// Per default, we inherit from the standard interaction volumes -template<class TypeTag, MpfaMethods Method> -class CCMpfaFacetCouplingInteractionVolumeImplementation : public CCMpfaInteractionVolumeImplementation<TypeTag, Method> -{ - using ParentType = CCMpfaInteractionVolumeImplementation<TypeTag, Method>; - - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); - -public: - using typename ParentType::Seed; - - CCMpfaFacetCouplingInteractionVolumeImplementation(const Seed& seed, - const Problem& problem, - const FVElementGeometry& fvGeometry, - const ElementVolumeVariables& elemVolVars) - : ParentType(seed, problem, fvGeometry, elemVolVars) - {} -}; - -//! Specialization of the interaction volume traits class for the coupled models +//! Specialization of the interaction volume traits class for the o-method in coupled models template<class TypeTag> -class CCMpfaFacetCouplingOInteractionVolumeTraits : public CCMpfaOInteractionVolumeTraits<TypeTag> +class CCMpfaOFacetCouplingInteractionVolumeTraits : public CCMpfaOInteractionVolumeTraits<TypeTag> { public: - using BoundaryInteractionVolume = CCMpfaFacetCouplingInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethod>; + using BoundaryInteractionVolume = CCMpfaOFacetCouplingInteractionVolume<TypeTag>; }; // the o-method interaction volume is substituted by the one including data on the facet element's -// tensorial quantities into the local system to be solved. This has to be used as boundary interaction volume +// tensorial quantities into the local system to be solved. template<class TypeTag> -class CCMpfaFacetCouplingInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethod> - : public CCMpfaOInteractionVolume<TypeTag, CCMpfaFacetCouplingOInteractionVolumeTraits<TypeTag>> +class CCMpfaOFacetCouplingInteractionVolume : public CCMpfaOInteractionVolume<TypeTag, + CCMpfaOFacetCouplingInteractionVolumeTraits<TypeTag>, + CCMpfaOFacetCouplingInteractionVolume<TypeTag>> { - using Traits = CCMpfaFacetCouplingOInteractionVolumeTraits<TypeTag>; - using ParentType = CCMpfaOInteractionVolume<TypeTag, Traits>; + using Traits = CCMpfaOFacetCouplingInteractionVolumeTraits<TypeTag>; + using ThisType = CCMpfaOFacetCouplingInteractionVolume<TypeTag>; + using ParentType = CCMpfaOInteractionVolume<TypeTag, Traits, ThisType>; using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); @@ -97,10 +70,10 @@ public: using typename ParentType::LocalIndexType; using typename ParentType::Seed; - CCMpfaFacetCouplingInteractionVolumeImplementation(const Seed& seed, - const Problem& problem, - const FVElementGeometry& fvGeometry, - const ElementVolumeVariables& elemVolVars) + CCMpfaOFacetCouplingInteractionVolume(const Seed& seed, + const Problem& problem, + const FVElementGeometry& fvGeometry, + const ElementVolumeVariables& elemVolVars) : ParentType(seed, problem, fvGeometry, elemVolVars) {} diff --git a/dumux/mixeddimension/facet/mpfa/properties.hh b/dumux/mixeddimension/facet/mpfa/properties.hh index 75237f39d2e563ea99641bea415443868c04f89e..5b8104083a17a29b35ebd3d6c589730655635b99 100644 --- a/dumux/mixeddimension/facet/mpfa/properties.hh +++ b/dumux/mixeddimension/facet/mpfa/properties.hh @@ -42,11 +42,8 @@ namespace Properties { NEW_TYPE_TAG(FacetCouplingBulkMpfaModel, INHERITS_FROM(CCMpfaModel)); -//! The interaction volume class -SET_TYPE_PROP(FacetCouplingBulkMpfaModel, InteractionVolume, CCMpfaFacetCouplingInteractionVolume<TypeTag>); - -//! The boundary interaction volume class (for methods other than the omethod) -SET_TYPE_PROP(FacetCouplingBulkMpfaModel, BoundaryInteractionVolume, CCMpfaFacetCouplingInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethod>); +//! The boundary interaction volume class (we use the facet coupling specialized o-method interaction volume) +SET_TYPE_PROP(FacetCouplingBulkMpfaModel, BoundaryInteractionVolume, CCMpfaOFacetCouplingInteractionVolume<TypeTag>); //! The interior boundary data class SET_TYPE_PROP(FacetCouplingBulkMpfaModel, InteriorBoundaryData, CCMpfaFacetCouplingInteriorBoundaryData<TypeTag>);