diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index 72478c8bf08e5902611f73ffbb258e97d97c7e84..fc72e9cc043316492eb5030fe985c65c73c8d8c0 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -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) diff --git a/dumux/common/properties/propertysystem.hh b/dumux/common/properties/propertysystem.hh index 5819af0ed76729d758f07370974bcb08ec1447e8..c58b032f1f838cd850db20f14b315794346b6b62 100644 --- a/dumux/common/properties/propertysystem.hh +++ b/dumux/common/properties/propertysystem.hh @@ -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>; }; diff --git a/dumux/discretization/box.hh b/dumux/discretization/box.hh index a7811a21b023ec618fb1cc5fcc0425639335a762..3ac7189877cb8b1babec82fad0b8c6cfa333d788 100644 --- a/dumux/discretization/box.hh +++ b/dumux/discretization/box.hh @@ -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> diff --git a/dumux/discretization/ccmpfa.hh b/dumux/discretization/ccmpfa.hh index c59c73a4e189934fb31ea1e35a24d954b346d61c..8268d077ff1ffdf73b7d6c399e3fef50ff89bec6 100644 --- a/dumux/discretization/ccmpfa.hh +++ b/dumux/discretization/ccmpfa.hh @@ -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> diff --git a/dumux/discretization/cctpfa.hh b/dumux/discretization/cctpfa.hh index 66f2230181217d5f8f6acc4acce45b646d8ab300..b81a0779103753b95d3c6e7fa3c3fd8f4bf585b9 100644 --- a/dumux/discretization/cctpfa.hh +++ b/dumux/discretization/cctpfa.hh @@ -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> diff --git a/dumux/discretization/staggered/freeflow/properties.hh b/dumux/discretization/staggered/freeflow/properties.hh index 1588ca21e4783c0eeeee8c980c99fe339ccce426..78e5e4ebd30b8c12916274ccf45d28feaa29c2f2 100644 --- a/dumux/discretization/staggered/freeflow/properties.hh +++ b/dumux/discretization/staggered/freeflow/properties.hh @@ -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> diff --git a/dumux/multidomain/facet/box/properties.hh b/dumux/multidomain/facet/box/properties.hh index 72303e00bb6da473799360dbf10a9cb13bc2d81d..1256506c5483a0b00db39d8d7b51ddf24b3ff8c1 100644 --- a/dumux/multidomain/facet/box/properties.hh +++ b/dumux/multidomain/facet/box/properties.hh @@ -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 diff --git a/dumux/porousmediumflow/boxdfm/model.hh b/dumux/porousmediumflow/boxdfm/model.hh index b3b217eb7f63c6f82ccad7e0c8d1b6f665721f11..84388e596169f90109c6b4d50a475ff78f950921 100644 --- a/dumux/porousmediumflow/boxdfm/model.hh +++ b/dumux/porousmediumflow/boxdfm/model.hh @@ -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> diff --git a/dumux/porousmediumflow/sequential/properties.hh b/dumux/porousmediumflow/sequential/properties.hh index cd36ab9111a5b69db1f3057d4d308ace39c5f1c1..de283bb5809f9d4b02671a72993409fd7f253c8d 100644 --- a/dumux/porousmediumflow/sequential/properties.hh +++ b/dumux/porousmediumflow/sequential/properties.hh @@ -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> diff --git a/test/porousmediumflow/1p/implicit/network1d3d/problem.hh b/test/porousmediumflow/1p/implicit/network1d3d/problem.hh index 6d8fd5ec8fb065e28475befc6730f011ab8689b1..9c5a4ce6ee91bc853fc7e88f40a8e2430346dad6 100644 --- a/test/porousmediumflow/1p/implicit/network1d3d/problem.hh +++ b/test/porousmediumflow/1p/implicit/network1d3d/problem.hh @@ -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>