16 #ifndef _FUELCELLSHOP__FCST_UTILITIES_H
17 #define _FUELCELLSHOP__FCST_UTILITIES_H
26 #include <boost/lexical_cast.hpp>
29 #include <boost/tokenizer.hpp>
34 #include <deal.II/base/utilities.h>
35 #include <deal.II/base/exceptions.h>
42 using namespace dealii;
44 namespace FcstUtilities
51 <<
"Can't convert the string " << arg1
52 <<
" to the desired Number type");
63 template <
typename NumType>
74 template <
typename NumType>
95 template <
typename KeyType,
typename ValueType>
96 std::map< KeyType, ValueType >
string_to_map(
const std::vector<std::string>&);
103 template<
typename KeyType,
typename ValueType >
104 std::map< KeyType, ValueType >
string_to_map(
const std::string& name);
133 template<
typename KeyType,
typename ValueType >
134 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);
183 template <
typename ValType>
185 const std::vector<ValType> value_design_var,
186 ParameterHandler& param);
191 template <
typename NumType>
199 const std::string& filename);
211 #endif //_FUELCELLSHOP__FCST_UTILITIES_H
void run_python(std::string script_name, std::string arg)
This function runs external python scripts.
void print_parameter_file_PRM(ParameterHandler ¶m, std::string path="default.prm")
This function prepares an PRM file with ALL your data inside.
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.
int cellId_to_index(std::string &cell_id)
This function determines whether a string is a "valid" representation of a number.
bool is_number(const std::string &s)
This function extracts to parent cell index from the dealii CellID.
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...