From e45f3ee2b04c1002f6cb0188ab8ee4a1488066ed Mon Sep 17 00:00:00 2001 From: IvBu <st116086@stud.uni-stuttgart.de> Date: Wed, 29 Jun 2022 16:14:14 +0200 Subject: [PATCH] Remove deprecated code. --- dumux/common/deprecated.hh | 124 +++++++++--------- .../nonisothermal/volumevariables.hh | 3 +- dumux/porousmediumflow/volumevariables.hh | 4 +- 3 files changed, 64 insertions(+), 67 deletions(-) diff --git a/dumux/common/deprecated.hh b/dumux/common/deprecated.hh index 53043e42e0..021f38f41e 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 6e6ca2bfbc..b00ab62b6c 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 965bebf234..dce0d67a20 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); } /*! -- GitLab