25#ifndef DUMUX_COMMON_DEPRECATED_HH
26#define DUMUX_COMMON_DEPRECATED_HH
30#include <dune/common/ftraits.hh>
31#include <dune/common/exceptions.hh>
32#include <dune/common/std/type_traits.hh>
47#pragma clang diagnostic push
48#pragma clang diagnostic ignored "-Wdeprecated-declarations"
52using DetectFVGeometryHasSCVGeometry =
decltype(std::declval<G>().geometry(std::declval<typename G::SubControlVolume>()));
55using DetectFVGeometryHasSCVFGeometry =
decltype(std::declval<G>().geometry(std::declval<typename G::SubControlVolumeFace>()));
58constexpr inline bool hasSCVGeometryInterface()
59{
return Dune::Std::is_detected<DetectFVGeometryHasSCVGeometry, G>::value; }
62constexpr inline bool hasSCVFGeometryInterface()
63{
return Dune::Std::is_detected<DetectFVGeometryHasSCVFGeometry, G>::value; }
66#pragma clang diagnostic pop
69template<
bool enableWaterDiffusionInAir>
70struct ExtendedRichardsHelper
73 [[deprecated(
"Enabling the extended Richards model through a template parameter/properties is deprecated and will be removed after release (3.6). Use the new model ExtendedRichards instead.")]]
74 static constexpr void extendedRichardsWithTemplateParameter() {}
76 static constexpr bool isExtendedRichards()
78 if constexpr(enableWaterDiffusionInAir)
79 extendedRichardsWithTemplateParameter<enableWaterDiffusionInAir>();
80 return enableWaterDiffusionInAir;
88template<
class PrimaryVariables,
class StateType>
89class RichardsSwitchablePrimaryVariables :
public PrimaryVariables
91 using ParentType = PrimaryVariables;
94 using ParentType::ParentType;
96 using ParentType::operator=;
98 [[deprecated(
"Will be removed after release (3.6). Normal Richards does not require setting a state. Use ExtendedRichards for extended model. "
99 "After removing all .setState()/.state() calls in the user files the remaining deprecation warnings can be removed by changing the PrimaryVariables property to Dune::FieldVector. "
100 "template<class TypeTag> "
101 "struct PrimaryVariables<TypeTag, TTag::Richards> "
102 "{ using type = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; }")]]
103 StateType state()
const
109 [[deprecated(
"Will be removed after release (3.6). Normal Richards does not require setting a state. Use ExtendedRichards for extended model."
110 "After removing all .setState()/.state() calls in the user files the remaining deprecation warnings can be removed by changing the PrimaryVariables property to Dune::FieldVector. "
111 "template<class TypeTag> "
112 "struct PrimaryVariables<TypeTag, TTag::Richards> "
113 "{ using type = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; }")]]
114 void setState(StateType state)
116 state_ = std::move(state);
121 void invalidateState()
128 bool stateIsSet_{
false};
139template<
class PrimaryVariables,
class StateType>
140struct NumEqVectorTraits<Deprecated::RichardsSwitchablePrimaryVariables<PrimaryVariables, StateType>>
142 static constexpr std::size_t
numEq = PrimaryVariables::size();
151template <
class PrimaryVariables,
class StateType>
152struct FieldTraits<
Dumux::Deprecated::RichardsSwitchablePrimaryVariables<PrimaryVariables, StateType>>
153:
public FieldTraits<PrimaryVariables>
A helper to deduce a vector with the same size as numbers of equations.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
Definition: deprecated.hh:149
PrimaryVariables type
Definition: deprecated.hh:143
Definition: numeqvector.hh:33
static constexpr std::size_t numEq
Definition: numeqvector.hh:34