36 params.
addParam<std::vector<VariableName>>(
39 "A list of the variables and postprocessors that should NOT be output to the Exodus " 40 "file (may include Variables, ScalarVariables, and Postprocessor names).");
42 params.
addParam<std::vector<VariableName>>(
45 "A list of the variables and postprocessors that should be output to the Exodus file " 46 "(may include Variables, ScalarVariables, and Postprocessor names).");
50 "postprocessors_as_reporters",
false,
"Output Postprocessors values as Reporter values.");
51 params.
addParam<
bool>(
"vectorpostprocessors_as_reporters",
53 "Output VectorsPostprocessors vectors as Reporter values.");
60 "Conversions before output");
65 "Enable/disable the output of postprocessors",
66 "'execute_postprocessors_on' has replaced this parameter");
69 "Enable/disable the output of vector postprocessors",
70 "'execute_vector_postprocessors_on' has replaced this parameter");
73 "Enable/disable the output of the simulation information",
74 "'execute_system_information_on' has replaced this parameter");
77 "Enable/disable the output of elemental variables",
78 "'execute_elemental_on' has replaced this parameter");
81 "Enable/disable the output of nodal variables",
82 "'execute_nodal_on' has replaced this parameter");
85 "Enable/disable the output of aux scalar variables",
86 "'execute_scalars_on' has replaced this parameter");
89 "Enable/disable the output of input file information",
90 "'execute_input_on' has replaced this parameter");
99 addAdvancedOutputParams(params);
107 return MultiMooseEnum(
"nodal=0 elemental=1 scalar=2 postprocessor=3 vector_postprocessor=4 " 108 "input=5 system_information=6 reporter=7");
125 output_types = names;
135 _elemental_as_nodal(isParamValid(
"elemental_as_nodal") ? getParam<bool>(
"elemental_as_nodal")
137 _scalar_as_nodal(isParamValid(
"scalar_as_nodal") ? getParam<bool>(
"scalar_as_nodal") : false),
138 _reporter_data(_problem_ptr->getReporterData()),
139 _postprocessors_as_reporters(getParam<bool>(
"postprocessors_as_reporters")),
140 _vectorpostprocessors_as_reporters(getParam<bool>(
"vectorpostprocessors_as_reporters"))
167 getParam<std::vector<VariableName>>(
"hide"));
176 nodal.
show.insert(elemental.
show.begin(), elemental.
show.end());
177 nodal.
hide.insert(elemental.
hide.begin(), elemental.
hide.end());
186 nodal.
show.insert(scalar.
show.begin(), scalar.
show.end());
187 nodal.
hide.insert(scalar.
hide.begin(), scalar.
hide.end());
201 mooseError(
"Individual output of nodal variables is not support for the output object named '",
210 "Individual output of elemental variables is not support for this output object named '",
218 mooseError(
"Individual output of postprocessors is not support for this output object named '",
227 "Individual output of VectorPostprocessors is not support for this output object named '",
236 "Individual output of scalars is not support for this output object named '",
name(),
"'");
243 "Output of system information is not support for this output object named '",
name(),
"'");
249 mooseError(
"Output of the input file information is not support for this output object named '",
258 "Output of the Reporter value(s) is not support for this output object named '",
name(),
"'");
343 bool execute_data_flag =
true;
348 execute_data_flag =
false;
352 execute_data_flag =
false;
408 initPostprocessorOrVectorPostprocessorLists<Postprocessor>(
"postprocessors");
415 initPostprocessorOrVectorPostprocessorLists<VectorPostprocessor>(
"vector_postprocessors");
421 for (
const auto & var_name : variables)
429 for (
unsigned int i = 0; i < var.
count(); ++i)
431 VariableName vname = var_name;
448 switch (
_es_ptr->get_mesh().spatial_dimension())
485 std::string param_name =
"execute_";
486 param_name +=
name +
"_on";
490 input = getParam<ExecFlagEnum>(param_name);
503 const std::vector<VariableName> & hide)
507 std::set<std::string> unknown;
515 for (
const auto & var_name : show)
522 for (
unsigned int i = 0; i < var.
count(); ++i)
524 VariableName vname = var_name;
533 const auto geom_type =
535 switch (
_es_ptr->get_mesh().spatial_dimension())
561 _execute_data[
"vector_postprocessors"].show.insert(var_name);
562 else if ((var_name.find(
"/") != std::string::npos) &&
566 unknown.insert(var_name);
570 for (
const auto & var_name : hide)
577 for (
unsigned int i = 0; i < var.
count(); ++i)
579 VariableName vname = var_name;
588 switch (
_es_ptr->get_mesh().spatial_dimension())
614 _execute_data[
"vector_postprocessors"].hide.insert(var_name);
615 else if ((var_name.find(
"/") != std::string::npos) &&
620 unknown.insert(var_name);
624 if (!unknown.empty())
626 std::ostringstream oss;
627 oss <<
"Output(s) do not exist (must be variable, scalar, postprocessor, or vector " 629 std::copy(unknown.begin(), unknown.end(), infix_ostream_iterator<std::string>(oss,
" "));
638 std::set<std::string> & hide = data.
hide;
639 std::set<std::string> & show = data.
show;
640 std::set<std::string> & avail = data.
available;
644 std::set<std::string> interface_hide;
646 hide.insert(interface_hide.begin(), interface_hide.end());
653 else if (!show.empty() && hide.empty())
657 else if (show.empty() && !hide.empty())
658 std::set_difference(avail.begin(),
668 std::vector<std::string> tmp;
669 std::set_intersection(
670 hide.begin(), hide.end(), show.begin(), show.end(), std::inserter(tmp, tmp.begin()));
673 std::ostringstream oss;
674 oss <<
"Output(s) specified to be both shown and hidden: ";
675 std::copy(tmp.begin(), tmp.end(), infix_ostream_iterator<std::string>(oss,
" "));
694 "execute_nodal_on", empty_execute_on,
"Control the output of nodal variables");
702 "execute_elemental_on", empty_execute_on,
"Control the output of elemental variables");
706 params.
addParam<
bool>(
"output_material_properties",
708 "Flag indicating if material properties should be output");
709 params.
addParam<std::vector<std::string>>(
710 "show_material_properties",
711 "List of material properties that should be written to the output");
712 params.
addParamNamesToGroup(
"output_material_properties show_material_properties",
"Materials");
716 "output_extra_element_ids",
718 "Flag indicating if extra element ids defined on the mesh should be outputted");
719 params.
addParam<std::vector<std::string>>(
720 "extra_element_ids_to_output",
721 "List of extra element ids defined on the mesh that should be written to the output.");
729 "execute_scalars_on", empty_execute_on,
"Control the output of scalar variables");
736 params.
addParam<
bool>(
"scalar_as_nodal",
false,
"Output scalar variables as nodal");
744 "elemental_as_nodal",
false,
"Output elemental nonlinear variables as nodal");
749 if (types.
contains(
"postprocessor"))
752 "execute_postprocessors_on", empty_execute_on,
"Control of when postprocessors are output");
757 if (types.
contains(
"vector_postprocessor"))
761 "Enable/disable the output of VectorPostprocessors");
763 "Selection/restriction of output");
770 "execute_reporters_on", empty_execute_on,
"Control of when Reporter values are output");
778 "execute_input_on", empty_execute_on,
"Enable/disable the output of the input file");
783 if (types.
contains(
"system_information"))
787 "Control when the output of the simulation information occurs");
788 params.
addParamNamesToGroup(
"execute_system_information_on",
"Selection/restriction of output");
805 const std::set<std::string> &
817 const std::set<std::string> &
829 const std::set<std::string> &
841 const std::set<std::string> &
853 const std::set<std::string> &
865 const std::set<std::string> &
virtual void outputVectorPostprocessors()
Performs output of VectorPostprocessors The child class must define this method to output the VectorP...
virtual bool hasVariable(const std::string &var_name) const override
Whether or not this problem has the variable.
virtual void outputSystemInformation()
const std::set< std::string > & getPostprocessorOutput()
The list of postprocessor names that are set for output.
std::set< std::string > output
A list of the outputs to write.
const ExecFlagType EXEC_FAILED
bool hasPostprocessorOutput()
Returns true if there exists postprocessors for output.
virtual bool hasOutput()
Returns true if any of the other has methods return true.
A MultiMooseEnum object to hold "execute_on" flags.
std::map< std::string, Real > _last_execute_time
Storage for the last output time for the various output types, this is used to avoid duplicate output...
ExecFlagEnum _execute_on
The common Execution types; this is used as the default execution type for everything except system i...
bool hasVectorPostprocessorOutput()
Returns true if there exists VectorPostprocessors for output.
const bool _postprocessors_as_reporters
Flags for outputting PP/VPP data as a reporter.
const ExecFlagType EXEC_FORCED
OutputOnWarehouse _advanced_execute_on
Storage for the individual component execute flags.
AdvancedOutput(const InputParameters ¶meters)
Class constructor.
virtual void outputElementalVariables()
Performs output of elemental nonlinear variables The child class must define this method to output th...
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one...
bool hasOutputHelper(const std::string &name)
Helper method for checking if output types exists.
bool _elemental_as_nodal
Flags to control nodal output.
void initShowHideLists(const std::vector< VariableName > &show, const std::vector< VariableName > &hide)
Parses the user-supplied input for hiding and showing variables and postprocessors into a list for ea...
OutputDataWarehouse _execute_data
Storage structures for the various output types.
virtual bool hasScalarVariable(const std::string &var_name) const override
Returns a Boolean indicating whether any system contains a variable with the name provided...
virtual bool shouldOutput()
Handles logic for determining if a step should be output.
virtual ~AdvancedOutput()
Class destructor.
virtual void output()
A single call to this function should output all the necessary data for a single timestep.
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
Add additional execute_on flags to the list of possible flags.
This class provides an interface for common operations on field variables of both FE and FV types wit...
const std::set< std::string > & getVectorPostprocessorOutput()
The list of VectorPostprocessor names that are set for output.
std::string getRawNames() const
Method for returning the raw name strings for this instance.
A structure for storing the various lists that contain the names of the items to be exported...
void initOutputList(OutputData &data)
Initializes the list of items to be output using the available, show, and hide lists.
virtual const std::string & name() const
Get the name of the class.
const FEType & feType() const
Get the type of finite element object.
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
virtual void outputScalarVariables()
Performs output of scalar variables The child class must define this method to output the scalar vari...
virtual bool isArray() const =0
ExecFlagEnum getDefaultExecFlagEnum()
Return the default ExecFlagEnum for MOOSE.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
virtual bool shouldOutput()
Handles logic for determining if a step should be output.
const OutputOnWarehouse & advancedExecuteOn() const
Get the current advanced 'execute_on' selections for display.
void initAvailableLists()
Initializes the available lists for each of the output types.
const std::set< std::string > & getReporterOutput()
The list of Reporter names that are set for output.
bool contains(const std::string &value) const
Contains methods for seeing if a value is in the MultiMooseEnum.
bool hasShowList()
False when the show lists for all variables is empty.
virtual std::vector< VariableName > getVariableNames()
Returns a list of all the variables in the problem (both from the NL and Aux systems.
bool hasNodalVariableOutput()
Returns true if there exists nodal nonlinear variables for output.
virtual void outputNodalVariables()
Performs output of nodal nonlinear variables The child class must define this method to output the no...
bool havePRefinement() const
Query whether p-refinement has been requested at any point during the simulation. ...
void reset()
Clear existing lists for re-initialization.
const std::set< std::string > & getScalarOutput()
The list of scalar variables names that are set for output.
EquationSystems * _es_ptr
Reference the the libMesh::EquationSystems object that contains the data.
std::set< std::string > available
A list of all possible outputs.
bool hasPostprocessorByName(const PostprocessorName &name) const
Determine if the Postprocessor data exists.
virtual void outputInput()
Performs the output of the input file By default this method does nothing and is not called...
ExecFlagType _current_execute_flag
Current execute on flag.
bool contains(const std::string &name) const
A method for testing of a key exists.
const bool _vectorpostprocessors_as_reporters
static void addValidParams(InputParameters ¶ms, const MultiMooseEnum &types)
Method for defining the available parameters based on the types of outputs.
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
static InputParameters validParams()
const std::string & type() const
Get the type of this class.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
A helper warehouse class for storing the "execute_on" settings for the various output types...
bool hasScalarOutput()
Returns true if there exists scalar variables for output.
MooseApp & _app
The MOOSE application this is associated with.
static InputParameters enableOutputTypes(const std::string &names=std::string())
A method for enabling individual output type control.
bool hasElementalVariableOutput()
Returns true if there exists elemental nonlinear variables for output.
std::set< std::string > hide
User-supplied list of outputs to hide.
void clear()
Clear the MultiMooseEnum.
std::set< ReporterName > getReporterNames() const
Return a list of all reporter names.
std::map< std::string, T >::iterator end()
const ReporterData & _reporter_data
Storage for Reporter values.
bool _is_advanced
Flag for advanced output testing.
bool wantOutput(const std::string &name, const ExecFlagType &type)
Handles logic for determining if a step should be output.
virtual void outputReporters()
Output Reporter values.
static std::string arrayVariableComponent(const std::string &var_name, unsigned int i)
Returns the variable name of a component of an array variable.
bool hasVectorPostprocessorByName(const VectorPostprocessorName &name, const std::string &vector_name) const
Determine if the VectorPostprocessor data exists by name.
virtual void initialSetup()
Call init() method on setup.
Class for containing MooseEnum item information.
virtual void outputPostprocessors()
Performs output of postprocessors The child class must define this method to output the postprocessor...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
const std::set< std::string > & getElementalVariableOutput()
The list of elemental nonlinear variables names that are set for output.
static MultiMooseEnum getOutputTypes()
Get the supported types of output (e.g., postprocessors, etc.)
const InputParameters & parameters() const
Get the parameters of the object.
std::set< std::string > show
User-supplied list of outputs to display.
const std::set< std::string > & getNodalVariableOutput()
The list of nodal nonlinear variables names that are set for output.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void buildInterfaceHideVariables(const std::string &output_name, std::set< std::string > &hide)
Return the list of hidden variables for the given output name.
bool hasReporterOutput()
Returns true if there exists Reporter for output.
static InputParameters validParams()
An outputter with filename support.
bool checkFilename()
Checks the filename for output Checks the output against the 'output_if_base_contians' list...
void initExecutionTypes(const std::string &name, ExecFlagEnum &input)
Initialize the possible execution types.
std::map< std::string, T >::iterator find(const std::string &name)
const ExecFlagType EXEC_FINAL
Real & _time
The current time for output purposes.
bool hasReporterValueByName(const ReporterName &reporter_name) const
The Reporter system is comprised of objects that can contain any number of data values.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
virtual void init()
Populates the various data structures needed to control the output.
void setHasShowList(bool value)
Set the show list bool.