MooseEnum

MooseEnums have been around for a few years in MOOSE. They are useful anytime you need to create a list of options for your custom objects. MooseEnums automatically verify that a supplied option matches an item in the list (case-insensitive). MOOSE has full support for using them with the InputParameters class as well.

MultiMooseEnum

MultiMooseEnums are an extension of MooseEnum. They have all the same benefits but can store multiple options. They are easy to assign to and retrieve values from for building the logic in your objects.

// Note the center argumentMultiMooseEnumexecute_on("residual, jacobian, timestep initial custom timestep_begin","initial timestep","The stage of the simulation where this object is executed");// Reassign the Enumexecute_on="residual timestep_begin";// Insert an itemexecute_on.push_back("jacobian");// Retrieve a valuestd::stringvalue=execute_on[0];// Index like a vector// Return the sizeunsignedintsize=execute_on.size();// Return the number of unique items in the Enumunsignedintunique_size=execute_on.unique_size();// Iterate over and print the optionsfor(MooseEnumIteratorit=execute_on.begin();it!=execute_on.end();++it)_console<<*it<<'\n';// See if a value is in the Enumif(execute_on.contains("timestep"))// Not case sensitivedoSomething();

For a complete list of features see the Doxygen page for MultiMooseEnum