Commit 0ab5a1f3 authored by Dennis Gläser's avatar Dennis Gläser Committed by Timo Koch
Browse files

[mpfa-o] interaction volume gets implementation as template parameter

by passing the implementation of the actual method's interaction volume type
to the o-method interaction volume we are able to overload functionalities in
derived classes and still use different interaction volume types on the boundary and
inside the domain. This was not possible through the property system as it was unclear
which interaction volume is the actual implementation.
parent f4b8b706
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
{}
......
......@@ -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>);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment