FEI Package Browser (Single Doxygen Collection)
Version of the Day
|
Functions | |
const char * | version () |
double | cpu_time () |
fei::OutputLevel | string_to_output_level (const std::string &str) |
LinearSystemCore * | get_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 ¶mset) |
void | convert_ParameterSet_to_strings (const fei::ParameterSet *paramset, std::vector< std::string > ¶mStrings) |
The utils namespace contains general utility functions.
|
inline |
Return a const char-ptr containing the fei version.
Definition at line 53 of file fei_utils.hpp.
References FEI_MAJOR_VERSION, FEI_MINOR_VERSION, FEI_OSTRINGSTREAM, FEI_PATCH_VERSION, and fei_VERSION::version().
Referenced by beam_main(), fei::VectorSpace::check_version(), main(), poisson3_main(), version(), fei::FEI_Impl::version(), and FEI_Implementation::version().
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.
Referenced by beam_main(), beam_oldfei_main(), main(), poisson3_main(), poisson_main(), LinSysCoreFilter::residualNorm(), LinSysCoreFilter::solve(), test_benchmarks::test3(), time_raggedtable_insert(), time_set_insert(), and time_set_insert2().
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.
References fei::ALL, fei::BRIEF_LOGS, fei::FULL_LOGS, fei::MATRIX_FILES, fei::NONE, and fei::STATS.
Referenced by snl_fei::LinearSystem_General::parameters(), fei::Matrix_core::parameters(), fei::LogManager::setOutputLevel(), fei::MatrixGraph_Impl2::setParameters(), and fei::VectorSpace::setParameters().
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.
References fei::SharedPtr< T >::get(), fei::Matrix_Impl< T >::getMatrix(), and fei::MatrixReducer::getTargetMatrix().
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.
References fei::MatrixGraph::getConnectivityBlocks(), fei::ConnectivityBlock::getConnectivityIDs(), fei::Pattern::getNumIDs(), fei::VectorSpace::getRecordCollection(), snl_fei::RecordCollection::getRecordWithLocalID(), fei::ConnectivityBlock::getRowConnectivities(), fei::ConnectivityBlock::getRowPattern(), fei::MatrixGraph::getRowSpace(), and fei::ConnectivityBlock::isSymmetric().
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.
Referenced by fei::FEI_Impl::initComplete(), fei::FEI_Impl::parameters(), Factory_Aztec::parameters(), snl_fei_tester::setParameter(), fei::FEI_Impl::solve(), snl_fei_tester::testInitialization(), snl_fei_tester::testLoading(), and snl_fei_tester::testSolve().
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.
Referenced by beam_oldfei_main(), feiDriver_main(), main(), snl_fei::Factory::parameters(), snl_fei::LinearSystem_FEData::parameters(), snl_fei::LinearSystem_General::parameters(), poisson3_main(), poisson_main(), and fei::Solver::solve().
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.
References fei::ParameterSet::add(), FEI_ISTRINGSTREAM, and snl_fei::separate_string().
Referenced by beam_main(), beam_oldfei_main(), feiDriver_main(), test_FEI::get_test_parameters(), fei::FEI_Impl::initComplete(), main(), fei::FEI_Impl::parameters(), Factory_Aztec::parameters(), poisson3_main(), poisson_main(), read_input_and_execute_fullsystem_tests(), test_Utils::serialtest3(), snl_fei_tester::setParameter(), fei::FEI_Impl::solve(), snl_fei_tester::testInitialization(), snl_fei_tester::testLoading(), and snl_fei_tester::testSolve().
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.
References fei::ParameterSet::begin(), fei::Param::BOOL, fei::Param::DOUBLE, fei::ParameterSet::end(), FEI_OSTRINGSTREAM, fei::Param::getBoolValue(), fei::Param::getDoubleValue(), fei::Param::getIntValue(), fei::Param::getName(), fei::Param::getStringValue(), fei::Param::getType(), fei::Param::INT, fei::Param::STRING, and fei::Param::VOID.
Referenced by snl_fei::Factory::parameters(), snl_fei::LinearSystem_FEData::parameters(), snl_fei::LinearSystem_General::parameters(), and fei::Solver::solve().