OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
Classes | |
class | FCSTdatabase |
This class is for interfacing with SQL databases, *for the purpose of accessing and storing simulation results. More... | |
class | DatabaseOC |
This class is for storing a list of up to 5 parameters and is used as a way of informing the FCSTdatabase class about the model you wish to store/access. More... | |
Functions | |
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. | |
template<typename NumType > | |
NumType | string_to_number (const std::string &) |
Function to convert a std::string into Number template. | |
template<typename NumType > | |
std::vector< NumType > | string_to_number (const std::vector< std::string > &) |
Function to convert a std::vector< std::string > into std::vector < Number template >. | |
template<typename KeyType , typename ValueType > | |
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 >. | |
template<typename KeyType , typename ValueType > | |
std::map< KeyType, ValueType > | string_to_map (const std::string &name) |
This function is the same as the previous one. | |
template<> | |
std::map< unsigned int, std::string > | string_to_map (const std::string &name) |
This function is a particular reimplementation of the previous one. | |
template<typename KeyType , typename 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 delimiter . | |
void | print_parameter_file_XML (ParameterHandler ¶m) |
This function prepares an XML file with ALL your data inside. | |
std::string | find_fcst_root () |
This function returns the address of the fcst root directory. | |
void | run_python (std::string script_name, std::string arg) |
This function runs external python scripts. | |
template<typename NumType > | |
std::string | number_to_string (const NumType &num) |
Function for casting from double to string. | |
FcstUtilities::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 FcstUtilities::find_fcst_root | ( | ) |
This function returns the address of the fcst root directory.
It presumes that you are executing from within the data folder - an exception will be thrown otherwise.
std::string FcstUtilities::number_to_string | ( | const NumType & | num | ) |
Function for casting from double to string.
Uses boost lexical cast.
void FcstUtilities::print_parameter_file_XML | ( | ParameterHandler & | param | ) |
This function prepares an XML file with ALL your data inside.
void FcstUtilities::run_python | ( | std::string | script_name, |
std::string | arg | ||
) |
This function runs external python scripts.
User must provide the script name and argument. It is presumed that the script resides in the python folder.
std::map< KeyType, std::vector<ValueType> > FcstUtilities::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 delimiter
.
It splits the std::string into std::vector<ValueType>, removing all the leading and trailing spaces. It returns std::map< KeyType, std::vector<ValueType> >. The default value of the delimiter
is semi-colon
";".
Value
string. std::map< KeyType, ValueType > FcstUtilities::string_to_map | ( | const std::vector< std::string > & | ) |
Function to convert a std::vector< std::string > into std::map< KeyType, ValueType >.
This function is used to convert a string like "2 : 3.86" into a std::map
where Key is 2 and Value is 3.86. This function is useful to convert a Patterns::Map
(of ParameterHandler
class of deal.ii
) into a useful data map.
KeyType
as unsigned
int
and ValueType
as double
. But, the capabilities can be extended. std::map< KeyType, ValueType > FcstUtilities::string_to_map | ( | const std::string & | name | ) |
This function is the same as the previous one.
The only difference is that this function takes std::string instead of std::vector<std::string>.
std::map< unsigned int, std::string > FcstUtilities::string_to_map | ( | const std::string & | name | ) |
This function is a particular reimplementation of the previous one.
NumType FcstUtilities::string_to_number | ( | const std::string & | ) |
Function to convert a std::string into Number template.
Currently, it is templated only for double
and unsigned
int
types. But it can be easily extended for other numeric data types.
Input string should be free from blank spaces at the beginning and end.
deal.ii
Utilities namespace, but it has certain limitations as it doesn't do effective error checking for wrong input arguments. For that purpose, a new function is written here using boost::lexical_cast. std::vector<NumType> FcstUtilities::string_to_number | ( | const std::vector< std::string > & | ) |
Function to convert a std::vector< std::string > into std::vector < Number template >.
Currently, it is templated only for double
and unsigned
int
types. But it can be easily extended for other numeric data types.
Input strings should be free from blank spaces at the beginning and end.