From: Wolfgang Bangerth Date: Wed, 25 Mar 2015 11:34:12 +0000 (-0500) Subject: Address comments from review of #680. X-Git-Tag: v8.3.0-rc1~356^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53e9148fe4e83c1233758fe57bacd970e994741e;p=dealii.git Address comments from review of #680. This is still in response to #659. --- diff --git a/include/deal.II/base/parameter_handler.h b/include/deal.II/base/parameter_handler.h index a93832476b..391db1c3cc 100644 --- a/include/deal.II/base/parameter_handler.h +++ b/include/deal.II/base/parameter_handler.h @@ -1662,8 +1662,8 @@ public: * to refer to parameters under the old name, and they will * automatically be mapped to the new parameter name. * - * It is valid to reference in a parameter file to the same parameter - * multiple times. The value that will ultimately be chosen in such + * It is valid to set the same parameter multiple times in an input file. + * The value that will ultimately be chosen in such * cases is simply the last value set. This rule also applies to * aliases, where the final value of a parameter is the last value * set either through the current name of the parameter or through diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index 6c25ff6057..fa519d059d 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -1646,6 +1646,16 @@ ParameterHandler::declare_alias(const std::string &existing_entry_name, "> that references an entry <" + existing_entry_name + ">, but the latter does not exist.")); + // then also make sure that what is being referred to is in + // fact a parameter (not an alias or subsection) + Assert (entries->get_optional(get_current_full_path(existing_entry_name) + path_separator + "value"), + ExcMessage ("You are trying to declare an alias entry <" + + alias_name + + "> that references an entry <" + + existing_entry_name + + ">, but the latter does not seem to be a " + "parameter declaration.")); + // now also make sure that if the alias has already been // declared, that it is also an alias and refers to the same