Flow123d  release_3.0.0-879-gd0f69e9
main.h
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file main.h
15  * @brief
16  */
17 
18 #include <string>
20 #include "input/accessors.hh"
21 #include "input/type_output.hh"
23 #include "system/exceptions.hh"
25 
26 
27 using namespace std;
28 
29 #ifndef MAIN_H
30 #define MAIN_H
31 
32 
33 
34 class Application : public ApplicationBase {
35 public:
36  TYPEDEF_ERR_INFO( EI_InputVersionStr, string);
37  DECLARE_EXCEPTION( ExcVersionFormat,
38  << "Wrong format of the version specification: "
39  << EI_InputVersionStr::qval);
40 
41 
42  /// Root of the Input::Type tree. Description of whole input structure.
43  static Input::Type::Record & get_input_type();
44 
45  /// Application constructor.
46  Application(int argc, char ** argv);
47 
48  /**
49  * Displays program version and build info.
50  * Pass version information to Profiler.
51  *
52  * TODO: Split these two functionalities.
53  */
54  void display_version();
55 
56  /**
57  * Read main input file
58  *
59  * Returns accessor to the root Record.
60  */
61  Input::Record read_input();
62 
63  /// Destructor
64  virtual ~Application();
65 
66 protected:
67 
68  /**
69  * Run application.
70  *
71  * Read input and solve problem.
72  */
73  virtual void run();
74 
75  /**
76  * Check pause_after_run flag defined in input file.
77  */
78  virtual void after_run();
79 
80 
81  /**
82  * Parse command line parameters.
83  * @param[in] argc command line argument count
84  * @param[in] argv command line arguments
85  */
86  virtual void parse_cmd_line(const int argc, char ** argv);
87 
88 private:
89 
90  /// Get version of program and other base data from rev_num.h and store them to map
91  Input::Type::RevNumData get_rev_num_data();
92 
93  /// Main Flow123d problem
95 
96  /// filename of main input file
98 
99  //int passed_argc_;
100  //char ** passed_argv_;
101 
102  /// Description of possible command line arguments.
104 
105  /// If true, we do output of profiling information.
107 
108  /// If true, preserves output of balance in YAML format.
110 
111  /// root input record
113 };
114 
115 
116 
117 
118 #endif
119 
120 //-----------------------------------------------------------------------------
121 // vim: set cindent:
122 
string main_input_filename_
filename of main input file
Definition: main.h:97
#define DECLARE_EXCEPTION(ExcName, Format)
Macro for simple definition of exceptions.
Definition: exceptions.hh:158
bool use_profiler
If true, we do output of profiling information.
Definition: main.h:106
HC_ExplicitSequential * problem_
Main Flow123d problem.
Definition: main.h:94
Stores version of program and other base data of application.
Definition: type_output.hh:44
Accessor to the data with type Type::Record.
Definition: accessors.hh:292
bool yaml_balance_output_
If true, preserves output of balance in YAML format.
Definition: main.h:109
#define TYPEDEF_ERR_INFO(EI_Type, Type)
Macro to simplify declaration of error_info types.
Definition: exceptions.hh:194
string program_arguments_desc_
Description of possible command line arguments.
Definition: main.h:103
Record type proxy class.
Definition: type_record.hh:182
Class for solution of steady or unsteady flow with sequentially coupled explicit transport.
Input::Record root_record
root input record
Definition: main.h:112