]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Address comments from review of #680. 689/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 25 Mar 2015 11:34:12 +0000 (06:34 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 25 Mar 2015 11:34:12 +0000 (06:34 -0500)
This is still in response to #659.

include/deal.II/base/parameter_handler.h
source/base/parameter_handler.cc

index a93832476bf323b660406eaf93d8ec754db235f4..391db1c3cc54a5cf79b93110fbe69d473e331171 100644 (file)
@@ -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
index 6c25ff6057d85a4b6229c1ad2c06326a262b2322..fa519d059dce9f4b7a5c3d65d5a99c8272e2bd68 100644 (file)
@@ -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<std::string>(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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.