Commit aa9e32b8 authored by Katharina Heck's avatar Katharina Heck
Browse files

Merge branch 'feature/replace-enablefvgridgeometrycache' into 'master'

replace the property EnableFVGridGeometryCache

See merge request !1748
parents de9c59ac 8d099610
......@@ -123,6 +123,10 @@ DONT_EMIT_CLANG_GRIDGEOMETRY_WARNING."
template<class TypeTag, class MyTypeTag>
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`.
// 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.
......@@ -146,10 +150,24 @@ struct GridGeometry
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>
struct EnableFVGridGeometryCache { using type = UndefinedProperty; }; //!< specifies if geometric data is saved (faster, but more memory consuming)
template<class TypeTag>
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>
struct VolumeVariables { using type = UndefinedProperty; }; //!< The secondary variables within a sub-control volume
......
......@@ -63,7 +63,7 @@ template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::BoxModel>
{
private:
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>();
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public:
......
......@@ -42,9 +42,9 @@ namespace Dumux {
* This builds up the sub control volumes and sub control volume faces
* for each element.
* \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
*/
template<class GG, bool enableFVGridGeometryCache>
template<class GG, bool enableGridGeometryCache>
class BoxFVElementGeometry;
//! specialization in case the FVElementGeometries are stored
......
......@@ -68,7 +68,7 @@ struct BoxDefaultGridGeometryTraits
*/
template<class Scalar,
class GridView,
bool enableFVGridGeometryCache = false,
bool enableGridGeometryCache = false,
class Traits = BoxDefaultGridGeometryTraits<GridView> >
class BoxFVGridGeometry;
......
......@@ -114,7 +114,7 @@ private:
using NodalIndexSet = GetPropType<TypeTag, Properties::DualGridNodalIndexSet>;
using Traits = CCMpfaFVGridGeometryTraits<GridView, NodalIndexSet, PrimaryIV, SecondaryIV>;
public:
using type = CCMpfaFVGridGeometry<GridView, Traits, getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>()>;
using type = CCMpfaFVGridGeometry<GridView, Traits, getPropValue<TypeTag, Properties::EnableGridGeometryCache>()>;
};
#pragma GCC diagnostic pop
......
......@@ -62,7 +62,7 @@ template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::CCTpfaModel>
{
private:
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>();
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
using GridView = GetPropType<TypeTag, Properties::GridView>;
public:
using type = CCTpfaFVGridGeometry<GridView, enableCache>;
......
......@@ -42,10 +42,10 @@ namespace Dumux {
* 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.
* \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
*/
template<class GG, bool EnableFVGridGeometryCache>
template<class GG, bool enableGridGeometryCache>
class CCMpfaFVElementGeometry;
/*!
......
......@@ -43,10 +43,10 @@ namespace Dumux {
* 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.
* \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
*/
template<class GG, bool enableFVGridGeometryCache>
template<class GG, bool enableGridGeometryCache>
class CCTpfaFVElementGeometry;
/*!
......
......@@ -74,7 +74,7 @@ struct CCTpfaDefaultGridGeometryTraits
* \note This class is specialized for versions with and without caching the fv geometries on the grid view
*/
template<class GridView,
bool enableFVGridGeometryCache = false,
bool enableGridGeometryCache = false,
class Traits = CCTpfaDefaultGridGeometryTraits<GridView> >
class CCTpfaFVGridGeometry;
......
......@@ -55,9 +55,17 @@ public:
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
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::FiniteVolumeModel> { static constexpr bool value = false; };
#pragma GCC diagnostic pop
//! We do not store the volume variables by default
template<class TypeTag>
......
......@@ -89,7 +89,7 @@ struct FVGridGeometry<TypeTag, TTag::StaggeredFreeFlowModel>
{
private:
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 Traits = StaggeredFreeFlowDefaultFVGridGeometryTraits<GridView, upwindSchemeOrder>;
public:
......
......@@ -35,10 +35,10 @@ namespace Dumux {
* 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.
* \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
*/
template<class GG, bool enableFVGridGeometryCache>
template<class GG, bool enableGridGeometryCache>
class StaggeredFVElementGeometry;
/*!
......
......@@ -42,9 +42,9 @@ namespace Dumux {
* bulk grid facets. This builds up the sub control volumes and sub control volume
* faces for an element.
* \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
*/
template<class GG, bool enableFVGridGeometryCache>
template<class GG, bool enableGridGeometryCache>
class BoxFacetCouplingFVElementGeometry;
//! specialization in case the FVElementGeometries are stored
......
......@@ -79,7 +79,7 @@ struct BoxFacetCouplingDefaultGridGeometryTraits
*/
template<class Scalar,
class GridView,
bool enableFVGridGeometryCache = false,
bool enableGridGeometryCache = false,
class Traits = BoxFacetCouplingDefaultGridGeometryTraits<GridView> >
class BoxFacetCouplingFVGridGeometry;
......
......@@ -88,7 +88,7 @@ template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::BoxFacetCouplingModel>
{
private:
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>();
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public:
......
......@@ -46,9 +46,9 @@ namespace Dumux {
* This builds up the sub control volumes and sub control volume faces for each element.
*
* \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
*/
template<class GG, bool enableFVGridGeometryCache>
template<class GG, bool enableGridGeometryCache>
class BoxDfmFVElementGeometry;
//! Specialization in case the FVElementGeometries are stored
......
......@@ -80,7 +80,7 @@ struct BoxDfmDefaultGridGeometryTraits
*/
template<class Scalar,
class GridView,
bool enableFVGridGeometryCache = false,
bool enableGridGeometryCache = false,
class Traits = BoxDfmDefaultGridGeometryTraits<GridView> >
class BoxDfmFVGridGeometry;
......
......@@ -52,7 +52,7 @@ template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::BoxDfmModel>
{
private:
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>();
static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public:
......
......@@ -284,7 +284,7 @@ struct EnableGridFluxVariablesCache<TypeTag, TTag::IncompressibleTest> { static
We enable caching for the FV grid geometry
```cpp
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; };
struct EnableGridGeometryCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; };
```
The cache stores values that were already calculated for later usage. This makes the simulation faster.
We leave the namespace Properties.
......@@ -544,7 +544,7 @@ struct EnableGridVolumeVariablesCache<TypeTag, TTag::TracerTest> { static conste
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::TracerTest> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::TracerTest> { static constexpr bool value = true; };
struct EnableGridGeometryCache<TypeTag, TTag::TracerTest> { static constexpr bool value = true; };
```
We use the same grid as in the stationary one-phase model, a structured 2D grid:
```cpp
......
......@@ -101,7 +101,7 @@ template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; };
// We enable caching for the FV grid geometry
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; };
struct EnableGridGeometryCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; };
//The cache stores values that were already calculated for later usage. This makes the simulation faster.
// We leave the namespace Properties.
}
......
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