diff --git a/dumux/common/deprecated.hh b/dumux/common/deprecated.hh index 53043e42e009cce2f815f78ec3a008aaf2d9f2bf..021f38f41ea5df55faebbd684f2ce32e45614ce7 100644 --- a/dumux/common/deprecated.hh +++ b/dumux/common/deprecated.hh @@ -152,68 +152,68 @@ template <class Mapper> void update(Mapper& mapper) { mapper.update(); }; -template<class Problem, class Element, class SubControlVolume, class ElementSolution> -decltype(auto) extrusionFactor(const Problem& problem, - const Element& element, - const SubControlVolume& scv, - const ElementSolution& elemSol) -{ - using SpatialParams = std::decay_t<decltype(problem.spatialParams())>; - using GlobalPosition = std::decay_t<decltype(scv.center())>; - - static constexpr bool hasNewSpatialParamsInterface = Dune::Std::is_detected< - HasExtrusionFactorDetector, SpatialParams, Element, SubControlVolume, ElementSolution - >::value; - - static constexpr bool hasBaseProblemInterface = Dune::Std::is_detected< - HasBaseProblemExtrusionFactorDetector, Problem, Element, SubControlVolume, ElementSolution - >::value; - - static constexpr bool hasBaseProblemAtPosInterface = Dune::Std::is_detected< - HasBaseProblemExtrusionFactorAtPosDetector, Problem, GlobalPosition - >::value; - - static constexpr bool hasUserDefinedProblemExtrusionFactor = !hasBaseProblemInterface || !hasBaseProblemAtPosInterface; - - if constexpr (hasNewSpatialParamsInterface && hasUserDefinedProblemExtrusionFactor) - DUNE_THROW(Dune::InvalidStateException, - "Extrusion factor defined both in problem implementation (deprecated interface) and spatial params (new interface). " - "Please move the overload in your problem implementation to your spatial parameters."); - - if constexpr (hasNewSpatialParamsInterface) - return problem.spatialParams().extrusionFactor(element, scv, elemSol); - else - return problem.extrusionFactor(element, scv, elemSol); -} - -template<typename Problem, typename Element, typename Scv, typename ElemSol> -decltype(auto) temperature(const Problem& problem, const Element& element, const Scv& scv, const ElemSol& elemSol) -{ - using SpatialParams = std::decay_t<decltype(problem.spatialParams())>; - using GlobalPosition = std::decay_t<decltype(scv.dofPosition())>; - - static constexpr bool hasBaseProbTempAtPosInterface = Dune::Std::is_detected< - HasBaseProblemTemperatureAtPosDetector, Problem, GlobalPosition - >::value; - static constexpr bool hasBaseProbTempInterface = Dune::Std::is_detected< - HasBaseProblemTemperatureDetector, Problem - >::value; - static constexpr bool spatialParamsHaveNewInterface = Dune::Std::is_detected< - HasNewTemperatureDetector, SpatialParams, Element, Scv, ElemSol - >::value; - - static constexpr bool problemHasUserDefinedTemperature = !hasBaseProbTempAtPosInterface || !hasBaseProbTempInterface; - - if constexpr (problemHasUserDefinedTemperature && spatialParamsHaveNewInterface) - DUNE_THROW(Dune::InvalidStateException, - "Temperature defined both in problem implementation (deprecated interface) and spatial params (new interface). " - "Please move the temperature definition in your problem implementation to your spatial parameters."); - - if constexpr (spatialParamsHaveNewInterface) - return problem.spatialParams().temperature(element, scv, elemSol); - else - return problem.temperatureAtPos(scv.dofPosition()); -} +// template<class Problem, class Element, class SubControlVolume, class ElementSolution> +// decltype(auto) extrusionFactor(const Problem& problem, +// const Element& element, +// const SubControlVolume& scv, +// const ElementSolution& elemSol) +// { +// using SpatialParams = std::decay_t<decltype(problem.spatialParams())>; +// using GlobalPosition = std::decay_t<decltype(scv.center())>; +// +// static constexpr bool hasNewSpatialParamsInterface = Dune::Std::is_detected< +// HasExtrusionFactorDetector, SpatialParams, Element, SubControlVolume, ElementSolution +// >::value; +// +// static constexpr bool hasBaseProblemInterface = Dune::Std::is_detected< +// HasBaseProblemExtrusionFactorDetector, Problem, Element, SubControlVolume, ElementSolution +// >::value; +// +// static constexpr bool hasBaseProblemAtPosInterface = Dune::Std::is_detected< +// HasBaseProblemExtrusionFactorAtPosDetector, Problem, GlobalPosition +// >::value; +// +// static constexpr bool hasUserDefinedProblemExtrusionFactor = !hasBaseProblemInterface || !hasBaseProblemAtPosInterface; +// +// if constexpr (hasNewSpatialParamsInterface && hasUserDefinedProblemExtrusionFactor) +// DUNE_THROW(Dune::InvalidStateException, +// "Extrusion factor defined both in problem implementation (deprecated interface) and spatial params (new interface). " +// "Please move the overload in your problem implementation to your spatial parameters."); +// +// if constexpr (hasNewSpatialParamsInterface) +// return problem.spatialParams().extrusionFactor(element, scv, elemSol); +// else +// return problem.extrusionFactor(element, scv, elemSol); +// } +// +// template<typename Problem, typename Element, typename Scv, typename ElemSol> +// decltype(auto) temperature(const Problem& problem, const Element& element, const Scv& scv, const ElemSol& elemSol) +// { +// using SpatialParams = std::decay_t<decltype(problem.spatialParams())>; +// using GlobalPosition = std::decay_t<decltype(scv.dofPosition())>; +// +// static constexpr bool hasBaseProbTempAtPosInterface = Dune::Std::is_detected< +// HasBaseProblemTemperatureAtPosDetector, Problem, GlobalPosition +// >::value; +// static constexpr bool hasBaseProbTempInterface = Dune::Std::is_detected< +// HasBaseProblemTemperatureDetector, Problem +// >::value; +// static constexpr bool spatialParamsHaveNewInterface = Dune::Std::is_detected< +// HasNewTemperatureDetector, SpatialParams, Element, Scv, ElemSol +// >::value; +// +// static constexpr bool problemHasUserDefinedTemperature = !hasBaseProbTempAtPosInterface || !hasBaseProbTempInterface; +// +// if constexpr (problemHasUserDefinedTemperature && spatialParamsHaveNewInterface) +// DUNE_THROW(Dune::InvalidStateException, +// "Temperature defined both in problem implementation (deprecated interface) and spatial params (new interface). " +// "Please move the temperature definition in your problem implementation to your spatial parameters."); +// +// if constexpr (spatialParamsHaveNewInterface) +// return problem.spatialParams().temperature(element, scv, elemSol); +// else +// return problem.temperatureAtPos(scv.dofPosition()); +// } template<class Problem, class Element, class SubControlVolume> decltype(auto) effectiveFluidDensity(const Problem& problem, diff --git a/dumux/porousmediumflow/nonisothermal/volumevariables.hh b/dumux/porousmediumflow/nonisothermal/volumevariables.hh index 6e6ca2bfbc72496f2e23b95d93ea786012a55d9c..b00ab62b6cf389a0834e3f5c70d81dbdd45fe8b0 100644 --- a/dumux/porousmediumflow/nonisothermal/volumevariables.hh +++ b/dumux/porousmediumflow/nonisothermal/volumevariables.hh @@ -29,7 +29,6 @@ #include <type_traits> #include <dune/common/std/type_traits.hh> -#include <dumux/common/deprecated.hh> #include <dumux/material/solidsystems/1csolid.hh> #include <dumux/porousmediumflow/volumevariables.hh> @@ -109,7 +108,7 @@ public: SolidState& solidState) { // retrieve temperature from solution vector, all phases have the same temperature - Scalar T = Deprecated::temperature(problem, element, scv, elemSol); + Scalar T = problem.spatialParams().temperature(element, scv, elemSol); for(int phaseIdx=0; phaseIdx < FluidSystem::numPhases; ++phaseIdx) { fluidState.setTemperature(phaseIdx, T); diff --git a/dumux/porousmediumflow/volumevariables.hh b/dumux/porousmediumflow/volumevariables.hh index 965bebf23486a034d6177cc4ba74393fac5a7a65..dce0d67a2049d7c2c4e61d9141fb451fad70eb13 100644 --- a/dumux/porousmediumflow/volumevariables.hh +++ b/dumux/porousmediumflow/volumevariables.hh @@ -26,8 +26,6 @@ #ifndef DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH #define DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH -#include <dumux/common/deprecated.hh> - namespace Dumux { /*! @@ -69,7 +67,7 @@ public: const Scv& scv) { priVars_ = elemSol[scv.localDofIndex()]; - extrusionFactor_ = Deprecated::extrusionFactor(problem, element, scv, elemSol); + extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol); } /*!