www.mooseframework.org
Namespaces | Functions
MooseUtils.h File Reference

Go to the source code of this file.

Namespaces

 libMesh
 The following methods are specializations for using the libMesh::Parallel::packed_range_* routines for std::strings.
 
 libMesh::Parallel
 
 MooseUtils
 

Functions

int MooseUtils::levenshteinDist (const std::string &s1, const std::string &s2)
 Computes and returns the Levenshtein distance between strings s1 and s2. More...
 
void MooseUtils::escape (std::string &str)
 This function will escape all of the standard C++ escape characters so that they can be printed. More...
 
std::string MooseUtils::trim (const std::string &str, const std::string &white_space=" \t\n\v\f\r")
 Standard scripting language trim function. More...
 
bool MooseUtils::pathContains (const std::string &expression, const std::string &string_to_find, const std::string &delims="/")
 This function tokenizes a path and checks to see if it contains the string to look for. More...
 
bool MooseUtils::checkFileReadable (const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true)
 Checks to see if a file is readable (exists and permissions) More...
 
bool MooseUtils::checkFileWriteable (const std::string &filename, bool throw_on_unwritable=true)
 Check if the file is writable (path exists and permissions) More...
 
void MooseUtils::parallelBarrierNotify (const libMesh::Parallel::Communicator &comm)
 This function implements a parallel barrier function but writes progress to stdout. More...
 
void MooseUtils::serialBegin (const libMesh::Parallel::Communicator &comm)
 This function marks the begin of a section of code that is executed in serial rank by rank. More...
 
void MooseUtils::serialEnd (const libMesh::Parallel::Communicator &comm)
 Closes a section of code that is executed in serial rank by rank, and that was opened with a call to serialBegin. More...
 
bool MooseUtils::hasExtension (const std::string &filename, std::string ext, bool strip_exodus_ext=false)
 Function tests if the supplied filename as the desired extension. More...
 
std::pair< std::string, std::string > MooseUtils::splitFileName (std::string full_file)
 Function for splitting path and filename. More...
 
std::string MooseUtils::camelCaseToUnderscore (const std::string &camel_case_name)
 Function for converting a camel case name to a name containing underscores. More...
 
std::string MooseUtils::underscoreToCamelCase (const std::string &underscore_name, bool leading_upper_case)
 Function for converting an underscore name to a camel case name. More...
 
std::string MooseUtils::shortName (const std::string &name)
 Function for stripping name after the file / in parser block. More...
 
std::string MooseUtils::baseName (const std::string &name)
 Function for string the information before the final / in a parser block. More...
 
template<typename T1 , typename T2 >
bool MooseUtils::doesMapContainValue (const std::map< T1, T2 > &the_map, const T2 &value)
 This routine is a simple helper function for searching a map by values instead of keys. More...
 
bool MooseUtils::absoluteFuzzyEqual (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether two variables are equal within an absolute tolerance. More...
 
bool MooseUtils::absoluteFuzzyGreaterEqual (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether a variable is greater than or equal to another variable within an absolute tolerance. More...
 
bool MooseUtils::absoluteFuzzyGreaterThan (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether a variable is greater than another variable within an absolute tolerance. More...
 
bool MooseUtils::absoluteFuzzyLessEqual (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether a variable is less than or equal to another variable within an absolute tolerance. More...
 
bool MooseUtils::absoluteFuzzyLessThan (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether a variable is less than another variable within an absolute tolerance. More...
 
bool MooseUtils::relativeFuzzyEqual (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether two variables are equal within a relative tolerance. More...
 
bool MooseUtils::relativeFuzzyGreaterEqual (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether a variable is greater than or equal to another variable within a relative tolerance. More...
 
bool MooseUtils::relativeFuzzyGreaterThan (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether a variable is greater than another variable within a relative tolerance. More...
 
bool MooseUtils::relativeFuzzyLessEqual (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether a variable is less than or equal to another variable within a relative tolerance. More...
 
bool MooseUtils::relativeFuzzyLessThan (const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
 Function to check whether a variable is less than another variable within a relative tolerance. More...
 
void MooseUtils::MaterialPropertyStorageDump (const HashMap< const libMesh::Elem *, HashMap< unsigned int, MaterialProperties >> &props)
 Function to dump the contents of MaterialPropertyStorage for debugging purposes. More...
 
void MooseUtils::indentMessage (const std::string &prefix, std::string &message, const char *color=COLOR_CYAN)
 Indents the supplied message given the prefix and color. More...
 
std::string & MooseUtils::removeColor (std::string &msg)
 remove ANSI escape sequences for teminal color from msg More...
 
std::list< std::string > MooseUtils::getFilesInDirs (const std::list< std::string > &directory_list)
 Retrieves the names of all of the files contained within the list of directories passed into the routine. More...
 
std::string MooseUtils::getLatestMeshCheckpointFile (const std::list< std::string > &checkpoint_files)
 Returns the most recent checkpoint or mesh file given a list of files. More...
 
std::string MooseUtils::getLatestAppCheckpointFileBase (const std::list< std::string > &checkpoint_files)
 
bool MooseUtils::wildCardMatch (std::string name, std::string search_string)
 
template<typename T >
void MooseUtils::tokenize (const std::string &str, std::vector< T > &elements, unsigned int min_len=1, const std::string &delims="/")
 This function will split the passed in string on a set of delimiters appending the substrings to the passed in vector. More...
 
template<typename T >
bool MooseUtils::tokenizeAndConvert (const std::string &str, std::vector< T > &tokenized_vector, const std::string &delimiter=" \t\n\v\f\r")
 tokenizeAndConvert splits a string using delimiter and then converts to type T. More...
 
std::string MooseUtils::toUpper (const std::string &name)
 Convert supplied string to upper case. More...
 
template<typename T >
MooseUtils::concatenate (T c1, const T &c2)
 Returns a container that contains the content of second passed in container inserted into the first passed in container (set or map union). More...
 
template<typename T >
std::vector< T > MooseUtils::concatenate (std::vector< T > c1, const std::vector< T > &c2)
 Returns a vector that contains is teh concatenation of the two passed in vectors. More...
 
template<typename T >
std::vector< T > MooseUtils::concatenate (std::vector< T > c1, const T &item)
 Returns the passed in vector with the item appended to it. More...
 
template<typename T >
int MooseUtils::numDigits (const T &num)
 Return the number of digits for a number. More...