Skip to content
Snippets Groups Projects
Commit 086db074 authored by Bernd Flemisch's avatar Bernd Flemisch Committed by Katharina Heck
Browse files

[discretization] replace the property EnableFVGridGeometryCache

Follow the strategy outlined in !1647.
parent 008b8832
No related branches found
No related tags found
1 merge request!1748replace the property EnableFVGridGeometryCache
...@@ -123,6 +123,10 @@ DONT_EMIT_CLANG_GRIDGEOMETRY_WARNING." ...@@ -123,6 +123,10 @@ DONT_EMIT_CLANG_GRIDGEOMETRY_WARNING."
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct [[deprecated("Use GridGeometry instead.")]] FVGridGeometry { using type = UndefinedProperty; }; //!< The type of the global finite volume geometry struct [[deprecated("Use GridGeometry instead.")]] FVGridGeometry { using type = UndefinedProperty; }; //!< The type of the global finite volume geometry
// TODO: Remove deprecated property EnableFVGridGeometryCache after 3.1
template<class TypeTag, class MyTypeTag>
struct [[deprecated("Use EnableGridGeometryCache instead.")]] EnableFVGridGeometryCache { using type = UndefinedProperty; }; //!< specifies if geometric data is saved (faster, but more memory consuming)
// Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`. // Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`.
// For ensuring backward compatibility, it is necessary to set the default value // For ensuring backward compatibility, it is necessary to set the default value
// of the new property to the old one, see the discussion in MR 1647. // of the new property to the old one, see the discussion in MR 1647.
...@@ -146,10 +150,24 @@ struct GridGeometry ...@@ -146,10 +150,24 @@ struct GridGeometry
using type = typename GridGeometryHelper<TypeTag, typename FVGridGeometry<TypeTag, MyTypeTag>::type>::type; using type = typename GridGeometryHelper<TypeTag, typename FVGridGeometry<TypeTag, MyTypeTag>::type>::type;
}; };
#pragma GCC diagnostic pop template<class TypeTag, bool hasParentTypeTag>
struct EnableGridGeometryCacheHelper
{ using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag>
struct EnableFVGridGeometryCache { using type = UndefinedProperty; }; //!< specifies if geometric data is saved (faster, but more memory consuming) struct EnableGridGeometryCacheHelper<TypeTag, false>
{
// fallback
static constexpr bool value = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>();
};
// only use the fallback (EnableFVGridGeometryCache) if none
// of the TypeTags define EnableGridGeometryCache
template <class TypeTag, class MyTypeTag>
struct EnableGridGeometryCache : public EnableGridGeometryCacheHelper<TypeTag, Detail::hasParentTypeTag<MyTypeTag>(int{})>
{};
#pragma GCC diagnostic pop
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VolumeVariables { using type = UndefinedProperty; }; //!< The secondary variables within a sub-control volume struct VolumeVariables { using type = UndefinedProperty; }; //!< The secondary variables within a sub-control volume
......
...@@ -63,7 +63,7 @@ template<class TypeTag> ...@@ -63,7 +63,7 @@ template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::BoxModel> struct FVGridGeometry<TypeTag, TTag::BoxModel>
{ {
private: private:
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
using GridView = GetPropType<TypeTag, Properties::GridView>; using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public: public:
......
...@@ -114,7 +114,7 @@ private: ...@@ -114,7 +114,7 @@ private:
using NodalIndexSet = GetPropType<TypeTag, Properties::DualGridNodalIndexSet>; using NodalIndexSet = GetPropType<TypeTag, Properties::DualGridNodalIndexSet>;
using Traits = CCMpfaFVGridGeometryTraits<GridView, NodalIndexSet, PrimaryIV, SecondaryIV>; using Traits = CCMpfaFVGridGeometryTraits<GridView, NodalIndexSet, PrimaryIV, SecondaryIV>;
public: public:
using type = CCMpfaFVGridGeometry<GridView, Traits, getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>()>; using type = CCMpfaFVGridGeometry<GridView, Traits, getPropValue<TypeTag, Properties::EnableGridGeometryCache>()>;
}; };
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
......
...@@ -62,7 +62,7 @@ template<class TypeTag> ...@@ -62,7 +62,7 @@ template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::CCTpfaModel> struct FVGridGeometry<TypeTag, TTag::CCTpfaModel>
{ {
private: private:
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
using GridView = GetPropType<TypeTag, Properties::GridView>; using GridView = GetPropType<TypeTag, Properties::GridView>;
public: public:
using type = CCTpfaFVGridGeometry<GridView, enableCache>; using type = CCTpfaFVGridGeometry<GridView, enableCache>;
......
...@@ -42,10 +42,10 @@ namespace Dumux { ...@@ -42,10 +42,10 @@ namespace Dumux {
* This builds up the sub control volumes and sub control volume faces * This builds up the sub control volumes and sub control volume faces
* for each element in the local scope we are restricting to, e.g. stencil or element. * for each element in the local scope we are restricting to, e.g. stencil or element.
* \tparam GG the finite volume grid geometry type * \tparam GG the finite volume grid geometry type
* \tparam enableFVGridGeometryCache if the grid geometry is cached or not * \tparam enableGridGeometryCache if the grid geometry is cached or not
* \note This class is specialized for versions with and without caching the fv geometries on the grid view * \note This class is specialized for versions with and without caching the fv geometries on the grid view
*/ */
template<class GG, bool EnableFVGridGeometryCache> template<class GG, bool enableGridGeometryCache>
class CCMpfaFVElementGeometry; class CCMpfaFVElementGeometry;
/*! /*!
......
...@@ -55,9 +55,17 @@ public: ...@@ -55,9 +55,17 @@ public:
using type = FVGridVariables<GG, GVV, GFVC>; using type = FVGridVariables<GG, GVV, GFVC>;
}; };
// Dumux 3.1 changes the property `EnableFVGridGeometryCache` to `EnableGridGeometryCache`.
// For ensuring backward compatibility on the user side, it is necessary to
// stick to the old name for the specializations, see the discussion in MR 1647.
// Use diagnostic pragmas to prevent the emission of a warning message.
// TODO after 3.1: Rename to EnableGridGeometryCache, remove the pragmas and this comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//! We do not store the FVGeometry by default //! We do not store the FVGeometry by default
template<class TypeTag> template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::FiniteVolumeModel> { static constexpr bool value = false; }; struct EnableFVGridGeometryCache<TypeTag, TTag::FiniteVolumeModel> { static constexpr bool value = false; };
#pragma GCC diagnostic pop
//! We do not store the volume variables by default //! We do not store the volume variables by default
template<class TypeTag> template<class TypeTag>
......
...@@ -89,7 +89,7 @@ struct FVGridGeometry<TypeTag, TTag::StaggeredFreeFlowModel> ...@@ -89,7 +89,7 @@ struct FVGridGeometry<TypeTag, TTag::StaggeredFreeFlowModel>
{ {
private: private:
static constexpr auto upwindSchemeOrder = getPropValue<TypeTag, Properties::UpwindSchemeOrder>(); static constexpr auto upwindSchemeOrder = getPropValue<TypeTag, Properties::UpwindSchemeOrder>();
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
using GridView = GetPropType<TypeTag, Properties::GridView>; using GridView = GetPropType<TypeTag, Properties::GridView>;
using Traits = StaggeredFreeFlowDefaultFVGridGeometryTraits<GridView, upwindSchemeOrder>; using Traits = StaggeredFreeFlowDefaultFVGridGeometryTraits<GridView, upwindSchemeOrder>;
public: public:
......
...@@ -88,7 +88,7 @@ template<class TypeTag> ...@@ -88,7 +88,7 @@ template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::BoxFacetCouplingModel> struct FVGridGeometry<TypeTag, TTag::BoxFacetCouplingModel>
{ {
private: private:
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
using GridView = GetPropType<TypeTag, Properties::GridView>; using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public: public:
......
...@@ -52,7 +52,7 @@ template<class TypeTag> ...@@ -52,7 +52,7 @@ template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::BoxDfmModel> struct FVGridGeometry<TypeTag, TTag::BoxDfmModel>
{ {
private: private:
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
using GridView = GetPropType<TypeTag, Properties::GridView>; using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public: public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment