17 #ifndef _FUELCELLSHOP__FCST_UTILITIES_H
18 #define _FUELCELLSHOP__FCST_UTILITIES_H
27 #include <boost/lexical_cast.hpp>
32 #include <base/utilities.h>
33 #include <base/exceptions.h>
34 #include <base/parameter_handler.h>
45 using namespace dealii;
47 namespace FcstUtilities
54 <<
"Can't convert the string " << arg1
55 <<
" to the desired Number type");
66 template <
typename NumType>
77 template <
typename NumType>
99 template <
typename KeyType,
typename ValueType>
100 std::map< KeyType, ValueType >
string_to_map(
const std::vector<std::string>&);
109 template<
typename KeyType,
typename ValueType >
110 std::map< KeyType, ValueType >
string_to_map(
const std::string& name);
119 std::map< unsigned int, std::string > string_to_map<>(
const std::string& name);
139 template<
typename KeyType,
typename ValueType >
140 std::map< KeyType, std::vector<ValueType> >
split_mapvalue_list(
const std::map< KeyType, std::string >&,
const char delimiter =
';');
160 void run_python(std::string script_name,std::string arg);
178 template <
typename ValType>
180 const ValType value_design_var,
181 ParameterHandler& param);
185 template <
typename NumType>
193 const std::string& filename);
205 #endif //_FUELCELLSHOP__FCST_UTILITIES_H
void run_python(std::string script_name, std::string arg)
This function runs external python scripts.
std::string number_to_string(const NumType &num)
Function for casting from double to string.
bool file_exists(const std::string &file_name)
Check if a file exists.
void modify_parameter_file(const std::string name_design_var, const ValType value_design_var, ParameterHandler ¶m)
This routine is used to parse the input parameter.
void read_parameter_files(ParameterHandler ¶m, const std::string &filename)
This function reads parameter files written in both prm and xml formats.
NumType string_to_number(const std::string &)
Function to convert a std::string into Number template.
bool is_number(const std::string &s)
This function determines whether a string is a "valid" representation of a number.
void print_parameter_file_XML(ParameterHandler ¶m, std::string path="default.xml")
This function prepares an XML file with ALL your data inside.
unsigned char string_to_number< unsigned char >(const std::string &str)
Function to convert a std::string into an unsigned char such as types::material_id and types::boundar...
DeclException1(ExcWrongString, std::string,<< "Can't convert the string "<< arg1<< " to the desired Number type")
Exception shown when a particular string can't be converted to Number type.
std::string find_fcst_root()
This function returns the address of the fcst root directory.
std::map< KeyType, ValueType > string_to_map(const std::vector< std::string > &)
Function to convert a std::vector< std::string > into std::map< KeyType, ValueType >...
std::map< KeyType, std::vector< ValueType > > split_mapvalue_list(const std::map< KeyType, std::string > &, const char delimiter= ';')
This function takes a std::map<KeyType, std::string>, and std::string contains text separated by a de...