From b21a2d174faabccfc9ff2e7b03b643ec87a1f179 Mon Sep 17 00:00:00 2001 From: DennisGlaeser <dennis.glaeser@iws.uni-stuttgart.de> Date: Thu, 1 Feb 2018 14:25:00 +0100 Subject: [PATCH] [mpfa] get rid of MpfaHelper property --- dumux/common/properties.hh | 1 - dumux/discretization/cellcentered/mpfa/darcyslaw.hh | 5 +++-- dumux/discretization/cellcentered/mpfa/fickslaw.hh | 5 +++-- .../cellcentered/mpfa/fluxvariablescachefiller.hh | 5 +++-- .../discretization/cellcentered/mpfa/fourierslaw.hh | 6 ++++-- .../cellcentered/mpfa/fvgridgeometry.hh | 4 ++-- .../discretization/cellcentered/mpfa/properties.hh | 13 +++---------- dumux/porousmediumflow/fluxvariablescache.hh | 2 +- 8 files changed, 19 insertions(+), 22 deletions(-) diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index a0ccd5ffdf..066292109d 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -96,7 +96,6 @@ NEW_PROP_TAG(MaxNumNeighborsPerScvf); //!< The maximum number of ne ///////////////////////////////////////////////////////////////// // Additional properties used by the cell-centered mpfa schemes: ///////////////////////////////////////////////////////////////// -NEW_PROP_TAG(MpfaHelper); //!< A Helper class depending on the mpfa method and grid dimension NEW_PROP_TAG(PrimaryInteractionVolume); //!< The primary interaction volume type NEW_PROP_TAG(SecondaryInteractionVolume); //!< The secondary interaction volume type used e.g. on the boundaries NEW_PROP_TAG(DualGridNodalIndexSet); //!< The type used for the nodal index sets of the dual grid diff --git a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh index 8f9a680f88..c8efffbee3 100644 --- a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh @@ -50,7 +50,8 @@ class DarcysLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache); @@ -95,7 +96,7 @@ class DarcysLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> using DualGridNodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); using Stencil = typename DualGridNodalIndexSet::GridStencilType; - using MpfaHelper = typename GET_PROP_TYPE(TypeTag, MpfaHelper); + using MpfaHelper = typename FVGridGeometry::MpfaHelper; static constexpr bool considerSecondaryIVs = MpfaHelper::considerSecondaryIVs(); // In the current implementation of the flux variables cache we cannot make a diff --git a/dumux/discretization/cellcentered/mpfa/fickslaw.hh b/dumux/discretization/cellcentered/mpfa/fickslaw.hh index 08765f9385..91518e9edc 100644 --- a/dumux/discretization/cellcentered/mpfa/fickslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/fickslaw.hh @@ -46,7 +46,8 @@ class FicksLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVElementGeometry = typename FVGridGeometry::LocalView; using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); @@ -93,7 +94,7 @@ class FicksLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> using DualGridNodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); using Stencil = typename DualGridNodalIndexSet::GridStencilType; - using MpfaHelper = typename GET_PROP_TYPE(TypeTag, MpfaHelper); + using MpfaHelper = typename FVGridGeometry::MpfaHelper; static constexpr bool considerSecondaryIVs = MpfaHelper::considerSecondaryIVs(); // In the current implementation of the flux variables cache we cannot make a diff --git a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh index b5a8d8c0ad..b2196d97c7 100644 --- a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh +++ b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh @@ -43,11 +43,12 @@ template<class TypeTag> class CCMpfaFluxVariablesCacheFiller { using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using MpfaHelper = typename GET_PROP_TYPE(TypeTag, MpfaHelper); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVElementGeometry = typename FVGridGeometry::LocalView; + using MpfaHelper = typename FVGridGeometry::MpfaHelper; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache); diff --git a/dumux/discretization/cellcentered/mpfa/fourierslaw.hh b/dumux/discretization/cellcentered/mpfa/fourierslaw.hh index 94bf998c4f..14b59a3fa3 100644 --- a/dumux/discretization/cellcentered/mpfa/fourierslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/fourierslaw.hh @@ -49,7 +49,9 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); using ElementFluxVarsCache = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache); @@ -91,7 +93,7 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethods::CCMpfa> using DualGridNodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); using Stencil = typename DualGridNodalIndexSet::GridStencilType; - using MpfaHelper = typename GET_PROP_TYPE(TypeTag, MpfaHelper); + using MpfaHelper = typename FVGridGeometry::MpfaHelper; static constexpr bool considerSecondaryIVs = MpfaHelper::considerSecondaryIVs(); // In the current implementation of the flux variables cache we cannot make a diff --git a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh index ef23803330..6a6d7f40b5 100644 --- a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh @@ -77,7 +77,7 @@ public: //! export the flip scvf index set type using FlipScvfIndexSet = std::vector<ScvfOutsideGridIndexStorage>; //! export the mpfa helper type - using MpfaHelper = typename Traits::MpfaHelper; + using MpfaHelper = typename Traits::template MpfaHelper<ThisType>; //! export the grid interaction volume index set type using GridIVIndexSets = typename Traits::template GridIvIndexSets<ThisType>; //! export the type to be used for indicators where to use the secondary ivs @@ -426,7 +426,7 @@ public: //! export the flip scvf index set type using FlipScvfIndexSet = std::vector<ScvfOutsideGridIndexStorage>; //! export the mpfa helper type - using MpfaHelper = typename Traits::MpfaHelper; + using MpfaHelper = typename Traits::template MpfaHelper<ThisType>; //! export the grid interaction volume index set type using GridIVIndexSets = typename Traits::template GridIvIndexSets<ThisType>; //! export the type to be used for indicators where to use the secondary ivs diff --git a/dumux/discretization/cellcentered/mpfa/properties.hh b/dumux/discretization/cellcentered/mpfa/properties.hh index c46c778a1a..57b4114888 100644 --- a/dumux/discretization/cellcentered/mpfa/properties.hh +++ b/dumux/discretization/cellcentered/mpfa/properties.hh @@ -99,15 +99,6 @@ public: using type = CCMpfaDualGridNodalIndexSet<GV, LI, dim, maxE, maxB>; }; -//! The mpfa helper class -SET_PROP(CCMpfaModel, MpfaHelper) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = CCMpfaHelper< FVGridGeometry >; -}; - //! Per default, we use the dynamic mpfa-o interaction volume SET_PROP(CCMpfaModel, PrimaryInteractionVolume) { @@ -142,7 +133,6 @@ private: { using SubControlVolume = CCSubControlVolume<GridView>; using SubControlVolumeFace = CCMpfaSubControlVolumeFace<GridView>; - using MpfaHelper = typename GET_PROP_TYPE(TypeTag, MpfaHelper); using NodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); template< class FVGridGeometry > @@ -154,6 +144,9 @@ private: template< class FVGridGeometry, bool enableGeomCache > using LocalView = CCMpfaFVElementGeometry<FVGridGeometry, enableGeomCache>; + template< class FVGridGeometry > + using MpfaHelper = CCMpfaHelper< FVGridGeometry >; + //! Use the correct connectivity map depending on mpfa scheme (obtain from primary iv) template< class FVGridGeometry > using ConnectivityMap = CCMpfaConnectivityMap<FVGridGeometry, FVGridGeometry::GridIVIndexSets::PrimaryInteractionVolume::MpfaMethod>; diff --git a/dumux/porousmediumflow/fluxvariablescache.hh b/dumux/porousmediumflow/fluxvariablescache.hh index 57662df20f..f775ba98a5 100644 --- a/dumux/porousmediumflow/fluxvariablescache.hh +++ b/dumux/porousmediumflow/fluxvariablescache.hh @@ -152,7 +152,7 @@ class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethod { using GridIndexType = typename GET_PROP_TYPE(TypeTag, GridView)::IndexSet::IndexType; - using MpfaHelper = typename GET_PROP_TYPE(TypeTag, MpfaHelper); + using MpfaHelper = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::MpfaHelper; static constexpr bool considerSecondary = MpfaHelper::considerSecondaryIVs(); public: //! Returns whether or not this cache has been updated -- GitLab