<h3>Specific improvements</h3>
<ol>
+ <li>
+ Fixed: The ParameterHandler class can now deal with including one parameter
+ file from another.
+ <br>
+ (Wolfgang Bangerth, 2013/08/25)
+ </li>
+
<li>
New: The method VectorTools::compute_normal_flux_constraints can be used to
force a vector finite element function to be normal to the boundary.
* set Geometry = [0,1]x[0,3]
* @endcode
* Input may be sorted into subsection trees in order to give the input a
- * logical structure.
+ * logical structure, and input files may include other files.
*
* The ParameterHandler class is discussed in detail in the @ref step_19
* "step-19" example program, and is used in more realistic situations in
* <tt>=</tt> sign.
*
*
+ * <h3>Including other input files</h3>
+ *
+ * An input file can include other include files using the syntax
+ * @code
+ * ...
+ * include some_other_file.prm
+ * ...
+ * @endcode
+ * The file so referenced is searched for relative to the current
+ * directory (not relative to the directory in which the including
+ * parameter file is located, since this is not known to all three
+ * versions of the read_input() function).
+ *
+ *
* <h3>Reading data from input sources</h3>
*
- * In order to read input you can use three possibilities: reading from
+ * In order to read input there are three possibilities: reading from
* an <tt>std::istream</tt> object, reading from a file of which the name
* is given and reading from a string in memory in which the lines are
* separated by <tt>@\n</tt> characters. These possibilities are used as
}
}
+ // an include statement?
+ if ((line.find ("INCLUDE ") == 0) ||
+ (line.find ("include ") == 0))
+ {
+ // erase "set" statement and eliminate
+ // spaces around the '='
+ line.erase (0, 7);
+ while ((line.size() > 0) && (line[0] == ' '))
+ line.erase (0, 1);
+
+ // the remainder must then be a filename
+ if (line.size() == 0)
+ {
+ std::cerr << "Line <" << lineno
+ << "> of file <" << input_filename
+ << "> is an include statement but does not name a file!"
+ << std::endl;
+
+ return false;
+ }
+
+ std::ifstream input (line);
+ if (!input)
+ {
+ std::cerr << "Line <" << lineno
+ << "> of file <" << input_filename
+ << "> is an include statement but the file <"
+ << line << "> could not be opened!"
+ << std::endl;
+
+ return false;
+ }
+ else
+ return read_input (input);
+ }
+
// this line matched nothing known
std::cerr << "Line <" << lineno
<< "> of file <" << input_filename