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=" \\\) |
| Standard scripting language trim function. More... | |
| 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. More... | |
| 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. More... | |
| template<typename T > | |
| bool | tokenizeAndConvert (const std::string &str, std::vector< T > &tokenized_vector, const std::string &delimiter=" \\\) |
| tokenizeAndConvert splits a string using delimiter and then converts to type T. More... | |
| std::string | toUpper (std::string name) |
| Convert supplied string to upper case. More... | |
| std::string | toLower (std::string name) |
| Convert supplied string to lower case. More... | |
| 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...) |
| 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) |
| std::string | stringJoin (const std::vector< std::string > &values, const std::string &separator) |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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.
Definition at line 730 of file MooseUtils.C.
| std::string MooseUtils::baseName | ( | const std::string & | name | ) |
Definition at line 618 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 | ) |
| std::string MooseUtils::canonicalPath | ( | const std::string & | path | ) |
Definition at line 1171 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 254 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 307 of file MooseUtils.C.
Referenced by PNGOutput::makePNG().
| bool MooseUtils::checkForGitLFSPointer | ( | std::ifstream & | file | ) |
| 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.
Referenced by MooseServer::getDocumentSymbolKind().
| std::string MooseUtils::convertLatestCheckpoint | ( | std::string | orig | ) |
Definition at line 157 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 125 of file MooseUtils.C.
Referenced by MooseApp::run().
| void MooseUtils::escape | ( | std::string & | str | ) |
Definition at line 207 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 | ) |
| std::string MooseUtils::findTestRoot | ( | ) |
Definition at line 75 of file MooseUtils.C.
Referenced by MooseApp::runInputs().
| std::string MooseUtils::getCurrentWorkingDir | ( | ) |
| ExecFlagEnum MooseUtils::getDefaultExecFlagEnum | ( | ) |
Definition at line 972 of file MooseUtils.C.
Referenced by AddNodalNormalsAction::act(), AdvancedOutput::addValidParams(), Output::getDefaultExecFlagEnum(), Control::getExecuteOptions(), OutputOnWarehouse::OutputOnWarehouse(), MOOSEToNEML2Unbatched::validParams(), SetupDebugAction::validParams(), NEML2BatchIndexGenerator::validParams(), NEML2ModelExecutor::validParams(), MOOSEToNEML2Batched< Real >::validParams(), and SetupInterface::validParams().
| std::string MooseUtils::getExtension | ( | const std::string & | filename, |
| const bool | rfind | ||
| ) |
Definition at line 411 of file MooseUtils.C.
Referenced by SplitMeshAction::act(), CommonOutputAction::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 808 of file MooseUtils.C.
Referenced by MooseApp::getCheckpointFiles().
| std::string MooseUtils::getLatestCheckpointFilePrefix | ( | const std::list< std::string > & | checkpoint_files | ) |
Definition at line 819 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 640 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 932 of file MooseUtils.C.
Referenced by RestartableDataReporter::execute(), and ReferenceResidualConvergence::initialSetup().
| bool MooseUtils::hasExtension | ( | const std::string & | filename, |
| std::string | ext, | ||
| bool | strip_exodus_ext | ||
| ) |
Definition at line 387 of file MooseUtils.C.
Referenced by FileRangeBuilder::FileRangeBuilder(), getLatestCheckpointFilePrefix(), and SolutionUserObjectBase::initialSetup().
| std::string MooseUtils::hostname | ( | ) |
Definition at line 624 of file MooseUtils.C.
| 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 738 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 103 of file MooseUtils.C.
Referenced by MooseApp::copyInputs().
| bool MooseUtils::isAllLowercase | ( | const std::string & | str | ) |
Definition at line 1193 of file MooseUtils.C.
| int MooseUtils::levenshteinDist | ( | const std::string & | s1, |
| const std::string & | s2 | ||
| ) |
Definition at line 176 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 782 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 449 of file MooseUtils.C.
| void MooseUtils::MaterialPropertyStorageDump | ( | const HashMap< const libMesh::Elem *, HashMap< unsigned int, MaterialProperties >> & | props | ) |
Definition at line 688 of file MooseUtils.C.
| std::string MooseUtils::mooseDocsURL | ( | const std::string & | path | ) |
Definition at line 139 of file MooseUtils.C.
Referenced by ExecFlagEnum::getDocString().
| void MooseUtils::parallelBarrierNotify | ( | const Parallel::Communicator & | comm, |
| bool | messaging | ||
| ) |
Definition at line 327 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 89 of file MooseUtils.C.
Referenced by DiffusionCG::addFEBCs(), DiffusionCG::addFEKernels(), DiffusionFV::addFVBCs(), DiffusionFV::addFVKernels(), FunctorExtremaPositions::FunctorExtremaPositions(), and FunctorIC::FunctorIC().
| bool MooseUtils::pathContains | ( | const std::string & | expression, |
| const std::string & | string_to_find, | ||
| const std::string & | delims | ||
| ) |
Definition at line 231 of file MooseUtils.C.
| bool MooseUtils::pathExists | ( | const std::string & | path | ) |
Definition at line 247 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 59 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< BatchMeshGeneratorAction >::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(), ThreadedElementLoop< ConstElemPointerRange >::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 722 of file MooseUtils.C.
Referenced by Console::writeStreamToFile().
| void MooseUtils::removedirs | ( | const std::string & | dir_name, |
| bool | throw_on_failure | ||
| ) |
Definition at line 505 of file MooseUtils.C.
| std::string MooseUtils::removeExtraWhitespace | ( | const std::string & | input | ) |
Definition at line 225 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 145 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 1185 of file MooseUtils.C.
| 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 530 of file Shuffle.h.
Referenced by resample().
| std::vector< T > MooseUtils::resample | ( | const std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
Definition at line 539 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 | ||
| ) |
Definition at line 548 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_ptr | ||
| ) |
Definition at line 334 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 558 of file Shuffle.h.
Referenced by resampleWithFunctor().
| void MooseUtils::resampleWithFunctor | ( | const std::vector< T > & | data, |
| const ActionFunctor & | functor, | ||
| MooseRandom & | generator, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
Definition at line 568 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 | ||
| ) |
Definition at line 578 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_ptr | ||
| ) |
Definition at line 426 of file Shuffle.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().
| void MooseUtils::reset | ( | double | , |
| T & | , | ||
| Args... | |||
| ) |
Definition at line 28 of file SharedPool.h.
| 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 65 of file MooseUtils.C.
Referenced by MooseApp::runInputs().
| void MooseUtils::serialBegin | ( | const libMesh::Parallel::Communicator & | comm, |
| bool | warn | ||
| ) |
Definition at line 357 of file MooseUtils.C.
Referenced by SerializerGuard::SerializerGuard().
| void MooseUtils::serialEnd | ( | const libMesh::Parallel::Communicator & | comm, |
| bool | warn | ||
| ) |
Definition at line 371 of file MooseUtils.C.
Referenced by SerializerGuard::~SerializerGuard().
| std::string MooseUtils::shortName | ( | const std::string & | name | ) |
Definition at line 612 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 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.
Definition at line 504 of file Shuffle.h.
Referenced by shuffle().
| void MooseUtils::shuffle | ( | std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
Definition at line 511 of file Shuffle.h.
| void MooseUtils::shuffle | ( | std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const std::size_t | seed_index, | ||
| const libMesh::Parallel::Communicator & | comm | ||
| ) |
Definition at line 520 of file Shuffle.h.
| void MooseUtils::shuffle | ( | std::vector< T > & | data, |
| MooseRandom & | generator, | ||
| const std::size_t | seed_index, | ||
| const libMesh::Parallel::Communicator * | comm_ptr | ||
| ) |
Definition at line 243 of file Shuffle.h.
| 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 SONDefinitionFormatter::addParameters(), 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 1177 of file MooseUtils.C.
Referenced by replaceStart().
| std::string MooseUtils::stringJoin | ( | const std::vector< std::string > & | values, |
| const std::string & | separator | ||
| ) |
Definition at line 955 of file MooseUtils.C.
Referenced by InputParameters::addCommandLineParamHelper(), Moose::Builder::build(), InputParameters::checkParams(), Parser::joinErrorMessages(), Parser::parse(), and ParsedPostprocessor::ParsedPostprocessor().
| 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 427 of file MooseUtils.C.
Referenced by SplitMeshAction::act(), CommonOutputAction::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 494 of file Shuffle.h.
Referenced by Syntax::addDependencySets(), AllNodesSendListThread::AllNodesSendListThread(), Moose::applyIndices(), AutomaticMortarGeneration::buildMortarSegmentMesh(), RestartableDataReader::clear(), AdvancedExtruderGenerator::generate(), DistributedRectilinearMeshGenerator::paritionSquarely(), MaterialPropertyStorage::shift(), shuffle(), swap(), MooseUtils::StaticallyAllocatedSet< T, N >::swap(), Moose::Kokkos::Map< unsigned int, unsigned int >::swap(), MooseArray< libMesh::VectorValue >::swap(), MooseUtils::Buffer< T >::swap(), and ElementSubdomainModifierBase::timestepSetup().
| 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 155 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(), CapabilityUtils::check(), TransfiniteMeshGenerator::getCircarcEdge(), TransfiniteMeshGenerator::getDiscreteEdge(), and Moose::MFEM::CoefficientManager::getVectorCoefficientPtr().
|
inline |
Convert supplied string to lower case.
name The string to convert upper case.
Definition at line 191 of file MooseStringUtils.h.
Referenced by Moose::Capabilities::add(), Registry::appNameFromAppPath(), CapabilityUtils::check(), MooseServer::getDocumentSymbolKind(), SubProblem::getVariableHelper(), ConsoleUtils::outputRelationshipManagerInformation(), MooseUtils::DelimitedFileReaderTempl< T >::processLine(), Moose::PetscSupport::setSinglePetscOption(), and WorkBalance::WorkBalance().
|
inline |
Convert supplied string to upper case.
name The string to convert upper case.
Definition at line 180 of file MooseStringUtils.h.
Referenced by SubProblem::addMatrixTag(), SubProblem::addVectorTag(), MooseEnumBase::find(), SubProblem::getMatrixTagID(), SubProblem::getVectorTagID(), SubProblem::matrixTagExists(), MooseEnumItem::operator!=(), MooseEnumItem::operator==(), MooseEnum::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(), SONDefinitionFormatter::addParameters(), MooseServer::addParametersToList(), InputParameters::appendFunctorDescription(), convert(), MooseServer::formatDocument(), MultiApp::getCommandLineArgs(), Moose::MFEM::CoefficientManager::getScalarCoefficientPtr(), TimedSubdomainModifier::getSubdomainIDAndCheck(), MooseUtils::DelimitedFileReaderTempl< T >::preprocessLine(), InputFileFormatter::printParams(), MooseUtils::DelimitedFileReaderTempl< T >::readColumnData(), Moose::ParameterRegistration::setDoubleVectorValue(), Moose::ParameterRegistration::setTripleVectorValue(), and Convergence::verboseOutput().
| std::string MooseUtils::underscoreToCamelCase | ( | const std::string & | underscore_name, |
| bool | leading_upper_case | ||
| ) |
Definition at line 580 of file MooseUtils.C.
Referenced by MooseApp::libNameToAppName(), and ConsoleUtils::outputRelationshipManagerInformation().
| bool MooseUtils::wildCardMatch | ( | std::string | name, |
| std::string | search_string | ||
| ) |
Definition at line 888 of file MooseUtils.C.
Referenced by JsonSyntaxTree::addParameters(), JsonSyntaxTree::addSyntaxType(), SyntaxTree::TreeNode::print(), InputFileFormatter::printParams(), and JsonSyntaxTree::setParams().
1.8.14