Skip to content
Snippets Groups Projects
Commit 9acfbfa7 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

Merge branch 'feature/getparam-default-template-arg' into 'master'

[parameters] default to string in getParam

See merge request !3669
parents 5339875d 8e584078
No related branches found
No related tags found
1 merge request!3669[parameters] default to string in getParam
Pipeline #37116 passed
......@@ -22,6 +22,7 @@ be evaluated with the function values provided in the same order as the names wh
- __PDESolver__: The LinearPDESolver/NewtonSolver now has an `apply` method that returns a bool (true if converged) instead of throwing an exception
- __Freeflow Nonisothermal__: An issue with the compositional heat flux's upwinding calculations has been fixed
- __Compositional Staggered__: The staggered discretization method has been updated to fix inconsistencies in handling density when evaluating diffusive boundary fluxes. In addition, a total mass balance is now always considered, rather than a total mole balance.
- __Parameters__: The template argument for `getParam` and `getParamFromGroup` now defaults to `std::string`, such that for string parameters one can simply write `const auto param = getParam("MyParam");`
### Immediate interface changes not allowing/requiring a deprecation period:
......
......@@ -135,7 +135,7 @@ private:
* \note \code auto endTime = getParam<double>("TimeManager.TEnd"); \endcode
* \note Once this has been called the first time, you cannot modify the parameter tree anymore
*/
template<typename T, typename... Args>
template<typename T = std::string, typename... Args>
T getParam(Args&&... args)
{ return Parameters::getTree().template get<T>(std::forward<Args>(args)... ); }
......@@ -145,7 +145,7 @@ T getParam(Args&&... args)
* \note \code auto endTime = getParamFromGroup<double>("FreeFlow", "TimeManager.TEnd"); \endcode
* \note Once this has been called the first time, you cannot modify the parameter tree anymore
*/
template<typename T, typename... Args>
template<typename T = std::string, typename... Args>
T getParamFromGroup(Args&&... args)
{ return Parameters::getTree().template getFromGroup<T>(std::forward<Args>(args)... ); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment