www.mooseframework.org
AdvancedOutput.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // Standard includes
11 #include <math.h>
12 
13 // MOOSE includes
14 #include "AdvancedOutput.h"
15 #include "DisplacedProblem.h"
16 #include "FEProblem.h"
17 #include "FileMesh.h"
18 #include "FileOutput.h"
19 #include "InfixIterator.h"
20 #include "MooseApp.h"
21 #include "MooseUtils.h"
22 #include "MooseVariableFE.h"
23 #include "Postprocessor.h"
24 #include "Restartable.h"
25 #include "VectorPostprocessor.h"
26 
27 // A function, only available in this file, for adding the AdvancedOutput parameters. This is
28 // used to eliminate code duplication between the difference specializations of the validParams
29 // function.
30 namespace
31 {
32 void
33 addAdvancedOutputParams(InputParameters & params)
34 {
35  // Hide/show variable output options
36  params.addParam<std::vector<VariableName>>(
37  "hide",
38  "A list of the variables and postprocessors that should NOT be output to the Exodus "
39  "file (may include Variables, ScalarVariables, and Postprocessor names).");
40 
41  params.addParam<std::vector<VariableName>>(
42  "show",
43  "A list of the variables and postprocessors that should be output to the Exodus file "
44  "(may include Variables, ScalarVariables, and Postprocessor names).");
45 
46  // 'Variables' Group
47  params.addParamNamesToGroup("hide show", "Variables");
48 
49  // **** DEPRECATED PARAMS ****
50  params.addDeprecatedParam<bool>("output_postprocessors",
51  true,
52  "Enable/disable the output of postprocessors",
53  "'execute_postprocessors_on' has replaced this parameter");
54  params.addDeprecatedParam<bool>("execute_vector_postprocessors",
55  true,
56  "Enable/disable the output of vector postprocessors",
57  "'execute_vector_postprocessors_on' has replaced this parameter");
58  params.addDeprecatedParam<bool>("execute_system_information",
59  true,
60  "Enable/disable the output of the simulation information",
61  "'execute_system_information_on' has replaced this parameter");
62  params.addDeprecatedParam<bool>("execute_elemental_variables",
63  true,
64  "Enable/disable the output of elemental variables",
65  "'execute_elemental_on' has replaced this parameter");
66  params.addDeprecatedParam<bool>("execute_nodal_variables",
67  true,
68  "Enable/disable the output of nodal variables",
69  "'execute_nodal_on' has replaced this parameter");
70  params.addDeprecatedParam<bool>("execute_scalar_variables",
71  true,
72  "Enable/disable the output of aux scalar variables",
73  "'execute_scalars_on' has replaced this parameter");
74  params.addDeprecatedParam<bool>("execute_input",
75  true,
76  "Enable/disable the output of input file information",
77  "'execute_input_on' has replaced this parameter");
78 }
79 }
80 
81 template <>
84 {
85  // Get the parameters from the parent object
87  addAdvancedOutputParams(params);
88  return params;
89 }
90 
91 // Defines the output types to enable for the AdvancedOutput object
94 {
95  return MultiMooseEnum("nodal=0 elemental=1 scalar=2 postprocessor=3 vector_postprocessor=4 "
96  "input=5 system_information=6");
97 }
98 
99 // Enables the output types (see getOutputTypes) for an AdvancedOutput object
101 AdvancedOutput::enableOutputTypes(const std::string & names)
102 {
103  // The parameters object that will be returned
105 
106  // Get the MultiEnum of output types
107  MultiMooseEnum output_types = getOutputTypes();
108 
109  // Update the enum of output types to append
110  if (names.empty())
111  output_types = output_types.getRawNames();
112  else
113  output_types = names;
114 
115  // Add the parameters and return them
116  addValidParams(params, output_types);
117  return params;
118 }
119 
120 // Constructor
122 {
123  _is_advanced = true;
125  // Set nodal output variables if they appear in valid parameters
126  if (isParamValid("elemental_as_nodal"))
127  _elemental_as_nodal = getParam<bool>("elemental_as_nodal");
128  if (isParamValid("scalar_as_nodal"))
129  _scalar_as_nodal = getParam<bool>("scalar_as_nodal");
130 }
131 
132 void
134 {
135  // Do not initialize more than once
136  // This check is needed for YAK which calls Executioners from within Executioners
137  if (_initialized)
138  return;
139 
140  // Initialize the available output
142 
143  // Separate the hide/show list into components
144  initShowHideLists(getParam<std::vector<VariableName>>("show"),
145  getParam<std::vector<VariableName>>("hide"));
146 
147  // If 'elemental_as_nodal = true' the elemental variable names must be appended to the
148  // nodal variable names. Thus, when libMesh::EquationSystem::build_solution_vector is called
149  // it will create the correct nodal variable from the elemental
150  if (isParamValid("elemental_as_nodal") && _elemental_as_nodal)
151  {
152  OutputData & nodal = _execute_data["nodal"];
153  OutputData & elemental = _execute_data["elemental"];
154  nodal.show.insert(elemental.show.begin(), elemental.show.end());
155  nodal.hide.insert(elemental.hide.begin(), elemental.hide.end());
156  nodal.available.insert(elemental.available.begin(), elemental.available.end());
157  }
158 
159  // Similarly as above, if 'scalar_as_nodal = true' append the elemental variable lists
160  if (isParamValid("scalar_as_nodal") && _scalar_as_nodal)
161  {
162  OutputData & nodal = _execute_data["nodal"];
163  OutputData & scalar = _execute_data["scalars"];
164  nodal.show.insert(scalar.show.begin(), scalar.show.end());
165  nodal.hide.insert(scalar.hide.begin(), scalar.hide.end());
166  nodal.available.insert(scalar.available.begin(), scalar.available.end());
167  }
168 
169  // Initialize the show/hide/output lists for each of the types of output
170  for (auto & it : _execute_data)
171  initOutputList(it.second);
172 
173  // Initialize the execution flags
174  for (auto & it : _advanced_execute_on)
175  initExecutionTypes(it.first, it.second);
176 
177  // Set the initialization flag
178  _initialized = true;
179 }
180 
182 
183 void
185 {
186  mooseError("Individual output of nodal variables is not support for the output object named '",
187  name(),
188  "'");
189 }
190 
191 void
193 {
194  mooseError(
195  "Individual output of elemental variables is not support for this output object named '",
196  name(),
197  "'");
198 }
199 
200 void
202 {
203  mooseError("Individual output of postprocessors is not support for this output object named '",
204  name(),
205  "'");
206 }
207 
208 void
210 {
211  mooseError(
212  "Individual output of VectorPostprocessors is not support for this output object named '",
213  name(),
214  "'");
215 }
216 
217 void
219 {
220  mooseError(
221  "Individual output of scalars is not support for this output object named '", name(), "'");
222 }
223 
224 void
226 {
227  mooseError(
228  "Output of system information is not support for this output object named '", name(), "'");
229 }
230 
231 void
233 {
234  mooseError("Output of the input file information is not support for this output object named '",
235  name(),
236  "'");
237 }
238 
239 bool
241 {
242  if (!checkFilename())
243  return false;
244 
245  if (hasOutput(type))
246  return true;
247  else
248  return Output::shouldOutput(type);
249 }
250 
251 void
253 {
254  // Call the various output types, if data exists
255  if (wantOutput("nodal", type))
256  {
258  _last_execute_time["nodal"] = _time;
259  }
260 
261  if (wantOutput("elemental", type))
262  {
264  _last_execute_time["elemental"] = _time;
265  }
266 
267  if (wantOutput("postprocessors", type))
268  {
270  _last_execute_time["postprocessors"] = _time;
271  }
272 
273  if (wantOutput("vector_postprocessors", type))
274  {
276  _last_execute_time["vector_postprocessors"] = _time;
277  }
278 
279  if (wantOutput("scalars", type))
280  {
282  _last_execute_time["scalars"] = _time;
283  }
284 
285  if (wantOutput("system_information", type))
286  {
288  _last_execute_time["system_information"] = _time;
289  }
290 
291  if (wantOutput("input", type))
292  {
293  outputInput();
294  _last_execute_time["input"] = _time;
295  }
296 }
297 
298 bool
299 AdvancedOutput::wantOutput(const std::string & name, const ExecFlagType & type)
300 {
301  // Ignore EXEC_FORCED for system information and input, there is no reason to force this
302  if (type == EXEC_FORCED && (name == "system_information" || name == "input"))
303  return false;
304 
305  // Do not output if the 'none' is contained by the execute_on
307  return false;
308 
309  // Data output flag, true if data exists to be output
310  bool execute_data_flag = true;
311 
312  // Set flag to false, if the OutputData exists and the output variable list is empty
313  std::map<std::string, OutputData>::const_iterator iter = _execute_data.find(name);
314  if (iter != _execute_data.end() && iter->second.output.empty())
315  execute_data_flag = false;
316 
317  // Set flag to false, if the OutputOnWarehouse DOES NOT contain an entry
319  execute_data_flag = false;
320 
321  // Force the output, if there is something to output and the time has not been output
322  if (type == EXEC_FORCED && execute_data_flag && _last_execute_time[name] != _time)
323  return true;
324 
325  // Return true (output should occur) if three criteria are satisfied, else do not output:
326  // (1) The execute_data_flag = true (i.e, there is data to output)
327  // (2) The current output type is contained in the list of output execution types
328  // (3) The current execution time is "final" or "forced" and the data has not already been
329  // output
330  if (execute_data_flag && _advanced_execute_on[name].contains(type) &&
332  return true;
333  else
334  return false;
335 }
336 
337 bool
339 {
340  // If any of the component outputs are true, then there is some output to perform
341  for (const auto & it : _advanced_execute_on)
342  if (wantOutput(it.first, type))
343  return true;
344 
345  // There is nothing to output
346  return false;
347 }
348 
349 bool
351 {
352  // Test that variables exist for output AND that output execution flags are valid
353  for (const auto & it : _execute_data)
354  if (!(it.second).output.empty() && _advanced_execute_on.contains(it.first) &&
355  _advanced_execute_on[it.first].isValid())
356  return true;
357 
358  // Test execution flags for non-variable output
359  if (_advanced_execute_on.contains("system_information") &&
360  _advanced_execute_on["system_information"].isValid())
361  return true;
362  if (_advanced_execute_on.contains("input") && _advanced_execute_on["input"].isValid())
363  return true;
364 
365  return false;
366 }
367 
368 void
370 {
371  // Initialize Postprocessor list
372  // This flag is set to true if any postprocessor has the 'outputs' parameter set, it is then used
373  // to produce an warning if postprocessor output is disabled
374  initPostprocessorOrVectorPostprocessorLists<Postprocessor>("postprocessors");
375 
376  // Initialize vector postprocessor list
377  // This flag is set to true if any vector postprocessor has the 'outputs' parameter set, it is
378  // then used
379  // to produce an warning if vector postprocessor output is disabled
380  initPostprocessorOrVectorPostprocessorLists<VectorPostprocessor>("vector_postprocessors");
381 
382  // Get a list of the available variables
383  std::vector<VariableName> variables = _problem_ptr->getVariableNames();
384 
385  // Loop through the variables and store the names in the correct available lists
386  for (const auto & var_name : variables)
387  {
388  if (_problem_ptr->hasVariable(var_name))
389  {
392  const FEType type = var.feType();
393  if (type.order == CONSTANT)
394  _execute_data["elemental"].available.insert(var_name);
395  else if (type.family == NEDELEC_ONE || type.family == LAGRANGE_VEC)
396  {
397  switch (_es_ptr->get_mesh().spatial_dimension())
398  {
399  case 0:
400  case 1:
401  _execute_data["nodal"].available.insert(var_name);
402  break;
403  case 2:
404  _execute_data["nodal"].available.insert(var_name + "_x");
405  _execute_data["nodal"].available.insert(var_name + "_y");
406  break;
407  case 3:
408  _execute_data["nodal"].available.insert(var_name + "_x");
409  _execute_data["nodal"].available.insert(var_name + "_y");
410  _execute_data["nodal"].available.insert(var_name + "_z");
411  break;
412  }
413  }
414  else
415  _execute_data["nodal"].available.insert(var_name);
416  }
417 
418  else if (_problem_ptr->hasScalarVariable(var_name))
419  _execute_data["scalars"].available.insert(var_name);
420  }
421 }
422 
423 void
424 AdvancedOutput::initExecutionTypes(const std::string & name, ExecFlagEnum & input)
425 {
426  // Build the input paramemter name
427  std::string param_name = "execute_";
428  param_name += name + "_on";
429 
430  // The parameters exists and has been set by the user
431  if (_pars.have_parameter<ExecFlagEnum>(param_name) && isParamValid(param_name))
432  input = getParam<ExecFlagEnum>(param_name);
433 
434  // If the parameter does not exists; set it to a state where no valid entries exists so nothing
435  // gets executed
436  else if (!_pars.have_parameter<ExecFlagEnum>(param_name))
437  {
438  input = _execute_on;
439  input.clear();
440  }
441 }
442 
443 void
444 AdvancedOutput::initShowHideLists(const std::vector<VariableName> & show,
445  const std::vector<VariableName> & hide)
446 {
447 
448  // Storage for user-supplied input that is unknown as a variable or postprocessor
449  std::set<std::string> unknown;
450 
451  // If a show hide/list exists, let the data warehouse know about it. This allows for the proper
452  // handling of output lists (see initOutputList)
453  if (show.size() > 0)
455 
456  // Populate the show lists
457  for (const auto & var_name : show)
458  {
459  if (_problem_ptr->hasVariable(var_name))
460  {
463  const FEType type = var.feType();
464  if (type.order == CONSTANT)
465  _execute_data["elemental"].show.insert(var_name);
466  else if (type.family == NEDELEC_ONE || type.family == LAGRANGE_VEC)
467  {
468  switch (_es_ptr->get_mesh().spatial_dimension())
469  {
470  case 0:
471  case 1:
472  _execute_data["nodal"].show.insert(var_name);
473  break;
474  case 2:
475  _execute_data["nodal"].show.insert(var_name + "_x");
476  _execute_data["nodal"].show.insert(var_name + "_y");
477  break;
478  case 3:
479  _execute_data["nodal"].show.insert(var_name + "_x");
480  _execute_data["nodal"].show.insert(var_name + "_y");
481  _execute_data["nodal"].show.insert(var_name + "_z");
482  break;
483  }
484  }
485  else
486  _execute_data["nodal"].show.insert(var_name);
487  }
488  else if (_problem_ptr->hasScalarVariable(var_name))
489  _execute_data["scalars"].show.insert(var_name);
490  else if (_problem_ptr->hasPostprocessor(var_name))
491  _execute_data["postprocessors"].show.insert(var_name);
492  else if (_problem_ptr->hasVectorPostprocessor(var_name))
493  _execute_data["vector_postprocessors"].show.insert(var_name);
494  else
495  unknown.insert(var_name);
496  }
497 
498  // Populate the hide lists
499  for (const auto & var_name : hide)
500  {
501  if (_problem_ptr->hasVariable(var_name))
502  {
505  const FEType type = var.feType();
506  if (type.order == CONSTANT)
507  _execute_data["elemental"].hide.insert(var_name);
508  else if (type.family == NEDELEC_ONE || type.family == LAGRANGE_VEC)
509  {
510  switch (_es_ptr->get_mesh().spatial_dimension())
511  {
512  case 0:
513  case 1:
514  _execute_data["nodal"].hide.insert(var_name);
515  break;
516  case 2:
517  _execute_data["nodal"].hide.insert(var_name + "_x");
518  _execute_data["nodal"].hide.insert(var_name + "_y");
519  break;
520  case 3:
521  _execute_data["nodal"].hide.insert(var_name + "_x");
522  _execute_data["nodal"].hide.insert(var_name + "_y");
523  _execute_data["nodal"].hide.insert(var_name + "_z");
524  break;
525  }
526  }
527  else
528  _execute_data["nodal"].hide.insert(var_name);
529  }
530  else if (_problem_ptr->hasScalarVariable(var_name))
531  _execute_data["scalars"].hide.insert(var_name);
532  else if (_problem_ptr->hasPostprocessor(var_name))
533  _execute_data["postprocessors"].hide.insert(var_name);
534  else if (_problem_ptr->hasVectorPostprocessor(var_name))
535  _execute_data["vector_postprocessors"].hide.insert(var_name);
536  else
537  unknown.insert(var_name);
538  }
539 
540  // Error if an unknown variable or postprocessor is found
541  if (!unknown.empty())
542  {
543  std::ostringstream oss;
544  oss << "Output(s) do not exist (must be variable, scalar, postprocessor, or vector "
545  "postprocessor): ";
546  std::copy(unknown.begin(), unknown.end(), infix_ostream_iterator<std::string>(oss, " "));
547  mooseError(oss.str());
548  }
549 }
550 
551 void
553 {
554  // References to the vectors of variable names
555  std::set<std::string> & hide = data.hide;
556  std::set<std::string> & show = data.show;
557  std::set<std::string> & avail = data.available;
558  std::set<std::string> & output = data.output;
559 
560  // Append the list from OutputInterface objects
561  std::set<std::string> interface_hide;
563  hide.insert(interface_hide.begin(), interface_hide.end());
564 
565  // Both show and hide are empty and no show/hide settings were provided (show all available)
566  if (show.empty() && hide.empty() && !_execute_data.hasShowList())
567  output = avail;
568 
569  // Only hide is empty (show all the variables listed)
570  else if (!show.empty() && hide.empty())
571  output = show;
572 
573  // Only show is empty (show all except those hidden)
574  else if (show.empty() && !hide.empty())
575  std::set_difference(avail.begin(),
576  avail.end(),
577  hide.begin(),
578  hide.end(),
579  std::inserter(output, output.begin()));
580 
581  // Both hide and show are present (show all those listed)
582  else
583  {
584  // Check if variables are in both, which is invalid
585  std::vector<std::string> tmp;
586  std::set_intersection(
587  hide.begin(), hide.end(), show.begin(), show.end(), std::inserter(tmp, tmp.begin()));
588  if (!tmp.empty())
589  {
590  std::ostringstream oss;
591  oss << "Output(s) specified to be both shown and hidden: ";
592  std::copy(tmp.begin(), tmp.end(), infix_ostream_iterator<std::string>(oss, " "));
593  mooseError(oss.str());
594  }
595 
596  // Define the output variable list
597  output = show;
598  }
599 }
600 
601 void
603 {
605  empty_execute_on.addAvailableFlags(EXEC_FAILED);
606 
607  // Nodal output
608  if (types.contains("nodal"))
609  {
610  params.addParam<ExecFlagEnum>(
611  "execute_nodal_on", empty_execute_on, "Control the output of nodal variables");
612  params.addParamNamesToGroup("execute_nodal_on", "Variables");
613  }
614 
615  // Elemental output
616  if (types.contains("elemental"))
617  {
618  params.addParam<ExecFlagEnum>(
619  "execute_elemental_on", empty_execute_on, "Control the output of elemental variables");
620  params.addParamNamesToGroup("execute_elemental_on", "Variables");
621 
622  // Add material output control, which are output via elemental variables
623  params.addParam<bool>("output_material_properties",
624  false,
625  "Flag indicating if material properties should be output");
626  params.addParam<std::vector<std::string>>(
627  "show_material_properties",
628  "List of materialproperties that should be written to the output");
629  params.addParamNamesToGroup("output_material_properties show_material_properties", "Materials");
630  }
631 
632  // Scalar variable output
633  if (types.contains("scalar"))
634  {
635  params.addParam<ExecFlagEnum>(
636  "execute_scalars_on", empty_execute_on, "Control the output of scalar variables");
637  params.addParamNamesToGroup("execute_scalars_on", "Variables");
638  }
639 
640  // Nodal and scalar output
641  if (types.contains("nodal") && types.contains("scalar"))
642  {
643  params.addParam<bool>("scalar_as_nodal", false, "Output scalar variables as nodal");
644  params.addParamNamesToGroup("scalar_as_nodal", "Variables");
645  }
646 
647  // Elemental and nodal
648  if (types.contains("elemental") && types.contains("nodal"))
649  {
650  params.addParam<bool>(
651  "elemental_as_nodal", false, "Output elemental nonlinear variables as nodal");
652  params.addParamNamesToGroup("elemental_as_nodal", "Variables");
653  }
654 
655  // Postprocessors
656  if (types.contains("postprocessor"))
657  {
658  params.addParam<ExecFlagEnum>(
659  "execute_postprocessors_on", empty_execute_on, "Control of when postprocessors are output");
660  params.addParamNamesToGroup("execute_postprocessors_on", "Variables");
661  }
662 
663  // Vector Postprocessors
664  if (types.contains("vector_postprocessor"))
665  {
666  params.addParam<ExecFlagEnum>("execute_vector_postprocessors_on",
667  empty_execute_on,
668  "Enable/disable the output of VectorPostprocessors");
669  params.addParamNamesToGroup("execute_vector_postprocessors_on", "Variables");
670  }
671 
672  // Input file
673  if (types.contains("input"))
674  {
675  params.addParam<ExecFlagEnum>(
676  "execute_input_on", empty_execute_on, "Enable/disable the output of the input file");
677  params.addParamNamesToGroup("execute_input_on", "Variables");
678  }
679 
680  // System Information
681  if (types.contains("system_information"))
682  {
683  params.addParam<ExecFlagEnum>("execute_system_information_on",
684  empty_execute_on,
685  "Control when the output of the simulation information occurs");
686  params.addParamNamesToGroup("execute_system_information_on", "Variables");
687  }
688 }
689 
690 bool
691 AdvancedOutput::hasOutputHelper(const std::string & name)
692 {
693  if (!_initialized)
694  mooseError("The output object must be initialized before it may be determined if ",
695  name,
696  " output is enabled.");
697 
698  return !_execute_data[name].output.empty() && _advanced_execute_on.contains(name) &&
700 }
701 
702 bool
704 {
705  return hasOutputHelper("nodal");
706 }
707 
708 const std::set<std::string> &
710 {
711  return _execute_data["nodal"].output;
712 }
713 
714 bool
716 {
717  return hasOutputHelper("elemental");
718 }
719 
720 const std::set<std::string> &
722 {
723  return _execute_data["elemental"].output;
724 }
725 
726 bool
728 {
729  return hasOutputHelper("scalars");
730 }
731 
732 const std::set<std::string> &
734 {
735  return _execute_data["scalars"].output;
736 }
737 
738 bool
740 {
741  return hasOutputHelper("postprocessors");
742 }
743 
744 const std::set<std::string> &
746 {
747  return _execute_data["postprocessors"].output;
748 }
749 
750 bool
752 {
753  return hasOutputHelper("vector_postprocessors");
754 }
755 
756 const std::set<std::string> &
758 {
759  return _execute_data["vector_postprocessors"].output;
760 }
761 
762 const OutputOnWarehouse &
764 {
765  return _advanced_execute_on;
766 }
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
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.
Definition: ExecFlagEnum.h:24
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...
Definition: Output.h:185
bool hasVectorPostprocessorOutput()
Returns true if there exists VectorPostprocessors for output.
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
virtual MooseVariableFEBase & getVariable(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) override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
const ExecFlagType EXEC_FORCED
OutputOnWarehouse _advanced_execute_on
Storage for the individual component execute flags.
Definition: Output.h:242
AdvancedOutput(const InputParameters &parameters)
Class constructor.
virtual void outputElementalVariables()
Performs output of elemental nonlinear variables The child class must define this method to output th...
virtual bool shouldOutput(const ExecFlagType &type)
Handles logic for determining if a step should be output.
Definition: Output.C:188
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...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
bool hasPostprocessor(const std::string &name)
Check existence of the postprocessor.
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 ~AdvancedOutput()
Class destructor.
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
Add additional execute_on flags to the list of possible flags.
Definition: ExecFlagEnum.h:84
bool hasVectorPostprocessor(const std::string &name)
Check existence of the VectorPostprocessor.
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
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.
const FEType & feType() const
Get the type of finite element object.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:191
InputParameters emptyInputParameters()
virtual void outputScalarVariables()
Performs output of scalar variables The child class must define this method to output the scalar vari...
InputParameters validParams< AdvancedOutput >()
ExecFlagEnum getDefaultExecFlagEnum()
Return the default ExecFlagEnum for MOOSE.
Definition: MooseUtils.C:667
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:53
const OutputOnWarehouse & advancedExecuteOn() const
Get the current advanced &#39;execute_on&#39; selections for display.
void initAvailableLists()
Initializes the available lists for each of the output types.
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 _initialized
True if init() has been called.
Definition: Output.h:230
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 contains(const std::string &name)
A method for testing of a key exists.
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.
Definition: Output.h:176
std::set< std::string > available
A list of all possible outputs.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
virtual void output(const ExecFlagType &type)
A single call to this function should output all the necessary data for a single timestep.
virtual void outputInput()
Performs the output of the input file By default this method does nothing and is not called...
static void addValidParams(InputParameters &params, const MultiMooseEnum &types)
Method for defining the available parameters based on the types of outputs.
virtual bool shouldOutput(const ExecFlagType &type)
Handles logic for determining if a step should be output.
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
Definition: Output.h:167
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.
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.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:174
std::set< std::string > hide
User-supplied list of outputs to hide.
void clear()
Clear the MultiMooseEnum.
std::map< std::string, T >::iterator end()
bool _is_advanced
Flag for advanced output testing.
Definition: Output.h:236
bool wantOutput(const std::string &name, const ExecFlagType &type)
Handles logic for determining if a step should be output.
MatType type
virtual void initialSetup()
Initialization method.
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
virtual void outputPostprocessors()
Performs output of postprocessors The child class must define this method to output the postprocessor...
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:177
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:59
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.)
std::set< std::string > show
User-supplied list of outputs to display.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
InputParameters validParams< FileOutput >()
Definition: FileOutput.C:23
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.
An outputter with filename support.
Definition: FileOutput.h:26
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:89
bool checkFilename()
Checks the filename for output Checks the output against the &#39;output_if_base_contians&#39; list...
Definition: FileOutput.C:147
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.
Definition: Output.h:188
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:1055
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...
void setHasShowList(bool value)
Set the show list bool.