diff --git a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh index 50335bfd9628b24839945db19a9def02c72c3326..8f9a680f885707f9bf75d9a12391ea056acdbc4f 100644 --- a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh @@ -106,13 +106,13 @@ class DarcysLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> // whether or not the scvf is embedded in a secondary interaction volume. using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); using PrimaryIvLocalFaceData = typename PrimaryInteractionVolume::Traits::LocalFaceData; - using PrimaryIvDataHandle = typename PrimaryInteractionVolume::Traits::DataHandle; + using PrimaryIvDataHandle = typename ElementFluxVariablesCache::PrimaryIvDataHandle; using PrimaryIvCellVector = typename PrimaryInteractionVolume::Traits::MatVecTraits::CellVector; using PrimaryIvTij = typename PrimaryInteractionVolume::Traits::MatVecTraits::TMatrix::row_type; using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); using SecondaryIvLocalFaceData = typename SecondaryInteractionVolume::Traits::LocalFaceData; - using SecondaryIvDataHandle = typename SecondaryInteractionVolume::Traits::DataHandle; + using SecondaryIvDataHandle = typename ElementFluxVariablesCache::SecondaryIvDataHandle; using SecondaryIvCellVector = typename SecondaryInteractionVolume::Traits::MatVecTraits::CellVector; using SecondaryIvTij = typename SecondaryInteractionVolume::Traits::MatVecTraits::TMatrix::row_type; diff --git a/dumux/discretization/cellcentered/mpfa/elementfluxvariablescache.hh b/dumux/discretization/cellcentered/mpfa/elementfluxvariablescache.hh index f7709fe7878e8e776b4cf20f3649e6b26d786864..f1b766a4f995a507c42a19ebc27b1b7fdb5327e6 100644 --- a/dumux/discretization/cellcentered/mpfa/elementfluxvariablescache.hh +++ b/dumux/discretization/cellcentered/mpfa/elementfluxvariablescache.hh @@ -29,6 +29,8 @@ #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> +#include <dumux/discretization/cellcentered/mpfa/interactionvolumedatahandle.hh> + #include "fluxvariablescachefiller.hh" #include "methods.hh" @@ -63,8 +65,11 @@ class CCMpfaElementFluxVariablesCache<TypeTag, true> using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); using GridFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache); - public: + //! export the data handle types used by the grid-wide cache + using PrimaryIvDataHandle = typename GridFluxVariablesCache::PrimaryIvDataHandle; + using SecondaryIvDataHandle = typename GridFluxVariablesCache::SecondaryIvDataHandle; + //! The constructor CCMpfaElementFluxVariablesCache(const GridFluxVariablesCache& global) : gridFluxVarsCachePtr_(&global) {} @@ -121,11 +126,26 @@ class CCMpfaElementFluxVariablesCache<TypeTag, false> using FluxVariablesCacheFiller = CCMpfaFluxVariablesCacheFiller<TypeTag>; using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); - using PrimaryIvDataHandle = typename PrimaryInteractionVolume::Traits::DataHandle; + using PrimaryMatVecTraits = typename PrimaryInteractionVolume::Traits::MatVecTraits; using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); - using SecondaryIvDataHandle = typename SecondaryInteractionVolume::Traits::DataHandle; + using SecondaryMatVecTraits = typename SecondaryInteractionVolume::Traits::MatVecTraits; + + //! physics traits class to define the data handles + struct PhysicsTraits + { + static constexpr bool enableAdvection = GET_PROP_VALUE(TypeTag, EnableAdvection); + static constexpr bool enableMolecularDiffusion = GET_PROP_VALUE(TypeTag, EnableMolecularDiffusion); + static constexpr bool enableHeatConduction = GET_PROP_VALUE(TypeTag, EnableEnergyBalance); + + static constexpr int numPhases = GET_PROP_VALUE(TypeTag, NumPhases); + static constexpr int numComponents = GET_PROP_VALUE(TypeTag, NumComponents); + }; public: + //! export the data handle types used + using PrimaryIvDataHandle = InteractionVolumeDataHandle< PrimaryMatVecTraits, PhysicsTraits >; + using SecondaryIvDataHandle = InteractionVolumeDataHandle< SecondaryMatVecTraits, PhysicsTraits >; + CCMpfaElementFluxVariablesCache(const GridFluxVariablesCache& global) : gridFluxVarsCachePtr_(&global) {} diff --git a/dumux/discretization/cellcentered/mpfa/fickslaw.hh b/dumux/discretization/cellcentered/mpfa/fickslaw.hh index 3f68da0dde36f2484cc5ce41f81a90690edccb13..08765f9385b9eeb9f802d3e4fae447ebdd94ca4c 100644 --- a/dumux/discretization/cellcentered/mpfa/fickslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/fickslaw.hh @@ -104,13 +104,13 @@ class FicksLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> // whether or not the scvf is embedded in a secondary interaction volume. using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); using PrimaryIvLocalFaceData = typename PrimaryInteractionVolume::Traits::LocalFaceData; - using PrimaryIvDataHandle = typename PrimaryInteractionVolume::Traits::DataHandle; + using PrimaryIvDataHandle = typename ElementFluxVariablesCache::PrimaryIvDataHandle; using PrimaryIvCellVector = typename PrimaryInteractionVolume::Traits::MatVecTraits::CellVector; using PrimaryIvTij = typename PrimaryInteractionVolume::Traits::MatVecTraits::TMatrix::row_type; using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); using SecondaryIvLocalFaceData = typename SecondaryInteractionVolume::Traits::LocalFaceData; - using SecondaryIvDataHandle = typename SecondaryInteractionVolume::Traits::DataHandle; + using SecondaryIvDataHandle = typename ElementFluxVariablesCache::SecondaryIvDataHandle; using SecondaryIvCellVector = typename SecondaryInteractionVolume::Traits::MatVecTraits::CellVector; using SecondaryIvTij = typename SecondaryInteractionVolume::Traits::MatVecTraits::TMatrix::row_type; diff --git a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh index 2f4735da25a26c47143f5b33f3a7fe1679bc0e03..b5a8d8c0ad58128a8be15b0624892b4a3ddc85da 100644 --- a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh +++ b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh @@ -50,13 +50,14 @@ class CCMpfaFluxVariablesCacheFiller using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); + using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache); using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); - using PrimaryDataHandle = typename PrimaryInteractionVolume::Traits::DataHandle; + using PrimaryDataHandle = typename ElementFluxVariablesCache::PrimaryIvDataHandle; using PrimaryLocalFaceData = typename PrimaryInteractionVolume::Traits::LocalFaceData; using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); - using SecondaryDataHandle = typename SecondaryInteractionVolume::Traits::DataHandle; + using SecondaryDataHandle = typename ElementFluxVariablesCache::SecondaryIvDataHandle; using SecondaryLocalFaceData = typename SecondaryInteractionVolume::Traits::LocalFaceData; static constexpr int dim = GridView::dimension; diff --git a/dumux/discretization/cellcentered/mpfa/fourierslaw.hh b/dumux/discretization/cellcentered/mpfa/fourierslaw.hh index 121de6a44c68bc791da278a8c49a626b231305a4..94bf998c4fa8bc570e1401457105f886bdcfabe6 100644 --- a/dumux/discretization/cellcentered/mpfa/fourierslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/fourierslaw.hh @@ -102,13 +102,13 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> // whether or not the scvf is embedded in a secondary interaction volume. using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); using PrimaryIvLocalFaceData = typename PrimaryInteractionVolume::Traits::LocalFaceData; - using PrimaryIvDataHandle = typename PrimaryInteractionVolume::Traits::DataHandle; + using PrimaryIvDataHandle = typename ElementFluxVarsCache::PrimaryIvDataHandle; using PrimaryIvCellVector = typename PrimaryInteractionVolume::Traits::MatVecTraits::CellVector; using PrimaryIvTij = typename PrimaryInteractionVolume::Traits::MatVecTraits::TMatrix::row_type; using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); using SecondaryIvLocalFaceData = typename SecondaryInteractionVolume::Traits::LocalFaceData; - using SecondaryIvDataHandle = typename SecondaryInteractionVolume::Traits::DataHandle; + using SecondaryIvDataHandle = typename ElementFluxVarsCache::SecondaryIvDataHandle; using SecondaryIvCellVector = typename SecondaryInteractionVolume::Traits::MatVecTraits::CellVector; using SecondaryIvTij = typename SecondaryInteractionVolume::Traits::MatVecTraits::TMatrix::row_type; diff --git a/dumux/discretization/cellcentered/mpfa/gridfluxvariablescache.hh b/dumux/discretization/cellcentered/mpfa/gridfluxvariablescache.hh index 87392c2b4f71f4a911e799b90394a49f35bde083..a43048d8e8ad1db4874a1b7d0890c26d273ee8dc 100644 --- a/dumux/discretization/cellcentered/mpfa/gridfluxvariablescache.hh +++ b/dumux/discretization/cellcentered/mpfa/gridfluxvariablescache.hh @@ -25,6 +25,7 @@ #define DUMUX_DISCRETIZATION_CCMPFA_GRID_FLUXVARSCACHE_HH #include <dumux/common/properties.hh> +#include <dumux/discretization/cellcentered/mpfa/interactionvolumedatahandle.hh> #include <dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh> //! make the local view function available whenever we use this class @@ -61,13 +62,28 @@ class CCMpfaGridFluxVariablesCache<TypeTag, true> using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; + using FluxVariablesCacheFiller = CCMpfaFluxVariablesCacheFiller<TypeTag>; using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); - using PrimaryIvDataHandle = typename PrimaryInteractionVolume::Traits::DataHandle; + using PrimaryMatVecTraits = typename PrimaryInteractionVolume::Traits::MatVecTraits; using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); - using SecondaryIvDataHandle = typename SecondaryInteractionVolume::Traits::DataHandle; - using FluxVariablesCacheFiller = CCMpfaFluxVariablesCacheFiller<TypeTag>; + using SecondaryMatVecTraits = typename SecondaryInteractionVolume::Traits::MatVecTraits; + + //! physics traits class to define the data handles + struct PhysicsTraits + { + static constexpr bool enableAdvection = GET_PROP_VALUE(TypeTag, EnableAdvection); + static constexpr bool enableMolecularDiffusion = GET_PROP_VALUE(TypeTag, EnableMolecularDiffusion); + static constexpr bool enableHeatConduction = GET_PROP_VALUE(TypeTag, EnableEnergyBalance); + + static constexpr int numPhases = GET_PROP_VALUE(TypeTag, NumPhases); + static constexpr int numComponents = GET_PROP_VALUE(TypeTag, NumComponents); + }; public: + // export the data handle types used + using PrimaryIvDataHandle = InteractionVolumeDataHandle< PrimaryMatVecTraits, PhysicsTraits >; + using SecondaryIvDataHandle = InteractionVolumeDataHandle< SecondaryMatVecTraits, PhysicsTraits >; + //! export the type of the local view using LocalView = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache); @@ -254,6 +270,10 @@ public: //! export the type of the local view using LocalView = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache); + //! export the data handle types used by the local view + using PrimaryIvDataHandle = typename LocalView::PrimaryIvDataHandle; + using SecondaryIvDataHandle = typename LocalView::SecondaryIvDataHandle; + //! The constructor CCMpfaGridFluxVariablesCache(const Problem& problem) : problemPtr_(&problem) {} diff --git a/dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh b/dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh index e14151aebe2fd4f28ec411e57535859ee1b0cf1d..def2fff434a13445c6f89e7a01a03bfec434f811 100644 --- a/dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh +++ b/dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh @@ -49,8 +49,6 @@ namespace Dumux * using LocalFaceData = ...; * //! export the matrix/vector type traits to be used by the iv * using MatVecTraits = ...; - * //! export the data handle type for this iv - * using DataHandle = ...; * \endcode */ diff --git a/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh b/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh index 08163c4d62324373831527d143076824d7dc8091..1a5595f8244c1ad4e0741e7b0e518a34335666aa 100644 --- a/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh +++ b/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh @@ -34,7 +34,6 @@ #include <dumux/common/math.hh> #include <dumux/common/matrixvectorhelper.hh> -#include <dumux/discretization/cellcentered/mpfa/interactionvolumedatahandle.hh> #include <dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh> #include <dumux/discretization/cellcentered/mpfa/dualgridindexset.hh> #include <dumux/discretization/cellcentered/mpfa/localfacedata.hh> @@ -57,9 +56,8 @@ template< class Traits > class CCMpfaOInteractionVolume; * * \tparam NodalIndexSet The type used for the dual grid's nodal index sets * \tparam Scalar The Type used for scalar values - * \tparam PhysicsTraits Traits class encapsulating info on the physical processes */ -template< class NodalIndexSet, class Scalar, class PhysicsTraits > +template< class NodalIndexSet, class Scalar > struct CCMpfaODefaultInteractionVolumeTraits { private: @@ -94,8 +92,6 @@ public: using LocalFaceData = InteractionVolumeLocalFaceData<GridIndexType, LocalIndexType>; //! export the matrix/vector traits to be used by the iv using MatVecTraits = MVTraits; - //! export the data handle type for this iv - using DataHandle = InteractionVolumeDataHandle< MatVecTraits, PhysicsTraits >; }; /*! diff --git a/dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh b/dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh index cf3e7768424efe00cf1a226acb6193c4ca506262..7c30e02ecda5d8b164df47a3c0645d2adcfeec02 100644 --- a/dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh +++ b/dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh @@ -32,7 +32,6 @@ #include <dumux/common/math.hh> #include <dumux/common/matrixvectorhelper.hh> -#include <dumux/discretization/cellcentered/mpfa/interactionvolumedatahandle.hh> #include <dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh> #include <dumux/discretization/cellcentered/mpfa/dualgridindexset.hh> #include <dumux/discretization/cellcentered/mpfa/localfacedata.hh> @@ -56,11 +55,10 @@ template< class Traits > class CCMpfaOStaticInteractionVolume; * * \tparam NI The type used for the dual grid's nodal index sets * \tparam S The Type used for scalar values - * \tparam PT Traits class encapsulating info on the physical processes * \tparam C The number of sub-control volumes (cells) in the ivs * \tparam F The number of sub-control volume faces in the ivs */ -template< class NI, class S, class PT, int C, int F > +template< class NI, class S, int C, int F > struct CCMpfaODefaultStaticInteractionVolumeTraits { private: @@ -95,8 +93,6 @@ public: using LocalFaceData = InteractionVolumeLocalFaceData<GridIndexType, LocalIndexType>; //! export the matrix/vector traits to be used by the iv using MatVecTraits = MVTraits; - //! export the data handle type for this iv - using DataHandle = InteractionVolumeDataHandle< MatVecTraits, PT >; //! export the number of scvs in the interaction volumes static constexpr int numScvs = C; //! export the number of scvfs in the interaction volumes diff --git a/dumux/discretization/cellcentered/mpfa/properties.hh b/dumux/discretization/cellcentered/mpfa/properties.hh index 220f4dbe53e6b4f04d9c475b85cce5b194650bab..c46c778a1a321b6f7ac07957cce2fad6f21ddb5f 100644 --- a/dumux/discretization/cellcentered/mpfa/properties.hh +++ b/dumux/discretization/cellcentered/mpfa/properties.hh @@ -122,18 +122,8 @@ private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using NodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); - // set up the physics Traits - struct PhysicsTraits - { - static constexpr bool enableAdvection = GET_PROP_VALUE(TypeTag, EnableAdvection); - static constexpr bool enableMolecularDiffusion = GET_PROP_VALUE(TypeTag, EnableMolecularDiffusion); - static constexpr bool enableHeatConduction = GET_PROP_VALUE(TypeTag, EnableEnergyBalance); - - static constexpr int numPhases = GET_PROP_VALUE(TypeTag, NumPhases); - static constexpr int numComponents = GET_PROP_VALUE(TypeTag, NumComponents); - }; // use the default traits - using Traits = CCMpfaODefaultInteractionVolumeTraits< NodalIndexSet, Scalar, PhysicsTraits >; + using Traits = CCMpfaODefaultInteractionVolumeTraits< NodalIndexSet, Scalar >; public: using type = CCMpfaOInteractionVolume< Traits >; };