Commit 33f511f2 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[parameters] allow the same parameter name within different groups

So far, it was not allowed 
- to have the same parameter name within more than one group,

- to deduct the same parameter name from more than one property.

I assume historical reasons for this. In the early years, there were no
groups at all and these measures should facilitate an easy migration
from without groups to groups. Since this migration has been done for
quite a while now, there are no reasons for keeping these restrictions.
Even more so, since they are rather contradictory to the group concept.
Moreover, assigning a parameter to the wrong group will result in being
listed as "unused parameter" at a very prominent position.

Reviewed by gruenich.



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14131 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent ba989240
......@@ -193,7 +193,7 @@ void print(std::ostream &os = std::cout)
if (hasDeprecatedKeys_<TypeTag>(tree))
{
os << "# DEPRECATED Run-time specified parameters:" << std::endl;
os << "# DEPRECATED run-time specified parameters:" << std::endl;
drt.report(os);
os << "# Replace by:" << std::endl;
unrt.report(os);
......@@ -207,7 +207,7 @@ void print(std::ostream &os = std::cout)
if (unusedParams.size() > 0)
{
os << "# UNUSED PARAMETERS:" << std::endl;
os << "# UNUSED parameters:" << std::endl;
for (auto it = unusedParams.begin(); it != unusedParams.end(); ++it)
{
os << *it << " = \"" << tree.get(*it, "") << "\"" << std::endl;
......@@ -294,21 +294,7 @@ private:
else
b = &(it->second);
if (b->groupName != groupName) {
DUNE_THROW(Dune::InvalidStateException,
"GET_*_PARAM for parameter '" << paramName
<< "' called for at least two different groups ('"
<< b->groupName << "' and '" << groupName << "')");
}
if (b->propertyName != propertyName) {
DUNE_THROW(Dune::InvalidStateException,
"GET_*_PARAM for parameter '" << paramName
<< "' called for at least two different properties ('"
<< b->propertyName << "' and '" << propertyName << "')");
}
if (b->paramTypeName != paramTypeName) {
if (b->paramTypeName != paramTypeName && b->groupName == groupName) {
DUNE_THROW(Dune::InvalidStateException,
"GET_*_PARAM for parameter '" << paramName << "' in group '"
<< groupName << "' called with at least two different types ("
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment