Classes | |
| class | Buffer |
| Base class for a buffer. More... | |
| class | CircularBuffer |
| An optimized circular buffer. More... | |
| class | DelimitedFileReaderTempl |
| Utility class for reading delimited data (e.g., CSV data). More... | |
| class | LIFOBuffer |
| An optimized LIFO (Last In First Out) buffer. More... | |
| class | SharedPool |
| Originally From https://stackoverflow.com/a/27837534/2042320. More... | |
| class | StaticallyAllocatedSet |
| Optimized set with static allocation. More... | |
Typedefs | |
| typedef DelimitedFileReaderTempl< double > | DelimitedFileReader |
| typedef DelimitedFileReaderTempl< std::string > | DelimitedFileOfStringReader |
Functions | |
| std::string | trim (const std::string &str, const std::string &white_space=" \t\n\v\f\r") |
| Standard scripting language trim function. | |
| template<typename T > | |
| void | 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. | |
| template<class T > | |
| bool | convert (const std::string &str, T &value, const bool throw_on_failure) |
| Takes the string representation of a value and converts it to the value. | |
| template<typename T > | |
| bool | 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. | |
| std::string | toUpper (std::string name) |
| Convert supplied string to upper case. | |
| std::string | toLower (std::string name) |
| Convert supplied string to lower case. | |
| std::string | stringJoin (const std::vector< std::string > &values, const std::string &separator=" ") |
Concatenates value into a single string separated by separator. | |
| template<class T , typename... Args> | |
| auto | reset (int, T &obj, Args... args) -> decltype(obj.reset(args...), void()) |
| template<class T , typename... Args> | |
| void | reset (double, T &, Args...) |
| bool | isFinitePoint (const Point &point) |
| std::filesystem::path | pathjoin (const std::filesystem::path &p) |
| std::string | runTestsExecutable () |
| std::string | findTestRoot () |
| bool | parsesToReal (const std::string &input, Real *parsed_real) |
| std::string | installedInputsDir (const std::string &app_name, const std::string &dir_name, const std::string &extra_error_msg) |
| std::string | docsDir (const std::string &app_name) |
| std::string | mooseDocsURL (const std::string &path) |
| std::string | replaceAll (std::string str, const std::string &from, const std::string &to) |
| std::string | convertLatestCheckpoint (std::string orig) |
| int | levenshteinDist (const std::string &s1, const std::string &s2) |
| void | escape (std::string &str) |
| std::string | removeExtraWhitespace (const std::string &input) |
| bool | pathContains (const std::string &expression, const std::string &string_to_find, const std::string &delims) |
| bool | pathExists (const std::string &path) |
| bool | checkFileReadable (const std::string &filename, bool check_line_endings, bool throw_on_unreadable, bool check_for_git_lfs_pointer) |
| bool | checkForGitLFSPointer (std::ifstream &file) |
| bool | checkFileWriteable (const std::string &filename, bool throw_on_unwritable) |
| void | parallelBarrierNotify (const Parallel::Communicator &comm, bool messaging) |
| void | serialBegin (const libMesh::Parallel::Communicator &comm, bool warn) |
| void | serialEnd (const libMesh::Parallel::Communicator &comm, bool warn) |
| bool | hasExtension (const std::string &filename, std::string ext, bool strip_exodus_ext) |
| std::string | getExtension (const std::string &filename, const bool rfind) |
| std::string | stripExtension (const std::string &s, const bool rfind) |
| std::string | getCurrentWorkingDir () |
| void | makedirs (const std::string &dir_name, bool throw_on_failure) |
| void | removedirs (const std::string &dir_name, bool throw_on_failure) |
| std::string | camelCaseToUnderscore (const std::string &camel_case_name) |
| std::string | underscoreToCamelCase (const std::string &underscore_name, bool leading_upper_case) |
| std::string | shortName (const std::string &name) |
| std::string | baseName (const std::string &name) |
| std::string | hostname () |
| unsigned short | getTermWidth (bool use_environment) |
| void | MaterialPropertyStorageDump (const HashMap< const libMesh::Elem *, HashMap< unsigned int, MaterialProperties > > &props) |
| std::string & | removeColor (std::string &msg) |
| void | addLineBreaks (std::string &message, unsigned int line_width) |
| void | indentMessage (const std::string &prefix, std::string &message, const char *color, bool indent_first_line, const std::string &post_prefix) |
| std::list< std::string > | listDir (const std::string path, bool files_only) |
| std::list< std::string > | getFilesInDirs (const std::list< std::string > &directory_list, const bool files_only) |
| std::string | getLatestCheckpointFilePrefix (const std::list< std::string > &checkpoint_files) |
| bool | wildCardMatch (std::string name, std::string search_string) |
| bool | globCompare (const std::string &candidate, const std::string &pattern, std::size_t c, std::size_t p) |
| bool | beginsWith (const std::string &value, const std::string &begin_value) |
| ExecFlagEnum | getDefaultExecFlagEnum () |
| int | stringToInteger (const std::string &input, bool throw_on_failure) |
| void | linearPartitionItems (dof_id_type num_items, dof_id_type num_chunks, dof_id_type chunk_id, dof_id_type &num_local_items, dof_id_type &local_items_begin, dof_id_type &local_items_end) |
| processor_id_type | linearPartitionChunk (dof_id_type num_items, dof_id_type num_chunks, dof_id_type item_id) |
| std::vector< std::string > | split (const std::string &str, const std::string &delimiter, std::size_t max_count) |
| std::vector< std::string > | rsplit (const std::string &str, const std::string &delimiter, std::size_t max_count) |
| void | createSymlink (const std::string &target, const std::string &link) |
| void | clearSymlink (const std::string &link) |
| std::size_t | fileSize (const std::string &filename) |
| std::string | realpath (const std::string &path) |
| BoundingBox | buildBoundingBox (const Point &p1, const Point &p2) |
| std::string | prettyCppType (const std::string &cpp_type) |
| std::string | canonicalPath (const std::string &path) |
| bool | startsWith (const std::string &string1, const std::string &string2) |
| void | replaceStart (std::string &string1, const std::string &string2, const std::string &string3) |
| bool | isAllLowercase (const std::string &str) |
| template<typename T > | |
| void | swap (std::vector< T > &data, const std::size_t idx0, const std::size_t idx1, const libMesh::Parallel::Communicator &comm) |
| Swap function for serial or distributed vector of data. | |
| template<typename T > | |
| void | swap (std::vector< T > &data, const std::size_t idx0, const std::size_t idx1, const libMesh::Parallel::Communicator *comm_ptr=nullptr) |
| template<typename T > | |
| void | shuffle (std::vector< T > &data, MooseRandom &generator, const std::size_t seed_index=0) |
| Shuffle function for serial or distributed vector of data that shuffles in place. | |
| template<typename T > | |
| void | shuffle (std::vector< T > &data, MooseRandom &generator, const libMesh::Parallel::Communicator &comm) |
| template<typename T > | |
| void | shuffle (std::vector< T > &data, MooseRandom &generator, const std::size_t seed_index, const libMesh::Parallel::Communicator &comm) |
| template<typename T > | |
| void | shuffle (std::vector< T > &data, MooseRandom &generator, const std::size_t seed_index, const libMesh::Parallel::Communicator *comm_ptr) |
| template<typename T > | |
| std::vector< T > | resample (const std::vector< T > &data, MooseRandom &generator, const std::size_t seed_index=0) |
| Randomly resample a vector of data, allowing a value to be repeated. | |
| template<typename T > | |
| std::vector< T > | resample (const std::vector< T > &data, MooseRandom &generator, const libMesh::Parallel::Communicator &comm) |
| template<typename T > | |
| std::vector< T > | resample (const std::vector< T > &data, MooseRandom &generator, const std::size_t seed_index, const libMesh::Parallel::Communicator &comm) |
| template<typename T > | |
| std::vector< T > | resample (const std::vector< T > &data, MooseRandom &generator, const std::size_t seed_index, const libMesh::Parallel::Communicator *comm_ptr) |
| template<typename T , typename ActionFunctor > | |
| void | resampleWithFunctor (const std::vector< T > &data, const ActionFunctor &functor, MooseRandom &generator, const std::size_t seed_index=0) |
| Randomly resample a vector of data and apply a functor, allowing a value to be repeated. | |
| template<typename T , typename ActionFunctor > | |
| void | resampleWithFunctor (const std::vector< T > &data, const ActionFunctor &functor, MooseRandom &generator, const libMesh::Parallel::Communicator &comm) |
| template<typename T , typename ActionFunctor > | |
| void | resampleWithFunctor (const std::vector< T > &data, const ActionFunctor &functor, MooseRandom &generator, const std::size_t seed_index, const libMesh::Parallel::Communicator &comm) |
| template<typename T , typename ActionFunctor > | |
| void | resampleWithFunctor (const std::vector< T > &data, const ActionFunctor &functor, MooseRandom &generator, const std::size_t seed_index, const libMesh::Parallel::Communicator *comm_ptr) |
| typedef DelimitedFileReaderTempl<std::string> MooseUtils::DelimitedFileOfStringReader |
Definition at line 201 of file DelimitedFileReader.h.
| typedef DelimitedFileReaderTempl<double> MooseUtils::DelimitedFileReader |
Definition at line 200 of file DelimitedFileReader.h.
| void MooseUtils::addLineBreaks | ( | std::string & | message, |
| unsigned int | line_width | ||
| ) |
Definition at line 741 of file MooseUtils.C.
| std::string MooseUtils::baseName | ( | const std::string & | name | ) |
Definition at line 629 of file MooseUtils.C.
Referenced by Moose::Builder::walkRaw().
| bool MooseUtils::beginsWith | ( | const std::string & | value, |
| const std::string & | begin_value | ||
| ) |
Definition at line 966 of file MooseUtils.C.
Referenced by CommandLine::initSubAppCommandLine(), CommandLine::parse(), and CommandLine::setCommandLineParam().
| BoundingBox MooseUtils::buildBoundingBox | ( | const Point & | p1, |
| const Point & | p2 | ||
| ) |
Definition at line 1142 of file MooseUtils.C.
Referenced by PropertyReadFile::PropertyReadFile().
| std::string MooseUtils::camelCaseToUnderscore | ( | const std::string & | camel_case_name | ) |
Definition at line 579 of file MooseUtils.C.
Referenced by MooseApp::appNameToLibName().
| std::string MooseUtils::canonicalPath | ( | const std::string & | path | ) |
Definition at line 1184 of file MooseUtils.C.
Referenced by Registry::determineDataFilePath(), and Moose::DataFileUtils::getPath().
| bool MooseUtils::checkFileReadable | ( | const std::string & | filename, |
| bool | check_line_endings, | ||
| bool | throw_on_unreadable, | ||
| bool | check_for_git_lfs_pointer | ||
| ) |
Definition at line 265 of file MooseUtils.C.
Referenced by MooseServer::addResourcesForDocument(), FileMesh::buildMesh(), Registry::determineDataFilePath(), docsDir(), MooseApp::dynamicRegistration(), ExodusFileTimes::ExodusFileTimes(), findTestRoot(), MooseServer::gatherDocumentDefinitionLocations(), FileMeshGenerator::generate(), Moose::DataFileUtils::getPath(), ExodusTimeSequenceStepper::init(), installedInputsDir(), RestartableDataReader::isAvailable(), ADFParser::JITCompile(), MooseApp::loadLibraryAndDependencies(), Exodus::output(), Parser::parse(), MooseUtils::DelimitedFileReaderTempl< T >::read(), JSONFileReader::read(), MultiApp::readCommandLineArguments(), SolutionUserObjectBase::readXda(), MooseApp::run(), runTestsExecutable(), and ValueCache< T >::ValueCache().
| bool MooseUtils::checkFileWriteable | ( | const std::string & | filename, |
| bool | throw_on_unwritable | ||
| ) |
Definition at line 318 of file MooseUtils.C.
Referenced by PNGOutput::makePNG().
| bool MooseUtils::checkForGitLFSPointer | ( | std::ifstream & | file | ) |
Definition at line 301 of file MooseUtils.C.
Referenced by checkFileReadable().
| void MooseUtils::clearSymlink | ( | const std::string & | link | ) |
Definition at line 1084 of file MooseUtils.C.
Referenced by createSymlink(), and CSV::initialSetup().
| bool MooseUtils::convert | ( | const std::string & | str, |
| T & | value, | ||
| const bool | throw_on_failure | ||
| ) |
Takes the string representation of a value and converts it to the value.
For standard numeric types, this gets around the deficiencies in the STL stoi and stod methods where they might successfully convert part of a string to a number when we'd instead prefer to get a failure.
For string and string-derived types, this does a direct copy and does not utilize a stream.
For all other types, this uses the stringstream >> operator to fill the value.
| str | The string to convert from |
| value | The typed value to fill |
| throw_on_failure | If true, throw a std::invalid_argument on failure |
Definition at line 96 of file MooseStringUtils.h.
| std::string MooseUtils::convertLatestCheckpoint | ( | std::string | orig | ) |
Definition at line 168 of file MooseUtils.C.
Referenced by SetupRecoverFileBaseAction::act(), FileMeshGenerator::deduceCheckpointPath(), and FEProblemBase::FEProblemBase().
| void MooseUtils::createSymlink | ( | const std::string & | target, |
| const std::string & | link | ||
| ) |
Definition at line 1071 of file MooseUtils.C.
Referenced by CSV::output().
| std::string MooseUtils::docsDir | ( | const std::string & | app_name | ) |
Definition at line 136 of file MooseUtils.C.
Referenced by MooseApp::run().
| void MooseUtils::escape | ( | std::string & | str | ) |
Definition at line 218 of file MooseUtils.C.
Referenced by MooseServer::addParametersToList(), MooseServer::addValuesToList(), MooseServer::getHoverDisplayText(), YAMLFormatter::printBlockOpen(), InputFileFormatter::printParams(), YAMLFormatter::printParams(), and JsonSyntaxTree::setParams().
| std::size_t MooseUtils::fileSize | ( | const std::string & | filename | ) |
Definition at line 1106 of file MooseUtils.C.
Referenced by Exodus::output().
| std::string MooseUtils::findTestRoot | ( | ) |
Definition at line 86 of file MooseUtils.C.
Referenced by MooseApp::runInputs().
| std::string MooseUtils::getCurrentWorkingDir | ( | ) |
Definition at line 447 of file MooseUtils.C.
Referenced by MooseApp::runInputs().
| ExecFlagEnum MooseUtils::getDefaultExecFlagEnum | ( | ) |
Definition at line 972 of file MooseUtils.C.
Referenced by AddNodalNormalsAction::act(), AdvancedOutput::addValidParams(), Output::getDefaultExecFlagEnum(), Control::getExecuteOptions(), OutputOnWarehouse::OutputOnWarehouse(), SetupDebugAction::validParams(), SetupInterface::validParams(), MOOSEQuantityToNEML2< T, state >::validParams(), NEML2Assembly::validParams(), NEML2BatchIndexGenerator::validParams(), NEML2FEInterpolation::validParams(), and NEML2ModelExecutor::validParams().
| std::string MooseUtils::getExtension | ( | const std::string & | filename, |
| const bool | rfind | ||
| ) |
Definition at line 422 of file MooseUtils.C.
Referenced by CommonOutputAction::act(), SplitMeshAction::act(), SetupMeshAction::modifyParamsForUseSplit(), and stripExtension().
| std::list< std::string > MooseUtils::getFilesInDirs | ( | const std::list< std::string > & | directory_list, |
| const bool | files_only | ||
| ) |
Definition at line 819 of file MooseUtils.C.
Referenced by MooseApp::getCheckpointFiles().
| std::string MooseUtils::getLatestCheckpointFilePrefix | ( | const std::list< std::string > & | checkpoint_files | ) |
Definition at line 830 of file MooseUtils.C.
Referenced by convertLatestCheckpoint(), and MooseApp::setRestartRecoverFileBase().
| unsigned short MooseUtils::getTermWidth | ( | bool | use_environment | ) |
Initialize the value we intend to populate just in case the system call fails
Definition at line 651 of file MooseUtils.C.
Referenced by FormattedTable::printTable().
| bool MooseUtils::globCompare | ( | const std::string & | candidate, |
| const std::string & | pattern, | ||
| std::size_t | c, | ||
| std::size_t | p | ||
| ) |
Definition at line 943 of file MooseUtils.C.
Referenced by RestartableDataReporter::execute(), globCompare(), and ReferenceResidualConvergence::initialSetup().
| bool MooseUtils::hasExtension | ( | const std::string & | filename, |
| std::string | ext, | ||
| bool | strip_exodus_ext | ||
| ) |
Definition at line 398 of file MooseUtils.C.
Referenced by FileMesh::FileMesh(), FileRangeBuilder::FileRangeBuilder(), getLatestCheckpointFilePrefix(), and SolutionUserObjectBase::initialSetup().
| std::string MooseUtils::hostname | ( | ) |
Definition at line 635 of file MooseUtils.C.
Referenced by hostname().
| void MooseUtils::indentMessage | ( | const std::string & | prefix, |
| std::string & | message, | ||
| const char * | color, | ||
| bool | indent_first_line, | ||
| const std::string & | post_prefix | ||
| ) |
Definition at line 749 of file MooseUtils.C.
Referenced by DefaultNonlinearConvergence::checkConvergence(), ConsoleUtils::formatString(), OutputWarehouse::mooseConsole(), moose::internal::mooseErrorRaw(), and Console::write().
| std::string MooseUtils::installedInputsDir | ( | const std::string & | app_name, |
| const std::string & | dir_name, | ||
| const std::string & | extra_error_msg | ||
| ) |
Definition at line 114 of file MooseUtils.C.
Referenced by MooseApp::copyInputs().
| bool MooseUtils::isAllLowercase | ( | const std::string & | str | ) |
Definition at line 1206 of file MooseUtils.C.
| bool MooseUtils::isFinitePoint | ( | const Point & | point | ) |
Definition at line 60 of file MooseUtils.C.
Referenced by Moose::Mortar::projectQPoints3d(), and MortarSegmentHelper::referencePoint().
| int MooseUtils::levenshteinDist | ( | const std::string & | s1, |
| const std::string & | s2 | ||
| ) |
Definition at line 187 of file MooseUtils.C.
Referenced by Moose::findSimilar().
| processor_id_type MooseUtils::linearPartitionChunk | ( | dof_id_type | num_items, |
| dof_id_type | num_chunks, | ||
| dof_id_type | item_id | ||
| ) |
Definition at line 1010 of file MooseUtils.C.
Referenced by DistributedRectilinearMeshGenerator::buildCube().
| void MooseUtils::linearPartitionItems | ( | dof_id_type | num_items, |
| dof_id_type | num_chunks, | ||
| dof_id_type | chunk_id, | ||
| dof_id_type & | num_local_items, | ||
| dof_id_type & | local_items_begin, | ||
| dof_id_type & | local_items_end | ||
| ) |
Definition at line 984 of file MooseUtils.C.
Referenced by DistributedRectilinearMeshGenerator::buildCube().
| std::list< std::string > MooseUtils::listDir | ( | const std::string | path, |
| bool | files_only | ||
| ) |
Definition at line 793 of file MooseUtils.C.
Referenced by convertLatestCheckpoint(), getFilesInDirs(), and removedirs().
| void MooseUtils::makedirs | ( | const std::string & | dir_name, |
| bool | throw_on_failure | ||
| ) |
Definition at line 460 of file MooseUtils.C.
| void MooseUtils::MaterialPropertyStorageDump | ( | const HashMap< const libMesh::Elem *, HashMap< unsigned int, MaterialProperties > > & | props | ) |
Definition at line 699 of file MooseUtils.C.
| std::string MooseUtils::mooseDocsURL | ( | const std::string & | path | ) |
Definition at line 150 of file MooseUtils.C.
Referenced by ExecFlagEnum::getDocString().
| void MooseUtils::parallelBarrierNotify | ( | const Parallel::Communicator & | comm, |
| bool | messaging | ||
| ) |
Definition at line 338 of file MooseUtils.C.
Referenced by FEProblemBase::backupMultiApps(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), FEProblemBase::finishMultiAppStep(), and FEProblemBase::restoreMultiApps().
| bool MooseUtils::parsesToReal | ( | const std::string & | input, |
| Real * | parsed_real | ||
| ) |
Definition at line 100 of file MooseUtils.C.
Referenced by DiffusionCG::addFEBCs(), DiffusionCG::addFEKernels(), DiffusionFV::addFVBCs(), DiffusionFV::addFVKernels(), FunctorExtremaPositions::FunctorExtremaPositions(), FunctorIC::FunctorIC(), and RankTwoTensorFromComponentProperties::RankTwoTensorFromComponentProperties().
| bool MooseUtils::pathContains | ( | const std::string & | expression, |
| const std::string & | string_to_find, | ||
| const std::string & | delims | ||
| ) |
Definition at line 242 of file MooseUtils.C.
| bool MooseUtils::pathExists | ( | const std::string & | path | ) |
Definition at line 258 of file MooseUtils.C.
Referenced by MooseApp::copyInputs(), FileMeshGenerator::deduceCheckpointPath(), docsDir(), findTestRoot(), installedInputsDir(), RestartableDataReader::isAvailable(), makedirs(), removedirs(), MooseApp::run(), and runTestsExecutable().
| std::filesystem::path MooseUtils::pathjoin | ( | const std::filesystem::path & | p | ) |
Definition at line 70 of file MooseUtils.C.
Referenced by Registry::addAppDataFilePath(), Registry::determineDataFilePath(), docsDir(), findTestRoot(), Moose::DataFileUtils::getPath(), installedInputsDir(), ADFParser::JITCompile(), MooseApp::loadLibraryAndDependencies(), MooseApp::run(), and runTestsExecutable().
| std::string MooseUtils::prettyCppType | ( | const std::string & | cpp_type | ) |
Definition at line 1151 of file MooseUtils.C.
Referenced by MooseServer::addParametersToList(), MooseServer::addValuesToList(), InputParametersChecksUtils< C >::assertParamDefined(), ReporterGeneralContext< T >::contextType(), ReporterBroadcastContext< T >::contextType(), ReporterScatterContext< T >::contextType(), ReporterGatherContext< T >::contextType(), ReporterVectorContext< T >::contextType(), Moose::Kokkos::dataLoad(), FunctorSmootherTempl< T >::FunctorSmootherTempl(), MooseServer::gatherDocumentDefinitionLocations(), MooseServer::getFileNameTypeValues(), MooseServer::getNodesByValueAndTypes(), CSG::CSGSurface::getSurfaceType(), CSG::CSGLattice::getType(), CSG::CSGEngUnit::getUnitType(), ThreadedElementLoop< RangeType >::printExecutionOrdering(), Moose::ParameterRegistry::set(), JsonSyntaxTree::setParams(), and MFEMProblem::solverTypeString().
| std::string MooseUtils::realpath | ( | const std::string & | path | ) |
Definition at line 1136 of file MooseUtils.C.
Referenced by Parser::parse(), and MooseApp::run().
| std::string & MooseUtils::removeColor | ( | std::string & | msg | ) |
Definition at line 733 of file MooseUtils.C.
Referenced by Console::writeStreamToFile().
| void MooseUtils::removedirs | ( | const std::string & | dir_name, |
| bool | throw_on_failure | ||
| ) |
Definition at line 516 of file MooseUtils.C.
| std::string MooseUtils::removeExtraWhitespace | ( | const std::string & | input | ) |
Definition at line 236 of file MooseUtils.C.
Referenced by CommandLine::initSubAppCommandLine(), and CommandLine::parse().
| std::string MooseUtils::replaceAll | ( | std::string | str, |
| const std::string & | from, | ||
| const std::string & | to | ||
| ) |
Definition at line 156 of file MooseUtils.C.
Referenced by ReporterDebugOutput::output(), and MooseUtils::DelimitedFileReaderTempl< T >::processLine().
| void MooseUtils::replaceStart | ( | std::string & | string1, |
| const std::string & | string2, | ||
| const std::string & | string3 | ||
| ) |
Definition at line 1198 of file MooseUtils.C.
| std::vector< T > MooseUtils::resample | ( | const std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
Definition at line 540 of file Shuffle.h.
| std::vector< T > MooseUtils::resample | ( | const std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const std::size_t | seed_index, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
| std::vector< T > MooseUtils::resample | ( | const std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const std::size_t | seed_index, | ||
| const libMesh::Parallel::Communicator * | comm_ptr | ||
| ) |
Definition at line 335 of file Shuffle.h.
| std::vector< T > MooseUtils::resample | ( | const std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const std::size_t | seed_index = 0 |
||
| ) |
Randomly resample a vector of data, allowing a value to be repeated.
| data | The vector on which the values are to be swapped |
| generator | Random number generator to use for shuffle |
| seed_index | (default: 0) The seed index to use for calls to randl |
| comm_ptr | Optional Communicator, if provided and running with multiple processors the vector is assumed to be distributed |
Definition at line 531 of file Shuffle.h.
Referenced by resample(), resample(), and resample().
| void MooseUtils::resampleWithFunctor | ( | const std::vector< T > & | data, |
| const ActionFunctor & | functor, | ||
| MooseRandom & | generator, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
Definition at line 569 of file Shuffle.h.
| void MooseUtils::resampleWithFunctor | ( | const std::vector< T > & | data, |
| const ActionFunctor & | functor, | ||
| MooseRandom & | generator, | ||
| const std::size_t | seed_index, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
| void MooseUtils::resampleWithFunctor | ( | const std::vector< T > & | data, |
| const ActionFunctor & | functor, | ||
| MooseRandom & | generator, | ||
| const std::size_t | seed_index, | ||
| const libMesh::Parallel::Communicator * | comm_ptr | ||
| ) |
Definition at line 427 of file Shuffle.h.
| void MooseUtils::resampleWithFunctor | ( | const std::vector< T > & | data, |
| const ActionFunctor & | functor, | ||
| MooseRandom & | generator, | ||
| const std::size_t | seed_index = 0 |
||
| ) |
Randomly resample a vector of data and apply a functor, allowing a value to be repeated.
| data | The vector on which the values are to be swapped |
| functor | Functor to apply to each entry of the resampled vector |
| generator | Random number generator to use for shuffle |
| seed_index | (default: 0) The seed index to use for calls to randl |
| comm_ptr | Optional Communicator, if provided and running with multiple processors the vector is assumed to be distributed |
Definition at line 559 of file Shuffle.h.
Referenced by resampleWithFunctor(), resampleWithFunctor(), and resampleWithFunctor().
| void MooseUtils::reset | ( | double | , |
| T & | , | ||
| Args... | |||
| ) |
Definition at line 28 of file SharedPool.h.
| auto MooseUtils::reset | ( | int | , |
| T & | obj, | ||
| Args... | args | ||
| ) | -> decltype(obj.reset(args...), void()) |
Definition at line 21 of file SharedPool.h.
Referenced by MooseUtils::SharedPool< T >::acquire().
| std::vector< std::string > MooseUtils::rsplit | ( | const std::string & | str, |
| const std::string & | delimiter, | ||
| std::size_t | max_count | ||
| ) |
Definition at line 1051 of file MooseUtils.C.
| std::string MooseUtils::runTestsExecutable | ( | ) |
Definition at line 76 of file MooseUtils.C.
Referenced by MooseApp::runInputs().
| void MooseUtils::serialBegin | ( | const libMesh::Parallel::Communicator & | comm, |
| bool | warn | ||
| ) |
Definition at line 368 of file MooseUtils.C.
Referenced by SerializerGuard::SerializerGuard().
| void MooseUtils::serialEnd | ( | const libMesh::Parallel::Communicator & | comm, |
| bool | warn | ||
| ) |
Definition at line 382 of file MooseUtils.C.
Referenced by SerializerGuard::~SerializerGuard().
| std::string MooseUtils::shortName | ( | const std::string & | name | ) |
Definition at line 623 of file MooseUtils.C.
Referenced by InputParameterWarehouse::addInputParameters(), ActionFactory::create(), CSV::getVectorPostprocessorFileName(), CSV::getVectorPostprocessorFilePrefix(), and CSV::initialSetup().
| void MooseUtils::shuffle | ( | std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
Definition at line 512 of file Shuffle.h.
| void MooseUtils::shuffle | ( | std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const std::size_t | seed_index, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
| void MooseUtils::shuffle | ( | std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const std::size_t | seed_index, | ||
| const libMesh::Parallel::Communicator * | comm_ptr | ||
| ) |
Definition at line 244 of file Shuffle.h.
| void MooseUtils::shuffle | ( | std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const std::size_t | seed_index = 0 |
||
| ) |
Shuffle function for serial or distributed vector of data that shuffles in place.
| data | The vector on which the values are to be swapped |
| generator | Random number generator to use for shuffle |
| seed_index | (default: 0) The seed index to use for calls to randl |
| comm_ptr | Optional Communicator, if provided and running with multiple processors the vector is assumed to be distributed |
Both the serial and distributed version implement a Fisher-Yates shuffle https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
NOTE: This distributed shuffle I have here does a parallel communication with each swap pair generated. I am certain that there are more efficient ways to shuffle a distributed vector, but there doesn't seem to be an algorithm in the literature (my search was not extensive).
The reason I came to this conclusion was because of a 2019 paper, which states the following (https://iopscience.iop.org/article/10.1088/1742-6596/1196/1/012035):
The study also says that the Fisher-Yates Shuffle can be developed in two ways, namely the algorithm's initial assumptions that allow for discrete uniform variables, and also with the avent of large core clusters and GPUs, there is an interest in making parallel versions of this algorithm.
This paper discusses the MergeShuffle (https://arxiv.org/abs/1508.03167), but that is a shared memory parallel algorithm.
Hence, if you want to become famous create a parallel Fisher-Yates algorithm for MPI.
| std::vector< std::string > MooseUtils::split | ( | const std::string & | str, |
| const std::string & | delimiter, | ||
| std::size_t | max_count | ||
| ) |
Definition at line 1031 of file MooseUtils.C.
Referenced by BatchMeshGeneratorAction::convertStringToCompoundRealScalar(), MeshGenerator::generateInternal(), MultiApp::getCommandLineArgs(), Moose::ParameterRegistration::setDoubleVectorValue(), and MooseApp::setMFEMDevice().
| bool MooseUtils::startsWith | ( | const std::string & | string1, |
| const std::string & | string2 | ||
| ) |
Definition at line 1190 of file MooseUtils.C.
Referenced by replaceStart().
|
inline |
Concatenates value into a single string separated by separator.
Definition at line 201 of file MooseStringUtils.h.
Referenced by InputParameters::addCommandLineParamHelper(), Moose::Builder::build(), InputParameters::checkParams(), Moose::Capability::enumerationToString(), EnumerateEvaler::eval(), RepeatEvaler::eval(), Parser::joinErrorMessages(), Parser::parse(), ParsedPostprocessor::ParsedPostprocessor(), MFEMProblem::solverTypeString(), and MeshInfo::validParams().
| int MooseUtils::stringToInteger | ( | const std::string & | input, |
| bool | throw_on_failure | ||
| ) |
Definition at line 978 of file MooseUtils.C.
Referenced by FormattedTable::printTable().
| std::string MooseUtils::stripExtension | ( | const std::string & | s, |
| const bool | rfind | ||
| ) |
Definition at line 438 of file MooseUtils.C.
Referenced by CommonOutputAction::act(), SplitMeshAction::act(), and SetupMeshAction::modifyParamsForUseSplit().
| void MooseUtils::swap | ( | std::vector< T > & | data, |
| const std::size_t | idx0, | ||
| const std::size_t | idx1, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
Swap function for serial or distributed vector of data.
| data | The vector on which the values are to be swapped |
| idx0,idx1 | The global indices to be swapped |
| comm_ptr | Optional Communicator, if provided and running with multiple processors the vector is assumed to be distributed |
Definition at line 495 of file Shuffle.h.
| void MooseUtils::swap | ( | std::vector< T > & | data, |
| const std::size_t | idx0, | ||
| const std::size_t | idx1, | ||
| const libMesh::Parallel::Communicator * | comm_ptr = nullptr |
||
| ) |
Definition at line 156 of file Shuffle.h.
| 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.
The delimiters default to "/" but may be supplied as well. In addition if min_len is supplied, the minimum token length will be >= than the supplied value. T should be std::string or a MOOSE derived string class.
Definition at line 55 of file MooseStringUtils.h.
Referenced by InputParameters::addCommandLineParamHelper(), Syntax::addDependencySets(), MooseEnumBase::addEnumerationName(), MooseEnumBase::addEnumerationNames(), JsonInputFileFormatter::addLine(), InputParameters::addParamNamesToGroup(), MultiMooseEnum::eraseSetValue(), TransfiniteMeshGenerator::getDiscreteEdge(), MooseApp::getLibrarySearchPaths(), TransfiniteMeshGenerator::getParsedEdge(), Syntax::isAssociated(), makedirs(), MultiMooseEnum::operator=(), FunctionMaterialPropertyDescriptor< is_ad >::parseDependentSymbols(), FunctionMaterialPropertyDescriptor< is_ad >::parseDerivative(), pathContains(), InputFileFormatter::printParams(), MooseUtils::DelimitedFileReaderTempl< T >::readColumnData(), InputParameters::registerBuildableTypes(), removedirs(), MultiMooseEnum::setAdditionalValue(), CommandLine::setCommandLineParam(), Moose::ParameterRegistration::setTripleVectorValue(), MooseApp::showInputs(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), tokenizeAndConvert(), and wildCardMatch().
| 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.
If the conversion fails tokenizeAndConvert returns false, otherwise true.
Definition at line 162 of file MooseStringUtils.h.
Referenced by SplitMeshAction::act(), Moose::internal::CapabilityRegistry::check(), TransfiniteMeshGenerator::getCircarcEdge(), TransfiniteMeshGenerator::getDiscreteEdge(), and Moose::MFEM::CoefficientManager::getVectorCoefficientPtr().
|
inline |
Convert supplied string to lower case.
@params name The string to convert upper case.
Definition at line 191 of file MooseStringUtils.h.
Referenced by Registry::appNameFromAppPath(), Moose::internal::CapabilityRegistry::check(), elemQualityToString(), MooseServer::getDocumentSymbolKind(), ConsoleUtils::outputRelationshipManagerInformation(), MooseUtils::DelimitedFileReaderTempl< T >::processLine(), Moose::internal::CapabilityRegistry::query(), AppFactory::registerAppCapability(), Moose::PeriodicBCHelper::setupAutoPeriodicBoundaries(), and WorkBalance::WorkBalance().
|
inline |
Convert supplied string to upper case.
@params name The string to convert upper case.
Definition at line 180 of file MooseStringUtils.h.
Referenced by SubProblem::addMatrixTag(), SubProblem::addVectorTag(), MooseEnumBase::find(), MooseEnumBase::find(), SubProblem::getMatrixTagID(), SubProblem::getVectorTagID(), SubProblem::matrixTagExists(), NumDOFs::NumDOFs(), MooseEnumItem::operator!=(), MooseEnumItem::operator!=(), MooseEnumItem::operator!=(), MooseEnum::operator==(), MooseEnumItem::operator==(), MooseEnumItem::operator==(), MooseEnumItem::operator==(), moose::internal::ExecFlagRegistry::registerFlag(), moose::internal::ConvergenceIterationTypeRegistry::registerType(), Coupleable::vectorTagDofValueHelper(), SubProblem::vectorTagExists(), and Coupleable::vectorTagValueHelper().
|
inline |
Standard scripting language trim function.
Definition at line 38 of file MooseStringUtils.h.
Referenced by MooseEnumBase::addEnumerationName(), JsonInputFileFormatter::addLine(), JsonInputFileFormatter::addParameters(), MooseServer::addParametersToList(), InputParameters::appendFunctorDescription(), MooseEnum::assign(), convert(), MooseServer::formatDocument(), MultiApp::getCommandLineArgs(), Moose::MFEM::CoefficientManager::getScalarCoefficientPtr(), TimedSubdomainModifier::getSubdomainIDAndCheck(), MooseUtils::DelimitedFileReaderTempl< T >::preprocessLine(), InputFileFormatter::printParams(), MooseUtils::DelimitedFileReaderTempl< T >::readColumnData(), Moose::ParameterRegistration::setDoubleVectorValue(), and Moose::ParameterRegistration::setTripleVectorValue().
| std::string MooseUtils::underscoreToCamelCase | ( | const std::string & | underscore_name, |
| bool | leading_upper_case | ||
| ) |
Definition at line 591 of file MooseUtils.C.
Referenced by MooseApp::libNameToAppName(), and ConsoleUtils::outputRelationshipManagerInformation().
| bool MooseUtils::wildCardMatch | ( | std::string | name, |
| std::string | search_string | ||
| ) |
Definition at line 899 of file MooseUtils.C.
Referenced by JsonSyntaxTree::addParameters(), JsonSyntaxTree::addSyntaxType(), SyntaxTree::TreeNode::print(), InputFileFormatter::printParams(), and JsonSyntaxTree::setParams().