#include <inputOutput.hh>
Public Types | |
typedef struct yy_buffer_state * | YY_BUFFER_STATE |
The buffer representing the input file (for the parser) | |
Public Member Functions | |
InputParser (bool quiet=false) | |
void | parse () |
Parses the input file. | |
void | parse (std::string file) |
Parses the input file. | |
InOutParameters & | inputParameters () |
Returns the input data. | |
InOutParameters & | outputParameters () |
Returns the output data. | |
Protected Member Functions | |
virtual std::ostream & | info (std::ostream &os) const |
Returns information in an output stream. | |
Parses an input file and extracts parameters. The parameters are stored in a separate object in hashes and arrays. Another instance of the same class can be used to store output information.
The output operator writes the date and time in a comment and then content of the input parameters, then "end" and then the content of the output parameters (eg. convergence data). This can be used to generate "unfified" result files where the input data is also present. Advice: put the name of the executable and the command line options in a comment on the first line of the output file.
The format of the input file is the following. Comments are C/C++ style. In an input line, only C-style comments are allowed, the // form is only allowed in otherwise empty lines. An example of an input file:
// Here, it begins string title "Title of the problem" double eps 1e-16 bool debug true array string bc { 0 "(0)" 1 "(x)" 2 "(y)" } int iter 10 array string bc { 3 "(x*y)" } end This is ignored
"end" marks the end of the input file, everything after it will be ignored. The possible types are string, double, int and bool (also as arrays – arrays are not allowed to be mixed). An array may be continued (like shown in the example).
The parser is written using a combination of bison(1) and flex(1)
Definition at line 443 of file inputOutput.hh.
The buffer representing the input file (for the parser)
Definition at line 467 of file inputOutput.hh.
Default constructor. Enters the string parameters title, author and comment into the input field with value "(empty)". These may be overriden by the input file.
quiet | If set to true, the output of the current time, the machine name etc. in the output of this class is suppressed. |
|
protectedvirtual |
Returns information in an output stream.
Reimplemented from concepts::OutputOperator.
|
inline |
Returns the input data.
Definition at line 461 of file inputOutput.hh.
|
inline |
Returns the output data.
Definition at line 464 of file inputOutput.hh.