diff --git a/dumux/discretization/box.hh b/dumux/discretization/box.hh index 59669c347fddb697440a5f6fb3896d474e42741c..ee56e70826ea3b02553b2b67d1cf730aff9825a3 100644 --- a/dumux/discretization/box.hh +++ b/dumux/discretization/box.hh @@ -45,6 +45,8 @@ #include <dumux/discretization/box/gridvolumevariables.hh> #include <dumux/discretization/box/fvgridgeometry.hh> +#include <dumux/flux/fluxvariablescaching.hh> + namespace Dumux { namespace Properties { @@ -85,7 +87,11 @@ struct GridFluxVariablesCache<TypeTag, TTag::BoxModel> private: static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); using Problem = GetPropType<TypeTag, Properties::Problem>; - using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; + + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluxVariablesCache = GetPropTypeOr<TypeTag, + Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar> + >; public: using type = BoxGridFluxVariablesCache<Problem, FluxVariablesCache, enableCache>; }; diff --git a/dumux/discretization/ccmpfa.hh b/dumux/discretization/ccmpfa.hh index fbd738fae081515383a353a380995cc49e22e468..8d2f04d9fcac45175dad6b32aee94a65e435c1c0 100644 --- a/dumux/discretization/ccmpfa.hh +++ b/dumux/discretization/ccmpfa.hh @@ -48,6 +48,8 @@ #include <dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh> +#include <dumux/flux/fluxvariablescaching.hh> + namespace Dumux { namespace Properties { @@ -130,8 +132,14 @@ struct GridFluxVariablesCache<TypeTag, TTag::CCMpfaModel> private: static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); using Problem = GetPropType<TypeTag, Properties::Problem>; - using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; - using FluxVariablesCacheFiller = GetPropType<TypeTag, Properties::FluxVariablesCacheFiller>; + + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluxVariablesCache = GetPropTypeOr<TypeTag, + Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar> + >; + using FluxVariablesCacheFiller = GetPropTypeOr<TypeTag, + Properties::FluxVariablesCacheFiller, FluxVariablesCaching::EmptyCacheFiller + >; using PrimaryInteractionVolume = GetPropType<TypeTag, Properties::PrimaryInteractionVolume>; using SecondaryInteractionVolume = GetPropType<TypeTag, Properties::SecondaryInteractionVolume>; diff --git a/dumux/discretization/cctpfa.hh b/dumux/discretization/cctpfa.hh index 3447dc2c942b18fbddfb266bcde2e61d1a8c6706..4b5348d6e16a0950058a7e97d1544697ab1a45c1 100644 --- a/dumux/discretization/cctpfa.hh +++ b/dumux/discretization/cctpfa.hh @@ -42,6 +42,8 @@ #include <dumux/discretization/cellcentered/tpfa/gridfluxvariablescache.hh> #include <dumux/discretization/cellcentered/tpfa/subcontrolvolumeface.hh> +#include <dumux/flux/fluxvariablescaching.hh> + namespace Dumux { namespace Properties { @@ -81,8 +83,14 @@ struct GridFluxVariablesCache<TypeTag, TTag::CCTpfaModel> private: static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); using Problem = GetPropType<TypeTag, Properties::Problem>; - using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; - using FluxVariablesCacheFiller = GetPropType<TypeTag, Properties::FluxVariablesCacheFiller>; + + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluxVariablesCache = GetPropTypeOr<TypeTag, + Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar> + >; + using FluxVariablesCacheFiller = GetPropTypeOr<TypeTag, + Properties::FluxVariablesCacheFiller, FluxVariablesCaching::EmptyCacheFiller + >; public: using type = CCTpfaGridFluxVariablesCache<Problem, FluxVariablesCache, FluxVariablesCacheFiller, enableCache>; }; diff --git a/dumux/discretization/fcstaggered.hh b/dumux/discretization/fcstaggered.hh index 6de37e6114c1bcef7748a788d37c8fe238d3cd5f..433e282e23804b0b2be46aa4ba5d14bfb638bb17 100644 --- a/dumux/discretization/fcstaggered.hh +++ b/dumux/discretization/fcstaggered.hh @@ -80,8 +80,13 @@ struct GridFluxVariablesCache<TypeTag, TTag::FaceCenteredStaggeredModel> private: static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); using Problem = GetPropType<TypeTag, Properties::Problem>; - using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; - using FluxVariablesCacheFiller = GetPropType<TypeTag, Properties::FluxVariablesCacheFiller>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluxVariablesCache = GetPropTypeOr<TypeTag, + Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar> + >; + using FluxVariablesCacheFiller = GetPropTypeOr<TypeTag, + Properties::FluxVariablesCacheFiller, FluxVariablesCaching::EmptyCacheFiller + >; public: using type = FaceCenteredStaggeredGridFluxVariablesCache<Problem, FluxVariablesCache, FluxVariablesCacheFiller, enableCache>; }; diff --git a/dumux/discretization/staggered.hh b/dumux/discretization/staggered.hh index 3caccbd7a0a0735b32b452bf2e734dcd4265e4ac..afcd527712f5ce565be4d0703094c6ff368c0fb9 100644 --- a/dumux/discretization/staggered.hh +++ b/dumux/discretization/staggered.hh @@ -83,8 +83,13 @@ struct GridFluxVariablesCache<TypeTag, TTag::StaggeredModel> { private: using Problem = GetPropType<TypeTag, Properties::Problem>; - using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; - using FluxVariablesCacheFiller = GetPropType<TypeTag, Properties::FluxVariablesCacheFiller>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluxVariablesCache = GetPropTypeOr<TypeTag, + Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar> + >; + using FluxVariablesCacheFiller = GetPropTypeOr<TypeTag, + Properties::FluxVariablesCacheFiller, FluxVariablesCaching::EmptyCacheFiller + >; static constexpr auto enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); static constexpr auto upwindSchemeOrder = getPropValue<TypeTag, Properties::UpwindSchemeOrder>(); public: