Commit e0beecb3 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[discretization][properties] add pragmas around usages of FVGridGeometry

Prevent the emission of compiler warnings once the property is deprecated.
See the discussion of !1647 for more details.
parent 78d19059
......@@ -114,8 +114,18 @@ struct ElementBoundaryTypes { using type = UndefinedProperty; };
// TODO: Remove deprecated property FVGridGeometry after 3.1
template<class TypeTag, class MyTypeTag>
struct FVGridGeometry { using type = UndefinedProperty; }; //!< The type of the global finite volume geometry
// 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.
// Use diagnostic pragmas to prevent the emission of a warning message.
// TODO after 3.1: change default vale to `UndefinedProperty`, remove pragmas
// and comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<class TypeTag, class MyTypeTag>
struct GridGeometry { using type = GetPropType<TypeTag, Properties::FVGridGeometry>; }; //!< The type of the global finite volume geometry
#pragma GCC diagnostic pop
template<class TypeTag, class MyTypeTag>
struct EnableFVGridGeometryCache { using type = UndefinedProperty; }; //!< specifies if geometric data is saved (faster, but more memory consuming)
......
......@@ -91,7 +91,17 @@ struct GetNextTypeTag<TypeTag, Property, std::tuple<FirstTypeTag, Args...>, std:
template<class TypeTag, template<class,class> class Property, class LastTypeTag>
struct GetDefined<TypeTag, Property, std::tuple<LastTypeTag>>
{
// As of clang 8, the following alias triggers compiler warnings if instantiated
// from something like `GetPropType<..., DeprecatedProperty>`, even if that is
// contained in a diagnostic pragma construct that should prevent these warnings.
// As a workaround, also add the pragmas around this line. The desired warnings
// from instantiating `GetPropType<..., DeprecatedProperty>` without pragmas are
// still issued both by gcc and clang.
// See the discussion in MR 1647 for more details.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
using LastType = Property<TypeTag, LastTypeTag>;
#pragma GCC diagnostic pop
using type = std::conditional_t<isDefinedProperty<LastType>(int{}), LastType,
typename GetNextTypeTag<TypeTag, Property, std::tuple<LastTypeTag>, void>::type>;
};
......@@ -99,7 +109,11 @@ struct GetDefined<TypeTag, Property, std::tuple<LastTypeTag>>
template<class TypeTag, template<class,class> class Property, class FirstTypeTag, class ...Args>
struct GetDefined<TypeTag, Property, std::tuple<FirstTypeTag, Args...>>
{
// See the comment above.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
using FirstType = Property<TypeTag, FirstTypeTag>;
#pragma GCC diagnostic pop
using type = std::conditional_t<isDefinedProperty<FirstType>(int{}), FirstType,
typename GetNextTypeTag<TypeTag, Property, std::tuple<FirstTypeTag, Args...>, void>::type>;
};
......
......@@ -51,6 +51,13 @@ namespace TTag {
struct BoxModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
} // end namespace TTag
// Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`.
// 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 GridGeometry, remove the pragmas and this comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//! Set the default for the global finite volume geometry
template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::BoxModel>
......@@ -62,6 +69,7 @@ private:
public:
using type = BoxFVGridGeometry<Scalar, GridView, enableCache>;
};
#pragma GCC diagnostic pop
//! The grid volume variables vector class
template<class TypeTag>
......
......@@ -96,6 +96,13 @@ public:
using type = CCMpfaOInteractionVolume< Traits >;
};
// Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`.
// 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 GridGeometry, remove the pragmas and this comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//! Set the default for the global finite volume geometry
template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::CCMpfaModel>
......@@ -109,6 +116,7 @@ private:
public:
using type = CCMpfaFVGridGeometry<GridView, Traits, getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>()>;
};
#pragma GCC diagnostic pop
//! The grid volume variables vector class
template<class TypeTag>
......
......@@ -50,6 +50,13 @@ namespace TTag {
struct CCTpfaModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
} // end namespace TTag
// Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`.
// 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 GridGeometry, remove the pragmas and this comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//! Set the default for the global finite volume geometry
template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::CCTpfaModel>
......@@ -60,6 +67,7 @@ private:
public:
using type = CCTpfaFVGridGeometry<GridView, enableCache>;
};
#pragma GCC diagnostic pop
//! The grid volume variables vector class
template<class TypeTag>
......
......@@ -76,6 +76,13 @@ public:
static constexpr int value = numEq - dim;
};
// Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`.
// 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 GridGeometry, remove the pragmas and this comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//! The default fv grid geometry
template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::StaggeredFreeFlowModel>
......@@ -88,6 +95,7 @@ private:
public:
using type = StaggeredFVGridGeometry<GridView, enableCache, Traits>;
};
#pragma GCC diagnostic pop
//! The variables living on the faces
template<class TypeTag>
......
......@@ -76,6 +76,13 @@ template<class TypeTag>
struct ElementBoundaryTypes<TypeTag, TTag::BoxFacetCouplingModel>
{ using type = BoxFacetCouplingElementBoundaryTypes<GetPropType<TypeTag, Properties::BoundaryTypes>>; };
// Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`.
// 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 GridGeometry, remove the pragmas and this comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//! Set the default for the grid finite volume geometry
template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::BoxFacetCouplingModel>
......@@ -87,6 +94,7 @@ private:
public:
using type = BoxFacetCouplingFVGridGeometry<Scalar, GridView, enableCache>;
};
#pragma GCC diagnostic pop
} // namespace Properties
} // namespace Dumux
......
......@@ -40,6 +40,13 @@ namespace TTag {
struct BoxDfmModel { using InheritsFrom = std::tuple<BoxModel>; };
} // end namespace TTag
// Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`.
// 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 GridGeometry, remove the pragmas and this comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//! Set the default for the global finite volume geometry
template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::BoxDfmModel>
......@@ -51,6 +58,7 @@ private:
public:
using type = BoxDfmFVGridGeometry<Scalar, GridView, enableCache>;
};
#pragma GCC diagnostic pop
//! The flux variables cache class specific to box-dfm porous medium flow models
template<class TypeTag>
......
......@@ -139,6 +139,13 @@ public:
static const int value = 2*dim;
};
// Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`.
// 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 GridGeometry, remove the pragmas and this comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//! A simplified grid geometry for compatibility with new style models
template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::SequentialModel>
......@@ -153,6 +160,7 @@ struct FVGridGeometry<TypeTag, TTag::SequentialModel>
public:
using type = MockFVGridGeometry;
};
#pragma GCC diagnostic pop
//! For compatibility with new style models we need a solution vector type
template<class TypeTag>
......
......@@ -65,6 +65,13 @@ template<class TypeTag>
struct Grid<TypeTag, TTag::TubesTest> { using type = Dune::FoamGrid<1, 3>; };
#endif
// Dumux 3.1 changes the property `FVGridGeometry` to `GridGeometry`.
// 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 GridGeometry, remove the pragmas and this comment.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// if we have pt scotch use the reordering dof mapper to optimally sort the dofs (cc)
template<class TypeTag>
struct FVGridGeometry<TypeTag, TTag::TubesTestCCTpfa>
......@@ -95,6 +102,7 @@ private:
public:
using type = BoxFVGridGeometry<Scalar, GridView, enableCache, BoxDefaultGridGeometryTraits<GridView, MapperTraits>>;
};
#pragma GCC diagnostic pop
// Set the problem property
template<class TypeTag>
......
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