A MultiMooseEnum object to hold "execute_on" flags. More...
#include <ExecFlagEnum.h>
Public Member Functions | |
ExecFlagEnum () | |
ExecFlagEnum (const ExecFlagEnum &other) | |
ExecFlagEnum (const MultiMooseEnum &other) | |
ExecFlagEnum & | operator= (const ExecFlagEnum &other)=default |
std::string | getDocString () const |
Generate a documentation string for the "execute_on" parameter. More... | |
const std::set< ExecFlagType > & | items () const |
Reference the all the available items. More... | |
const std::string & | operator[] (unsigned int i) const |
Indexing operator Operator to retrieve an item from the MultiMooseEnum. More... | |
unsigned int | get (unsigned int i) const |
Indexing operator Operator to retrieve an item from the MultiMooseEnum. More... | |
template<typename T > | |
std::vector< T > | getEnum () const |
get the current values cast to a vector of enum type T More... | |
void | clear () |
Clear the MultiMooseEnum. More... | |
unsigned int | size () const |
Return the number of active items in the MultiMooseEnum. More... | |
virtual bool | isValid () const override |
IsValid. More... | |
virtual void | deprecate (const std::string &name, const std::string &raw_name="") |
Deprecates various options in the MOOSE enum. More... | |
std::vector< std::string > | getNames () const |
Method for returning a vector of all valid enumeration names for this instance. More... | |
std::string | getRawNames () const |
Method for returning the raw name strings for this instance. More... | |
std::vector< int > | getIDs () const |
Method for returning a vector of ids for this instance. More... | |
bool | isOutOfRangeAllowed () const |
isOutOfRangeAllowed More... | |
void | addDocumentation (const std::string &name, const std::string &doc) |
Add an item documentation string. More... | |
const std::map< MooseEnumItem, std::string > & | getItemDocumentation () const |
Get the map containing each item's documentation string. More... | |
int | getNextValidID () const |
Compute the next valid ID. More... | |
MooseEnumBase & | operator+= (const std::string &name) |
Adds an enumeration item from name. More... | |
MooseEnumBase & | operator+= (const std::initializer_list< std::string > &names) |
Adds enumeration items from a list of names. More... | |
template<typename... Args> | |
void | addAvailableFlags (const ExecFlagType &flag, Args... flags) |
Add additional execute_on flags to the list of possible flags. More... | |
const ExecFlagType & | addAvailableFlags (const ExecFlagType &flag) |
ExecFlagEnum & | operator= (const std::initializer_list< ExecFlagType > &flags) |
ExecFlagEnum & | operator= (const ExecFlagType &flags) |
ExecFlagEnum & | operator+= (const std::initializer_list< ExecFlagType > &flags) |
ExecFlagEnum & | operator+= (const ExecFlagType &flags) |
MultiMooseEnum & | operator= (const MultiMooseEnum &other_enum)=default |
Assignment operators for setting the current flags. More... | |
MultiMooseEnum & | operator= (const std::string &names) |
Assignment operators for setting the current flags. More... | |
MultiMooseEnum & | operator= (const std::vector< std::string > &names) |
Assignment operators for setting the current flags. More... | |
MultiMooseEnum & | operator= (const std::set< std::string > &names) |
Assignment operators for setting the current flags. More... | |
template<typename... Args> | |
void | removeAvailableFlags (const ExecFlagType &flag, Args... flags) |
Remove flags from being available. More... | |
void | removeAvailableFlags (const ExecFlagType &flag) |
bool | operator== (const MultiMooseEnum &value) const |
Comparison operators for comparing with character constants, MultiMooseEnums or integer values. More... | |
bool | operator!= (const MultiMooseEnum &value) const |
bool | contains (const std::string &value) const |
Contains methods for seeing if a value is in the MultiMooseEnum. More... | |
bool | contains (int value) const |
bool | contains (unsigned short value) const |
bool | contains (const MultiMooseEnum &value) const |
bool | contains (const MooseEnumItem &value) const |
void | erase (const std::string &names) |
Un-assign a value. More... | |
void | erase (const std::vector< std::string > &names) |
void | erase (const std::set< std::string > &names) |
void | push_back (const std::string &names) |
Insert operators Operator to insert (push_back) values into the enum. More... | |
void | push_back (const std::vector< std::string > &names) |
void | push_back (const std::set< std::string > &names) |
void | push_back (const MultiMooseEnum &other_enum) |
MooseEnumIterator | begin () const |
Returns a begin/end iterator to all of the items in the enum. More... | |
MooseEnumIterator | end () const |
std::set< MooseEnumItem >::const_iterator | find (const MooseEnumItem &other) const |
Locate an item. More... | |
std::set< MooseEnumItem >::const_iterator | find (const std::string &name) const |
std::set< MooseEnumItem >::const_iterator | find (int id) const |
Protected Member Functions | |
void | appendCurrent (const ExecFlagType &item) |
Append the list of current flags. More... | |
virtual void | checkDeprecated () const override |
Check whether any of the current values are deprecated when called. More... | |
void | checkDeprecated (const MooseEnumItem &item) const |
Check and warn deprecated values. More... | |
template<typename InputIterator > | |
MultiMooseEnum & | assign (InputIterator first, InputIterator last, bool append) |
Helper method for all inserts and assignment operators. More... | |
template<typename InputIterator > | |
void | remove (InputIterator first, InputIterator last) |
Helper method for un-assigning enumeration values. More... | |
void | setCurrentItems (const std::vector< MooseEnumItem > ¤t) |
Set the current items. More... | |
void | addEnumerationNames (const std::string &names) |
Methods to add possible enumeration value to the enum. More... | |
const MooseEnumItem & | addEnumerationName (const std::string &raw_name) |
const MooseEnumItem & | addEnumerationName (const std::string &name, const int &value) |
const MooseEnumItem & | addEnumerationItem (const MooseEnumItem &item) |
Protected Attributes | |
std::vector< MooseEnumItem > | _current |
The current id. More... | |
std::set< MooseEnumItem > | _items |
Storage for the assigned items. More... | |
std::map< MooseEnumItem, MooseEnumItem > | _deprecated_items |
The map of deprecated names and optional replacements. More... | |
bool | _allow_out_of_range |
Flag to enable enumeration items not previously defined. More... | |
std::map< MooseEnumItem, std::string > | _item_documentation |
The map of items and their respective documentation strings. More... | |
A MultiMooseEnum object to hold "execute_on" flags.
This object allows available flags to be added or removed thus each object can control the flags that are available.
Definition at line 21 of file ExecFlagEnum.h.
ExecFlagEnum::ExecFlagEnum | ( | ) |
Definition at line 14 of file ExecFlagEnum.C.
ExecFlagEnum::ExecFlagEnum | ( | const ExecFlagEnum & | other | ) |
Definition at line 16 of file ExecFlagEnum.C.
ExecFlagEnum::ExecFlagEnum | ( | const MultiMooseEnum & | other | ) |
Definition at line 15 of file ExecFlagEnum.C.
void ExecFlagEnum::addAvailableFlags | ( | const ExecFlagType & | flag, |
Args... | flags | ||
) |
Add additional execute_on flags to the list of possible flags.
Use a recursive variadic template function to allow for an arbitrary number arguments: addAvaiableFlags(EXEC_INITIAL); addAvaiableFlags(EXEC_INITIAL, EXEC_TIMESTEP_END);
Definition at line 82 of file ExecFlagEnum.h.
Referenced by AdvancedOutput::addValidParams(), Output::getDefaultExecFlagEnum(), moose::internal::ExecFlagRegistry::registerFlag(), FunctorMaterial::validParams(), Postprocessor::validParams(), MultiAppTransfer::validParams(), Control::validParams(), Sampler::validParams(), and AuxKernelTempl< Real >::validParams().
const ExecFlagType & ExecFlagEnum::addAvailableFlags | ( | const ExecFlagType & | flag | ) |
Definition at line 19 of file ExecFlagEnum.C.
|
inherited |
Add an item documentation string.
Definition at line 175 of file MooseEnumBase.C.
Referenced by PseudoTimestep::validParams(), and ReferenceResidualProblem::validParams().
|
protectedinherited |
Definition at line 117 of file MooseEnumBase.C.
Referenced by addAvailableFlags(), MooseEnumBase::addEnumerationName(), MultiMooseEnum::assign(), and ReporterProducerEnum::insert().
|
protectedinherited |
Definition at line 73 of file MooseEnumBase.C.
Referenced by MooseEnumBase::addEnumerationNames(), and MooseEnumBase::operator+=().
|
protectedinherited |
Definition at line 111 of file MooseEnumBase.C.
|
protectedinherited |
Methods to add possible enumeration value to the enum.
The MooseEnum/MultiMooseEnum are not designed to be modified, with respect to the list of possible values. However, this is not the case for the ExecFlagEnum which is a special type of MultiMooseEnum for managing the "execute_on" flags. These methods are used by ExecFlagEnum to allow users to modify the available execute flags for their object.
Definition at line 64 of file MooseEnumBase.C.
Referenced by MooseEnumBase::MooseEnumBase().
|
protected |
Append the list of current flags.
Definition at line 82 of file ExecFlagEnum.C.
Referenced by operator+=().
|
protectedinherited |
Helper method for all inserts and assignment operators.
Definition at line 193 of file MultiMooseEnum.C.
Referenced by MultiMooseEnum::operator=(), and MultiMooseEnum::push_back().
|
inlineinherited |
Returns a begin/end iterator to all of the items in the enum.
Items will always be capitalized.
Definition at line 149 of file MultiMooseEnum.h.
Referenced by FunctorADConverterTempl< T >::FunctorADConverterTempl(), FunctorSmootherTempl< T >::FunctorSmootherTempl(), GenericFunctorGradientMaterialTempl< is_ad >::GenericFunctorGradientMaterialTempl(), GenericFunctorMaterialTempl< is_ad >::GenericFunctorMaterialTempl(), GenericVectorFunctorMaterialTempl< is_ad >::GenericVectorFunctorMaterialTempl(), ParsedFunctorMaterialTempl< is_ad >::ParsedFunctorMaterialTempl(), PiecewiseByBlockFunctorMaterialTempl< T >::PiecewiseByBlockFunctorMaterialTempl(), MultiMooseEnum::push_back(), and VectorMagnitudeFunctorMaterialTempl< is_ad >::VectorMagnitudeFunctorMaterialTempl().
|
protectedinherited |
Check and warn deprecated values.
Definition at line 136 of file MooseEnumBase.C.
|
overrideprotectedvirtualinherited |
Check whether any of the current values are deprecated when called.
Implements MooseEnumBase.
Definition at line 250 of file MultiMooseEnum.C.
Referenced by MultiMooseEnum::assign(), and operator+=().
|
inherited |
Clear the MultiMooseEnum.
Definition at line 238 of file MultiMooseEnum.C.
Referenced by MultiMooseEnum::assign(), AdvancedOutput::initExecutionTypes(), operator=(), and SetupInterface::SetupInterface().
|
inherited |
Contains methods for seeing if a value is in the MultiMooseEnum.
Definition at line 61 of file MultiMooseEnum.C.
Referenced by FEProblemBase::addTransfer(), AdvancedOutput::addValidParams(), MultiAppVariableValueSamplePostprocessorTransfer::cacheElemToPostprocessorData(), ChangeOverFixedPointPostprocessor::ChangeOverFixedPointPostprocessor(), ChangeOverTimePostprocessor::ChangeOverTimePostprocessor(), MultiMooseEnum::contains(), IterationInfo::declareHelper(), MeshInfo::declareHelper(), EigenExecutionerBase::init(), MultiAppReporterTransfer::initialSetup(), IntegralPreservingFunctionIC::initialSetup(), MultiAppVariableValueSamplePostprocessorTransfer::initialSetup(), Console::initialSetup(), EigenExecutionerBase::inversePowerIteration(), MultiAppReporterTransfer::MultiAppReporterTransfer(), MultiAppVariableValueSamplePostprocessorTransfer::MultiAppVariableValueSamplePostprocessorTransfer(), MultiMooseEnum::operator==(), Console::output(), JSONOutput::outputReporters(), Console::outputSystemInformation(), XMLOutput::outputVectorPostprocessors(), MeshInfo::possiblyAddSidesetInfo(), MeshInfo::possiblyAddSubdomainInfo(), EigenExecutionerBase::postExecute(), Moose::PetscSupport::processPetscFlags(), Moose::PetscSupport::processPetscPairs(), removeAvailableFlags(), MultiAppVariableValueSamplePostprocessorTransfer::setupPostprocessorCommunication(), PerfGraphOutput::shouldOutput(), Output::shouldOutput(), FEProblemBase::shouldPrintExecution(), NodalReporter::shouldStore(), ElementReporter::shouldStore(), and GeneralReporter::shouldStore().
|
inherited |
Definition at line 70 of file MultiMooseEnum.C.
|
inherited |
Definition at line 79 of file MultiMooseEnum.C.
|
inherited |
Definition at line 88 of file MultiMooseEnum.C.
|
inherited |
Definition at line 97 of file MultiMooseEnum.C.
|
virtualinherited |
Deprecates various options in the MOOSE enum.
For each deprecated option, you may supply an optional new option that will be used in a message telling the user which new option replaces the old one.
Definition at line 45 of file MooseEnumBase.C.
|
inlineinherited |
Definition at line 150 of file MultiMooseEnum.h.
Referenced by FunctorADConverterTempl< T >::FunctorADConverterTempl(), FunctorSmootherTempl< T >::FunctorSmootherTempl(), GenericFunctorGradientMaterialTempl< is_ad >::GenericFunctorGradientMaterialTempl(), GenericFunctorMaterialTempl< is_ad >::GenericFunctorMaterialTempl(), GenericVectorFunctorMaterialTempl< is_ad >::GenericVectorFunctorMaterialTempl(), ParsedFunctorMaterialTempl< is_ad >::ParsedFunctorMaterialTempl(), PiecewiseByBlockFunctorMaterialTempl< T >::PiecewiseByBlockFunctorMaterialTempl(), MultiMooseEnum::push_back(), and VectorMagnitudeFunctorMaterialTempl< is_ad >::VectorMagnitudeFunctorMaterialTempl().
|
inherited |
Un-assign a value.
names | - a string, set, or vector giving the name to erase from the enumeration values |
Definition at line 126 of file MultiMooseEnum.C.
Referenced by Console::Console(), Moose::PetscSupport::disableLinearConvergedReason(), and Moose::PetscSupport::disableNonlinearConvergedReason().
|
inherited |
Definition at line 134 of file MultiMooseEnum.C.
|
inherited |
Definition at line 140 of file MultiMooseEnum.C.
|
inherited |
Locate an item.
Definition at line 206 of file MooseEnumBase.C.
Referenced by MooseEnumBase::addDocumentation(), MooseEnumBase::addEnumerationItem(), appendCurrent(), MooseEnum::assign(), MultiMooseEnum::assign(), MooseEnumBase::deprecate(), MooseEnum::operator==(), moose::internal::ExecFlagRegistry::registerFlag(), removeAvailableFlags(), CreateExecutionerAction::setupAutoPreconditioning(), and ReadExecutorParamsAction::setupAutoPreconditioning().
|
inherited |
Definition at line 190 of file MooseEnumBase.C.
|
inherited |
Definition at line 199 of file MooseEnumBase.C.
Indexing operator Operator to retrieve an item from the MultiMooseEnum.
i | index |
Definition at line 182 of file MultiMooseEnum.C.
Referenced by PiecewiseMulticonstant::sample(), Moose::Builder::setScalarParameter(), and Transfer::Transfer().
std::string ExecFlagEnum::getDocString | ( | ) | const |
Generate a documentation string for the "execute_on" parameter.
Definition at line 39 of file ExecFlagEnum.C.
Referenced by CommonOutputAction::validParams(), SetupInterface::validParams(), Output::validParams(), and AuxKernelTempl< Real >::validParams().
|
inherited |
get the current values cast to a vector of enum type T
Definition at line 214 of file MultiMooseEnum.h.
|
inherited |
Method for returning a vector of ids for this instance.
Definition at line 165 of file MooseEnumBase.C.
Referenced by MooseEnum::assign().
|
inherited |
Get the map containing each item's documentation string.
Definition at line 184 of file MooseEnumBase.C.
|
inherited |
Method for returning a vector of all valid enumeration names for this instance.
Definition at line 149 of file MooseEnumBase.C.
Referenced by getDocString().
|
inherited |
Compute the next valid ID.
Definition at line 102 of file MooseEnumBase.C.
Referenced by MooseEnumBase::addEnumerationName(), MooseEnum::assign(), MultiMooseEnum::assign(), and moose::internal::ExecFlagRegistry::registerFlag().
|
inherited |
Method for returning the raw name strings for this instance.
Definition at line 159 of file MooseEnumBase.C.
Referenced by MooseEnum::assign(), MultiMooseEnum::assign(), AdvancedOutput::enableOutputTypes(), MooseEnum::operator==(), PiecewiseConstant::validParams(), LeastSquaresFit::validParams(), and ComparisonPostprocessor::validParams().
|
inlineinherited |
isOutOfRangeAllowed
Definition at line 88 of file MooseEnumBase.h.
|
inlineoverridevirtualinherited |
IsValid.
Implements MooseEnumBase.
Definition at line 167 of file MultiMooseEnum.h.
Referenced by IterationInfo::declareHelper(), MeshInfo::declareHelper(), MeshInfo::possiblyAddSidesetInfo(), and MeshInfo::possiblyAddSubdomainInfo().
|
inline |
Reference the all the available items.
Definition at line 71 of file ExecFlagEnum.h.
Referenced by ExecuteMooseObjectWarehouse< Transfer >::ExecuteMooseObjectWarehouse(), groupUserObjects(), EigenExecutionerBase::normalizeSolution(), and moose::internal::ExecFlagRegistry::registerFlag().
|
inherited |
Definition at line 55 of file MultiMooseEnum.C.
ExecFlagEnum & ExecFlagEnum::operator+= | ( | const std::initializer_list< ExecFlagType > & | flags | ) |
Definition at line 65 of file ExecFlagEnum.C.
ExecFlagEnum & ExecFlagEnum::operator+= | ( | const ExecFlagType & | flags | ) |
Definition at line 74 of file ExecFlagEnum.C.
|
inherited |
Adds an enumeration item from name.
Definition at line 216 of file MooseEnumBase.C.
|
inherited |
Adds enumeration items from a list of names.
Definition at line 224 of file MooseEnumBase.C.
|
default |
MultiMooseEnum & MultiMooseEnum::operator= |
Assignment operators for setting the current flags.
Definition at line 106 of file MultiMooseEnum.C.
MultiMooseEnum & MultiMooseEnum::operator= |
Assignment operators for setting the current flags.
Definition at line 120 of file MultiMooseEnum.C.
|
default |
Assignment operators for setting the current flags.
MultiMooseEnum & MultiMooseEnum::operator= |
Assignment operators for setting the current flags.
Definition at line 114 of file MultiMooseEnum.C.
ExecFlagEnum & ExecFlagEnum::operator= | ( | const std::initializer_list< ExecFlagType > & | flags | ) |
Definition at line 49 of file ExecFlagEnum.C.
ExecFlagEnum & ExecFlagEnum::operator= | ( | const ExecFlagType & | flags | ) |
Definition at line 57 of file ExecFlagEnum.C.
|
inherited |
Comparison operators for comparing with character constants, MultiMooseEnums or integer values.
value | - RHS value to compare against |
Definition at line 43 of file MultiMooseEnum.C.
|
inherited |
Indexing operator Operator to retrieve an item from the MultiMooseEnum.
The reference may not be used to change the item.
i | index |
Definition at line 172 of file MultiMooseEnum.C.
|
inherited |
Insert operators Operator to insert (push_back) values into the enum.
Existing values are preserved and duplicates are stored.
names | - a string, set, or vector representing one of the enumeration values. |
Definition at line 146 of file MultiMooseEnum.C.
Referenced by Console::Console(), MultiAppTransfer::MultiAppTransfer(), Output::Output(), PetscOutput::PetscOutput(), Moose::PetscSupport::processPetscFlags(), and Split::setup().
|
inherited |
Definition at line 154 of file MultiMooseEnum.C.
|
inherited |
Definition at line 160 of file MultiMooseEnum.C.
|
inherited |
Definition at line 166 of file MultiMooseEnum.C.
|
protectedinherited |
Helper method for un-assigning enumeration values.
Definition at line 225 of file MultiMooseEnum.C.
void ExecFlagEnum::removeAvailableFlags | ( | const ExecFlagType & | flag, |
Args... | flags | ||
) |
Remove flags from being available.
Definition at line 90 of file ExecFlagEnum.h.
Referenced by PropertyReadFile::validParams().
void ExecFlagEnum::removeAvailableFlags | ( | const ExecFlagType & | flag | ) |
Definition at line 25 of file ExecFlagEnum.C.
|
protectedinherited |
Set the current items.
|
inherited |
Return the number of active items in the MultiMooseEnum.
Definition at line 244 of file MultiMooseEnum.C.
Referenced by SubProblem::doingPRefinement(), Moose::LibtorchArtificialNeuralNet::forward(), InterfaceKernelTempl< T >::InterfaceKernelTempl(), Moose::LibtorchArtificialNeuralNet::LibtorchArtificialNeuralNet(), MultiAppPostprocessorToAuxScalarTransfer::MultiAppPostprocessorToAuxScalarTransfer(), MultiAppPostprocessorTransfer::MultiAppPostprocessorTransfer(), MultiAppReporterTransfer::MultiAppReporterTransfer(), MultiAppScalarToAuxScalarTransfer::MultiAppScalarToAuxScalarTransfer(), MultiAppVariableValueSamplePostprocessorTransfer::MultiAppVariableValueSamplePostprocessorTransfer(), MultiAppVariableValueSampleTransfer::MultiAppVariableValueSampleTransfer(), MultiAppVectorPostprocessorTransfer::MultiAppVectorPostprocessorTransfer(), MultiMooseEnum::operator==(), PiecewiseMulticonstant::PiecewiseMulticonstant(), RefineSidesetGenerator::RefineSidesetGenerator(), MooseMesh::setCoordSystem(), SidesetInfoVectorPostprocessor::SidesetInfoVectorPostprocessor(), and Transfer::Transfer().
|
protectedinherited |
Flag to enable enumeration items not previously defined.
Definition at line 163 of file MooseEnumBase.h.
Referenced by MooseEnum::assign(), MultiMooseEnum::assign(), MooseEnumBase::isOutOfRangeAllowed(), and MooseEnum::operator==().
|
protectedinherited |
The current id.
Definition at line 198 of file MultiMooseEnum.h.
Referenced by appendCurrent(), MultiMooseEnum::assign(), MultiMooseEnum::begin(), MultiMooseEnum::checkDeprecated(), MultiMooseEnum::clear(), MultiMooseEnum::contains(), MultiMooseEnum::end(), MultiMooseEnum::get(), MultiMooseEnum::getEnum(), MultiMooseEnum::isValid(), operator<<(), MultiMooseEnum::operator[](), MultiMooseEnum::remove(), and MultiMooseEnum::size().
|
protectedinherited |
The map of deprecated names and optional replacements.
Definition at line 160 of file MooseEnumBase.h.
Referenced by MooseEnumBase::checkDeprecated(), and MooseEnumBase::deprecate().
|
protectedinherited |
The map of items and their respective documentation strings.
Definition at line 166 of file MooseEnumBase.h.
Referenced by MooseEnumBase::addDocumentation(), and MooseEnumBase::getItemDocumentation().
|
protectedinherited |
Storage for the assigned items.
Definition at line 157 of file MooseEnumBase.h.
Referenced by MooseEnumBase::addDocumentation(), MooseEnumBase::addEnumerationItem(), appendCurrent(), MooseEnum::assign(), MultiMooseEnum::assign(), ReporterProducerEnum::clear(), MooseEnumBase::deprecate(), MooseEnumBase::find(), MooseEnumBase::getIDs(), MooseEnumBase::getNames(), MooseEnumBase::getNextValidID(), MooseEnumBase::getRawNames(), items(), MooseEnumBase::items(), MooseEnum::operator==(), and removeAvailableFlags().