Class documentation of Concepts

Loading...
Searching...
No Matches

#include <inputOutput.hh>

Inheritance diagram for concepts::InputParser:
concepts::OutputOperator

Public Types

typedef struct yy_buffer_stateYY_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.
 
InOutParametersinputParameters ()
 Returns the input data.
 
InOutParametersoutputParameters ()
 Returns the output data.
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 Returns information in an output stream.
 

Detailed Description

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)

Author
Philipp Frauenfelder, 2000
Examples
hpFEM2d.cc, hpFEM3d-EV.cc, inputoutput.cc, linearDG1d.cc, and linearFEM1d.cc.

Definition at line 443 of file inputOutput.hh.

Member Typedef Documentation

◆ YY_BUFFER_STATE

The buffer representing the input file (for the parser)

Definition at line 467 of file inputOutput.hh.

Constructor & Destructor Documentation

◆ InputParser()

concepts::InputParser::InputParser ( bool  quiet = false)

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.

Parameters
quietIf set to true, the output of the current time, the machine name etc. in the output of this class is suppressed.

Member Function Documentation

◆ info()

virtual std::ostream & concepts::InputParser::info ( std::ostream &  os) const
protectedvirtual

Returns information in an output stream.

Reimplemented from concepts::OutputOperator.

◆ inputParameters()

InOutParameters & concepts::InputParser::inputParameters ( )
inline

Returns the input data.

Examples
hpFEM2d.cc, hpFEM3d-EV.cc, and inputoutput.cc.

Definition at line 461 of file inputOutput.hh.

◆ outputParameters()

InOutParameters & concepts::InputParser::outputParameters ( )
inline

Returns the output data.

Examples
hpFEM2d.cc, hpFEM3d-EV.cc, and inputoutput.cc.

Definition at line 464 of file inputOutput.hh.


The documentation for this class was generated from the following file: