From bde8fbb0d5ae06dde936bde1e82c0110c34abfde Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Tue, 17 Oct 2017 10:35:31 +0200 Subject: [PATCH] [params] Use getParam method for Problem.EnableGravity --- dumux/discretization/box/darcyslaw.hh | 8 +------- dumux/discretization/cellcentered/mpfa/darcyslaw.hh | 3 +-- dumux/discretization/cellcentered/tpfa/darcyslaw.hh | 6 ------ dumux/porousmediumflow/problem.hh | 3 ++- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/dumux/discretization/box/darcyslaw.hh b/dumux/discretization/box/darcyslaw.hh index 6ff4c3b3a4..e547c78ca7 100644 --- a/dumux/discretization/box/darcyslaw.hh +++ b/dumux/discretization/box/darcyslaw.hh @@ -40,12 +40,6 @@ namespace Dumux { -namespace Properties -{ -// forward declaration of properties -NEW_PROP_TAG(ProblemEnableGravity); -} - /*! * \ingroup DarcysLaw * \brief Specialization of Darcy's Law for the box method. @@ -96,7 +90,7 @@ public: outsideK *= outsideVolVars.extrusionFactor(); const auto K = problem.spatialParams().harmonicMean(insideK, outsideK, scvf.unitOuterNormal()); - static const bool enableGravity = GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity); + static const bool enableGravity = getParamFromGroup<bool>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Problem.EnableGravity"); const auto& shapeValues = fluxVarCache.shapeValues(); diff --git a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh index 89f5275528..3fb7b3eccb 100644 --- a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh @@ -33,7 +33,6 @@ namespace Dumux namespace Properties { // forward declaration of properties -NEW_PROP_TAG(ProblemEnableGravity); NEW_PROP_TAG(MpfaHelper); } @@ -226,7 +225,7 @@ private: const FluxVariablesCache& fluxVarsCache, const unsigned int phaseIdx) { - static const bool gravity = GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity); + static const bool gravity = getParamFromGroup<bool>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Problem.EnableGravity"); if (!gravity) return Scalar(0.0); diff --git a/dumux/discretization/cellcentered/tpfa/darcyslaw.hh b/dumux/discretization/cellcentered/tpfa/darcyslaw.hh index 3ad30cd06e..431827c2e8 100644 --- a/dumux/discretization/cellcentered/tpfa/darcyslaw.hh +++ b/dumux/discretization/cellcentered/tpfa/darcyslaw.hh @@ -38,12 +38,6 @@ namespace Dumux { -namespace Properties -{ -// forward declaration of properties -NEW_PROP_TAG(ProblemEnableGravity); -} - /*! * \ingroup DarcysLaw * \brief Specialization of Darcy's Law for the CCTpfa method. diff --git a/dumux/porousmediumflow/problem.hh b/dumux/porousmediumflow/problem.hh index a14cdb781f..0b48ea8c93 100644 --- a/dumux/porousmediumflow/problem.hh +++ b/dumux/porousmediumflow/problem.hh @@ -67,7 +67,8 @@ public: , spatialParams_(std::make_shared<SpatialParams>(this->asImp_())) { // TODO: spatial params init? - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + const bool enableGravity = getParamFromGroup<bool>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Problem.EnableGravity"); + if (enableGravity) gravity_[dimWorld-1] = -9.81; } -- GitLab