FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Functions
fei::utils Namespace Reference

Functions

const char * version ()
 
double cpu_time ()
 
fei::OutputLevel string_to_output_level (const std::string &str)
 
LinearSystemCoreget_LinearSystemCore (fei::Matrix *matrix)
 
void getConnectivityArrays (fei::MatrixGraph &matrixGraph, std::vector< int > &nodes, std::vector< int > &elem_offsets)
 
void char_ptrs_to_strings (int numStrings, const char *const *charstrings, std::vector< std::string > &stdstrings)
 
void strings_to_char_ptrs (std::vector< std::string > &stdstrings, int &numStrings, const char **&charPtrs)
 
void parse_strings (std::vector< std::string > &stdstrings, const char *separator_string, fei::ParameterSet &paramset)
 
void convert_ParameterSet_to_strings (const fei::ParameterSet *paramset, std::vector< std::string > &paramStrings)
 

Detailed Description

The utils namespace contains general utility functions.

Function Documentation

const char* fei::utils::version ( )
inline

Return a const char-ptr containing the fei version.

Definition at line 53 of file fei_utils.hpp.

double fei::utils::cpu_time ( )

Return CPU time. To measure an elapsed time, take the difference between two returned values.

Definition at line 46 of file fei_utils.cpp.

fei::OutputLevel fei::utils::string_to_output_level ( const std::string &  str)

Convert a string to an fei::OutputLevel enum value. Valid string values are strings that match one of the enum names in fei_fwd.hpp. If an invalid string is given, then fei::NONE will be returned.

Definition at line 58 of file fei_utils.cpp.

LinearSystemCore * fei::utils::get_LinearSystemCore ( fei::Matrix matrix)

Attempt to extract a LinearSystemCore from a fei::Matrix. Returns NULL if unsuccessful.

Definition at line 81 of file fei_utils.cpp.

void fei::utils::getConnectivityArrays ( fei::MatrixGraph matrixGraph,
std::vector< int > &  nodes,
std::vector< int > &  elem_offsets 
)

Return element-node connectivity in a pair of arrays, as follows: The 'nodes' array holds all of the node-identifiers (for nodes connected to local elements). The 'elem_offsets' array holds offsets into the 'nodes' array at which the nodes for a given element can be found.

Thus:

num-elems = elem_offsets.size()-1; nodes for i-th element lie in these positions: nodes[elem_offsets[i] .. elem_offsets[i+1]-1]

Definition at line 98 of file fei_utils.cpp.

void fei::utils::char_ptrs_to_strings ( int  numStrings,
const char *const *  charstrings,
std::vector< std::string > &  stdstrings 
)

Given an integer length 'numStrings' and a list of pointers-to-char-pointer, wrap them in a std::vector of std::string objects.

Definition at line 164 of file fei_utils.cpp.

void fei::utils::strings_to_char_ptrs ( std::vector< std::string > &  stdstrings,
int &  numStrings,
const char **&  charPtrs 
)

populate an array of raw char-ptrs with the 'c_str()' pointers from the specified std::string objects. The caller is responsible for deleting the char** array, but NOT the individual char* pointers in the array.

Definition at line 178 of file fei_utils.cpp.

void fei::utils::parse_strings ( std::vector< std::string > &  stdstrings,
const char *  separator_string,
fei::ParameterSet paramset 
)

Populate a fei::ParameterSet object, taking input from the specified list of strings. Each string is assumed to contain a key-value pair, separated by the specified 'separator_string'.

Definition at line 191 of file fei_utils.cpp.

void fei::utils::convert_ParameterSet_to_strings ( const fei::ParameterSet paramset,
std::vector< std::string > &  paramStrings 
)

Convert the contents of a fei::ParameterSet object to a collection of strings. Each string will contain a space-separated key-value pair.

Definition at line 270 of file fei_utils.cpp.