From 31dd8cbc8e813f441275f69ea52c8b735b17b548 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Fri, 17 Feb 2017 13:54:31 +0100 Subject: [PATCH] [constant] Add configurable name --- dumux/material/components/constant.hh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dumux/material/components/constant.hh b/dumux/material/components/constant.hh index 5298cd8636..61adc0fced 100644 --- a/dumux/material/components/constant.hh +++ b/dumux/material/components/constant.hh @@ -40,6 +40,7 @@ NEW_PROP_TAG(ProblemLiquidDensity); NEW_PROP_TAG(ProblemLiquidKinematicViscosity); NEW_PROP_TAG(ProblemGasDensity); NEW_PROP_TAG(ProblemGasKinematicViscosity); +NEW_PROP_TAG(ComponentName); // set default values SET_SCALAR_PROP(NumericModel, ProblemMolarMass, 1.0); @@ -47,6 +48,7 @@ SET_SCALAR_PROP(NumericModel, ProblemLiquidDensity, 1.0); SET_SCALAR_PROP(NumericModel, ProblemLiquidKinematicViscosity, 1.0); SET_SCALAR_PROP(NumericModel, ProblemGasDensity, 1.0); SET_SCALAR_PROP(NumericModel, ProblemGasKinematicViscosity, 1.0); +SET_STRING_PROP(NumericModel, ComponentName, "c"); } // end namespace Properties /*! @@ -65,8 +67,12 @@ public: /*! * \brief A human readable name for the component. */ - static std::string name() - { return "Constant"; } + static const std::string& name() + { + static const std::string name + = GET_PARAM_FROM_GROUP(TypeTag, std::string, Component, Name); + return name; + } /*! * \brief The mass in \f$\mathrm{[kg]}\f$ of one mole of the component. -- GitLab