]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Also list aliases in the output generated by print_parameters in LaTeX mode.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 22 Mar 2015 23:43:56 +0000 (18:43 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 24 Mar 2015 12:33:31 +0000 (07:33 -0500)
include/deal.II/base/parameter_handler.h
source/base/parameter_handler.cc
tests/bits/parameter_handler_4a_with_alias.cc
tests/bits/parameter_handler_4a_with_alias.output

index 5b5e1b3e33d6d3a79bc2f9faecebb242a2b4498b..50f65328c6d56a4953c2bb1d2f5415d035a75a24 100644 (file)
@@ -1809,7 +1809,7 @@ public:
    * <tt>ParameterHandler</tt> in order to get a valid XML document and all
    * subsections under it.
    *
-   * In <tt>Text</tt> format, the output contains the same information but in
+   * In <tt>LaTeX</tt> format, the output contains the same information but in
    * a format so that the resulting file can be input into a latex document
    * such as a manual for the code for which this object handles run-time
    * parameters. The various sections of parameters are then represented by
index a246f59ff6cfdd3b6bb00279b942094dd2aa4b4f..5f80e2b06f5af8bc54ec871b35682a0c6057e415 100644 (file)
@@ -2140,7 +2140,9 @@ ParameterHandler::print_parameters_section (std::ostream      &out,
       for (boost::property_tree::ptree::const_assoc_iterator
            p = current_section.ordered_begin();
            p != current_section.not_found(); ++p)
-        if (is_parameter_node (p->second) == true)
+        if ((is_parameter_node (p->second) == true)
+            ||
+            (is_alias_node (p->second) == true))
           {
             parameters_exist_here = true;
             break;
@@ -2200,6 +2202,33 @@ ParameterHandler::print_parameters_section (std::ostream      &out,
                     << p->second.get<std::string> ("pattern_description")
                     << std::endl;
               }
+            else if (is_alias_node (p->second) == true)
+              {
+                const std::string alias = p->second.get<std::string>("alias");
+
+                // print name
+                out << "\\item {\\it Parameter name:} {\\tt " << demangle(p->first) << "}\n"
+                    << "\\phantomsection\\label{parameters:";
+                for (unsigned int i=0; i<subsection_path.size(); ++i)
+                  out << subsection_path[i] << "/";
+                out << demangle(p->first);
+                out << "}\n\n"
+                    << std::endl;
+
+                out << "\\index[prmindex]{"
+                    << demangle(p->first)
+                    << "}\n";
+                out << "\\index[prmindexfull]{";
+                for (unsigned int i=0; i<subsection_path.size(); ++i)
+                  out << subsection_path[i] << "!";
+                out << demangle(p->first)
+                    << "}\n";
+
+                // finally print value and default
+                out << "This parameter is an alias for the parameter ``\\texttt{"
+                    << alias << "}''.\n\n"
+                    << std::endl;
+              }
           out << "\\end{itemize}" << std::endl;
         }
 
index a567c1426abbb6a59836813011e887449981b1ed..564f7c23832185df81592a96c44866e1a83f2644 100644 (file)
@@ -61,10 +61,14 @@ int main ()
         prm.declare_entry ("int",
                            "1",
                            Patterns::Integer());
+        prm.declare_alias ("int",
+                           "int_alias");
         prm.declare_entry ("double",
                            "3.1415926",
                            Patterns::Double(),
                            "docs 3");
+        prm.declare_alias ("double",
+                           "double_alias");
       }
       prm.leave_subsection ();
 
index 6dcf0739c9df11c0e55e9ac535471e86ac2f872d..8d5a7a675fc322ea98897e25d5bedcc94aac7ca5 100644 (file)
 
 
 {\it Possible values:} [Double -1.79769e+308...1.79769e+308 (inclusive)]
+\item {\it Parameter name:} {\tt double_alias}
+\phantomsection\label{parameters:Testing/double_alias}
+
+
+\index[prmindex]{double_alias}
+\index[prmindexfull]{Testing!double_alias}
+This parameter is an alias for the parameter ``\texttt{double}''.
+
+
 \item {\it Parameter name:} {\tt int}
 \phantomsection\label{parameters:Testing/int}
 
 
 
 {\it Possible values:} [Integer range -2147483648...2147483647 (inclusive)]
+\item {\it Parameter name:} {\tt int_alias}
+\phantomsection\label{parameters:Testing/int_alias}
+
+
+\index[prmindex]{int_alias}
+\index[prmindexfull]{Testing!int_alias}
+This parameter is an alias for the parameter ``\texttt{int}''.
+
+
 \item {\it Parameter name:} {\tt string list}
 \phantomsection\label{parameters:Testing/string list}
 

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.