PRISMS-PF  v2.1
inputFileReader.h
Go to the documentation of this file.
1 // Class to read in the user input from parameters.in
2 
3 #ifndef INCLUDE_INPUTFILEREADER_H_
4 #define INCLUDE_INPUTFILEREADER_H_
5 
7 #include <deal.II/base/parameter_handler.h>
8 #include <fstream>
9 #include <vector>
10 #include <string>
11 
13 {
14 public:
15  // Constructor
16  inputFileReader(std::string input_file_name, variableAttributeLoader variable_attributes);
17 
18  // Method to get a list of entry values from multiple subsections in an input file
19  std::vector<std::string> get_subsection_entry_list(const std::string parameters_file_name, const std::string subsec_name,
20  const std::string entry_name, const std::string default_entry) const;
21 
22  // Method to count the number of related entries in an input file
23  unsigned int get_number_of_entries(const std::string parameters_file_name,const std::string keyword, const std::string entry_name) const;
24 
25  // Get the trailing part of the entry name after a specified string (used to extract the model constant names)
26  std::vector<std::string> get_entry_name_ending_list(const std::string parameters_file_name,const std::string keyword, const std::string entry_name_begining) const;
27 
28  // Method to declare the parameters to be read from an input file
29  void declare_parameters(dealii::ParameterHandler & parameter_handler,
30  const std::vector<fieldType> var_types, const std::vector<PDEType> var_eq_types, const unsigned int num_of_constants, const std::vector<bool>) const;
31 
32  // Method to check if a line has the desired contents and if so, extract it
33  bool parse_line(std::string line, const std::string keyword, const std:: string entry_name, std::string & out_string, bool expect_equals_sign) const;
34 
35 
36  // Variables
37  dealii::ParameterHandler parameter_handler;
38  std::vector<fieldType> var_types;
39  std::vector<PDEType> var_eq_types;
40  unsigned int num_pp_vars;
41  unsigned int num_constants;
42  std::vector<std::string> model_constant_names;
43  std::vector<std::string> var_names;
44  unsigned int number_of_dimensions;
45  std::vector<bool> var_nucleates;
46  std::vector<bool> var_nonlinear;
47 };
48 
49 #endif /* INCLUDE_INPUTFILEREADER_H_ */
dealii::ParameterHandler parameter_handler
std::vector< PDEType > var_eq_types
void declare_parameters(dealii::ParameterHandler &parameter_handler, const std::vector< fieldType > var_types, const std::vector< PDEType > var_eq_types, const unsigned int num_of_constants, const std::vector< bool >) const
std::vector< fieldType > var_types
unsigned int get_number_of_entries(const std::string parameters_file_name, const std::string keyword, const std::string entry_name) const
inputFileReader(std::string input_file_name, variableAttributeLoader variable_attributes)
unsigned int number_of_dimensions
std::vector< std::string > get_subsection_entry_list(const std::string parameters_file_name, const std::string subsec_name, const std::string entry_name, const std::string default_entry) const
std::vector< bool > var_nonlinear
std::vector< std::string > get_entry_name_ending_list(const std::string parameters_file_name, const std::string keyword, const std::string entry_name_begining) const
bool parse_line(std::string line, const std::string keyword, const std::string entry_name, std::string &out_string, bool expect_equals_sign) const
std::vector< std::string > var_names
unsigned int num_constants
std::vector< bool > var_nucleates
std::vector< std::string > model_constant_names
unsigned int num_pp_vars