https://mooseframework.inl.gov
Exodus.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 #include "Exodus.h"
11 
12 // Moose includes
13 #include "DisplacedProblem.h"
14 #include "ExodusFormatter.h"
15 #include "FEProblem.h"
16 #include "FileMesh.h"
17 #include "MooseApp.h"
18 #include "MooseVariableScalar.h"
19 #include "LockFile.h"
20 
21 #include "libmesh/exodusII_io.h"
22 #include "libmesh/libmesh_config.h" // LIBMESH_HAVE_HDF5
23 
24 using namespace libMesh;
25 
26 registerMooseObject("MooseApp", Exodus);
27 
30 {
31  // Get the base class parameters
33  params +=
34  AdvancedOutput::enableOutputTypes("nodal elemental scalar postprocessor reporter input");
35 
36  // Enable sequential file output (do not set default, the use_displace criteria relies on
37  // isParamValid, see Constructor)
38  params.addParam<bool>("sequence",
39  "Enable/disable sequential file output (enabled by default "
40  "when 'use_displace = true', otherwise defaults to false");
41 
42  // Select problem dimension for mesh output
43  params.addDeprecatedParam<bool>("use_problem_dimension",
44  "Use the problem dimension to the mesh output. "
45  "Set to false when outputting lower dimensional "
46  "meshes embedded in a higher dimensional space.",
47  "Use 'output_dimension = problem_dimension' instead.");
48 
49  MooseEnum output_dimension("default 1 2 3 problem_dimension", "default");
50 
51  params.addParam<MooseEnum>(
52  "output_dimension", output_dimension, "The dimension of the output file");
53 
54  params.addParamNamesToGroup("output_dimension", "Advanced");
55 
56  // Set the default padding to 3
57  params.set<unsigned int>("padding") = 3;
58 
59  // Add description for the Exodus class
60  params.addClassDescription("Object for output data in the Exodus format");
61 
62  // Flag for overwriting at each timestep
63  params.addParam<bool>("overwrite",
64  false,
65  "When true the latest timestep will overwrite the "
66  "existing file, so only a single timestep exists.");
67 
68  // Set outputting of the input to be on by default
69  params.set<ExecFlagEnum>("execute_input_on") = EXEC_INITIAL;
70 
71  // Flag for outputting discontinuous data to Exodus
72  params.addParam<bool>(
73  "discontinuous", false, "Enables discontinuous output format for Exodus files.");
74 
75  // Flag for outputting added side elements (for side-discontinuous data) to Exodus
76  params.addParam<bool>(
77  "side_discontinuous", false, "Enables adding side-discontinuous output in Exodus files.");
78 
79  // Flag for outputting Exodus data in HDF5 format (when libMesh is
80  // configured with HDF5 support). libMesh wants to do so by default
81  // (for backwards compatibility with libMesh HDF5 users), but we
82  // want to avoid this by default (for backwards compatibility with
83  // most Moose users and to avoid generating regression test gold
84  // files that non-HDF5 Moose builds can't read)
85  params.addParam<bool>("write_hdf5", false, "Enables HDF5 output format for Exodus files.");
86 
87  // Need a layer of geometric ghosting for mesh serialization
88  params.addRelationshipManager("ElementPointNeighborLayers",
90 
91  // Return the InputParameters
92  return params;
93 }
94 
95 Exodus::Exodus(const InputParameters & parameters)
96  : SampledOutput(parameters),
97  _exodus_initialized(false),
98  _exodus_mesh_changed(declareRestartableData<bool>("exodus_mesh_changed", true)),
99  _sequence(isParamValid("sequence") ? getParam<bool>("sequence")
100  : _use_displaced ? true
101  : false),
102  _exodus_num(declareRestartableData<unsigned int>("exodus_num", 0)),
103  _recovering(_app.isRecovering()),
104  _overwrite(getParam<bool>("overwrite")),
105  _output_dimension(getParam<MooseEnum>("output_dimension").getEnum<OutputDimension>()),
106  _discontinuous(getParam<bool>("discontinuous")),
107  _side_discontinuous(getParam<bool>("side_discontinuous")),
108  _write_hdf5(getParam<bool>("write_hdf5"))
109 {
110  if (isParamValid("use_problem_dimension"))
111  {
112  auto use_problem_dimension = getParam<bool>("use_problem_dimension");
113 
114  if (use_problem_dimension)
116  else
118  }
119  // If user sets 'discontinuous = true' and 'elemental_as_nodal = false', issue an error that these
120  // are incompatible states
121  if (_discontinuous && parameters.isParamSetByUser("elemental_as_nodal") && !_elemental_as_nodal)
122  mooseError(name(),
123  ": Invalid parameters. 'elemental_as_nodal' set to false while 'discontinuous' set "
124  "to true.");
125  // At this point, if we have discontinuous ouput, we know the user hasn't explicitly set
126  // 'elemental_as_nodal = false', so we can safely default it to true
127  if (_discontinuous)
128  _elemental_as_nodal = true;
129 }
130 
131 void
132 Exodus::setOutputDimension(unsigned int /*dim*/)
133 {
135  "This method is no longer needed. We can determine output dimension programmatically");
136 }
137 
138 void
140 {
141  // Call base class setup method
143 
144  // The libMesh::ExodusII_IO will fail when it is closed if the object is created but
145  // nothing is written to the file. This checks that at least something will be written.
146  if (!hasOutput())
147  mooseError("The current settings result in nothing being output to the Exodus file.");
148 
149  // Test that some sort of variable output exists (case when all variables are disabled but input
150  // output is still enabled
152  !hasScalarOutput())
153  mooseError("The current settings results in only the input file and no variables being output "
154  "to the Exodus file, this is not supported.");
155 }
156 
157 void
159 {
160  // Maintain Sampled::meshChanged() functionality
162 
163  // Indicate to the Exodus object that the mesh has changed
164  _exodus_mesh_changed = true;
165 }
166 
167 void
168 Exodus::sequence(bool state)
169 {
170  _sequence = state;
171 }
172 
173 void
175 {
176  if (_exodus_io_ptr)
177  {
178  // Do nothing if the ExodusII_IO objects exists, but has not been initialized
179  if (!_exodus_initialized)
180  return;
181 
182  // Do nothing if the output is using oversampling. In this case the mesh that is being output
183  // has not been changed, so there is no need to create a new ExodusII_IO object
185  return;
186 
187  // Do nothing if the mesh has not changed and sequential output is not desired
189  return;
190  }
191 
192  auto serialize = [this](auto & moose_mesh)
193  {
194  auto & lm_mesh = moose_mesh.getMesh();
195  // Exodus is serial output so that we have to gather everything to "zero".
196  lm_mesh.gather_to_zero();
197  // This makes the face information out-of-date on process 0 for distributed meshes, e.g.
198  // elements will have neighbors that they didn't previously have
199  if ((this->processor_id() == 0) && !lm_mesh.is_replicated())
200  moose_mesh.markFiniteVolumeInfoDirty();
201  };
202  serialize(_problem_ptr->mesh());
203 
204  // We need to do the same thing for displaced mesh to make them consistent.
205  // In general, it is a good idea to make the reference mesh and the displaced mesh
206  // consistent since some operations or calculations are already based on this assumption.
207  // For example,
208  // FlagElementsThread::onElement(const Elem * elem)
209  // if (_displaced_problem)
210  // _displaced_problem->mesh().elemPtr(elem->id())->set_refinement_flag((Elem::RefinementState)marker_value);
211  // Here we assume that the displaced mesh and the reference mesh are identical except
212  // coordinations.
214  serialize(_problem_ptr->getDisplacedProblem()->mesh());
215 
216  // Create the ExodusII_IO object
217  _exodus_io_ptr = std::make_unique<ExodusII_IO>(_es_ptr->get_mesh());
218  _exodus_initialized = false;
219 
220  if (_write_hdf5)
221  {
222 #ifndef LIBMESH_HAVE_HDF5
223  mooseError("Moose input requested HDF Exodus output, but libMesh was built without HDF5.");
224 #endif
225 
226  // This is redundant unless the libMesh default changes
227  _exodus_io_ptr->set_hdf5_writing(true);
228  }
229  else
230  {
231  _exodus_io_ptr->set_hdf5_writing(false);
232  }
233 
235  _exodus_io_ptr->write_added_sides(true);
236 
237  // Increment file number and set appending status, append if all the following conditions are met:
238  // (1) If the application is recovering (not restarting)
239  // (2) The mesh has NOT changed
240  // (3) An existing Exodus file exists for appending (_exodus_num > 0)
241  // (4) Sequential output is NOT desired
242  // (5) Exodus is NOT being output only on FINAL
244  (getExecuteOnEnum().size() != 1 || !getExecuteOnEnum().contains(EXEC_FINAL)))
245  {
246  // Set the recovering flag to false so that this special case is not triggered again
247  _recovering = false;
248 
249  // Set the append flag to true b/c on recover the file is being appended
250  _exodus_io_ptr->append(true);
251  }
252  else
253  {
254  // Disable file appending and reset exodus file number count
255  _exodus_io_ptr->append(false);
256 
257  // Customize file output
259  }
260 
262 }
263 
264 void
266 {
268  _file_num++;
269 
270  _exodus_num = 1;
271 }
272 
273 void
275  const MooseMesh & mesh,
276  OutputDimension output_dimension)
277 {
278  switch (output_dimension)
279  {
281  // If the mesh_dimension is 1, we need to write out as 3D.
282  //
283  // This works around an issue in Paraview where 1D meshes cannot
284  // not be visualized correctly. Otherwise, write out based on the effectiveSpatialDimension.
285  if (mesh.getMesh().mesh_dimension() == 1)
286  exodus_io.write_as_dimension(3);
287  else
288  exodus_io.write_as_dimension(static_cast<int>(mesh.effectiveSpatialDimension()));
289  break;
290 
294  exodus_io.write_as_dimension(static_cast<int>(output_dimension));
295  break;
296 
299  break;
300 
301  default:
302  ::mooseError("Unknown output_dimension in Exodus writer");
303  }
304 }
305 
306 void
308 {
309  // Set the output variable to the nodal variables
310  std::vector<std::string> nodal(getNodalVariableOutput().begin(), getNodalVariableOutput().end());
311  _exodus_io_ptr->set_output_variables(nodal);
312 
313  // Check if the mesh is contiguously numbered, because exodus output will renumber to force that
314  const auto & mesh = _problem_ptr->mesh().getMesh();
315  const bool mesh_contiguous_numbering =
316  (mesh.n_nodes() == mesh.max_node_id()) && (mesh.n_elem() == mesh.max_elem_id());
317 
318  // Write the data via libMesh::ExodusII_IO
319  if (_discontinuous)
320  _exodus_io_ptr->write_timestep_discontinuous(
322  else
323  _exodus_io_ptr->write_timestep(
325 
326  if (!_overwrite)
327  _exodus_num++;
328 
329  if (!mesh_contiguous_numbering)
331 
332  // This satisfies the initialization of the ExodusII_IO object
333  _exodus_initialized = true;
334 }
335 
336 void
338 {
339  // Make sure the the file is ready for writing of elemental data
342 
343  // Write the elemental data
344  std::vector<std::string> elemental(getElementalVariableOutput().begin(),
346  _exodus_io_ptr->set_output_variables(elemental);
347  _exodus_io_ptr->write_element_data(*_es_ptr);
348 }
349 
350 void
352 {
353  // List of desired postprocessor outputs
354  const std::set<std::string> & pps = getPostprocessorOutput();
355 
356  // Append the postprocessor data to the global name value parameters; scalar outputs
357  // also append these member variables
358  for (const auto & name : pps)
359  {
360  _global_names.push_back(name);
362  }
363 }
364 
365 void
367 {
368  for (const auto & combined_name : getReporterOutput())
369  {
370  ReporterName r_name(combined_name);
371  if (_reporter_data.hasReporterValue<Real>(r_name) &&
373  {
374  const Real & value = _reporter_data.getReporterValue<Real>(r_name);
375  _global_names.push_back(r_name.getValueName());
376  _global_values.push_back(value);
377  }
378  }
379 }
380 
381 void
383 {
384  // List of desired scalar outputs
385  const std::set<std::string> & out = getScalarOutput();
386 
387  // Append the scalar to the global output lists
388  for (const auto & out_name : out)
389  {
390  // Make sure scalar values are in sync with the solution vector
391  // and are visible on this processor. See TableOutput.C for
392  // TableOutput::outputScalarVariables() explanatory comments
393 
394  MooseVariableScalar & scalar_var = _problem_ptr->getScalarVariable(0, out_name);
395  scalar_var.reinit();
396  VariableValue value(scalar_var.sln());
397 
398  const std::vector<dof_id_type> & dof_indices = scalar_var.dofIndices();
399  const unsigned int n = dof_indices.size();
400  value.resize(n);
401 
402  const DofMap & dof_map = scalar_var.sys().dofMap();
403  for (unsigned int i = 0; i != n; ++i)
404  {
405  const processor_id_type pid = dof_map.dof_owner(dof_indices[i]);
406  this->comm().broadcast(value[i], pid);
407  }
408 
409  // If the scalar has a single component, output the name directly
410  if (n == 1)
411  {
412  _global_names.push_back(out_name);
413  _global_values.push_back(value[0]);
414  }
415 
416  // If the scalar as many components add indices to the end of the name
417  else
418  {
419  for (unsigned int i = 0; i < n; ++i)
420  {
421  std::ostringstream os;
422  os << out_name << "_" << i;
423  _global_names.push_back(os.str());
424  _global_values.push_back(value[i]);
425  }
426  }
427  }
428 }
429 
430 void
432 {
433  // Format the input file
434  ExodusFormatter syntax_formatter;
435  syntax_formatter.printInputFile(_app.actionWarehouse());
436  syntax_formatter.format();
437 
438  // Store the information
439  _input_record = syntax_formatter.getInputFileRecord();
440 }
441 
442 void
444 {
445  // Prepare the ExodusII_IO object
446  outputSetup();
447  LockFile lf(filename(), processor_id() == 0);
448 
449  // Adjust the position of the output
450  if (_app.hasOutputPosition())
451  _exodus_io_ptr->set_coordinate_offset(_app.getOutputPosition());
452 
453  // Clear the global variables (postprocessors and scalars)
454  _global_names.clear();
455  _global_values.clear();
456 
457  // Call the individual output methods
459 
460  // Write the global variables (populated by the output methods)
461  if (!_global_values.empty())
462  {
463  if (!_exodus_initialized)
465  _exodus_io_ptr->write_global_data(_global_values, _global_names);
466  }
467 
468  // Write the input file record if it exists and the output file is initialized
469  if (!_input_record.empty() && _exodus_initialized)
470  {
471  _exodus_io_ptr->write_information_records(_input_record);
472  _input_record.clear();
473  }
474 
475  // Reset the mesh changed flag
476  _exodus_mesh_changed = false;
477 
478  // It is possible to have an empty file created with the following scenario. By default the
479  // 'execute_on_input' flag is setup to run on INITIAL. If the 'execute_on' is set to FINAL
480  // but the simulation stops early (e.g., --test-checkpoint-half-transient) the Exodus file is
481  // created but there is no data in it, because of the initial call to write the input data seems
482  // to create the file but doesn't actually write the data into the solution/mesh is also supplied
483  // to the IO object. Then if --recover is used this empty file fails to open for appending.
484  //
485  // The code below will delete any empty files that exist. Another solution is to set the
486  // 'execute_on_input' flag to NONE.
487  std::string current = filename();
488  if (processor_id() == 0 && MooseUtils::checkFileReadable(current, false, false) &&
489  (MooseUtils::fileSize(current) == 0))
490  {
491  int err = std::remove(current.c_str());
492  if (err != 0)
493  mooseError("MOOSE failed to remove the empty file ", current);
494  }
495 }
496 
497 std::string
499 {
500  // Append the .e extension on the base file name
501  std::ostringstream output;
502  output << _file_base + ".e";
503 
504  // Add the -s00x extension to the file
505  if (_file_num > 1)
506  output << "-s" << std::setw(_padding) << std::setprecision(0) << std::setfill('0') << std::right
507  << _file_num;
508 
509  return output.str();
510 }
511 
512 void
514 {
515  // Check if the mesh is contiguously numbered, because exodus output will renumber to force that
516  const auto & mesh = _problem_ptr->mesh().getMesh();
517  const bool mesh_contiguous_numbering =
518  (mesh.n_nodes() == mesh.max_node_id()) && (mesh.n_elem() == mesh.max_elem_id());
519 
520  // Write a timestep with no variables
521  _exodus_io_ptr->set_output_variables(std::vector<std::string>());
522  _exodus_io_ptr->write_timestep(
524 
525  if (!_overwrite)
526  _exodus_num++;
527 
528  if (!mesh_contiguous_numbering)
530  _exodus_initialized = true;
531 }
532 
533 void
535 {
536  _exodus_io_ptr.reset();
537 }
538 
539 void
541 {
542  // We renumbered our mesh, so we need the other mesh to do the same
543  if (auto * const disp_problem = _problem_ptr->getDisplacedProblem().get(); disp_problem)
544  {
545  auto & disp_eq = disp_problem->es();
546  auto & other_mesh = &disp_eq == _es_ptr ? _problem_ptr->mesh().getMesh() : disp_eq.get_mesh();
547  mooseAssert(
548  !other_mesh.allow_renumbering(),
549  "The only way we shouldn't have contiguous numbering is if we've disabled renumbering");
550  other_mesh.allow_renumbering(true);
551  other_mesh.renumber_nodes_and_elements();
552  // Copying over the comment in MeshOutput::write_equation_systems
553  // Not sure what good going back to false will do here, the
554  // renumbering horses have already left the barn...
555  other_mesh.allow_renumbering(false);
556  }
557 
558  // Objects that depend on element/node ids are no longer valid
560  /*intermediate_change=*/false, /*contract_mesh=*/false, /*clean_refinement_flags=*/false);
561 }
OStreamProxy err
const std::set< std::string > & getPostprocessorOutput()
The list of postprocessor names that are set for output.
virtual void meshChanged(bool intermediate_change, bool contract_mesh, bool clean_refinement_flags)
Update data after a mesh change.
bool _use_sampled_output
Flag indicating that the sampled output should be used to re-sample the underlying EquationSystem of ...
Definition: SampledOutput.h:71
void use_mesh_dimension_instead_of_spatial_dimension(bool val)
virtual void outputReporters() override
Writes the Reporter values to the ExodusII output.
Definition: Exodus.C:366
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:21
std::vector< std::string > _input_record
Storage for input file record; this is written to the file only after it has been initialized...
Definition: Exodus.h:194
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void write_as_dimension(unsigned dim)
void mooseDeprecated(Args &&... args) const
processor_id_type dof_owner(const dof_id_type dof) const
virtual void sequence(bool state)
Set the sequence state When the sequence state is set to true then the outputSetup() method is called...
Definition: Exodus.C:168
bool hasOutputPosition() const
Whether or not an output position has been set.
Definition: MooseApp.h:302
void allow_renumbering(bool allow)
void reinit(bool reinit_for_derivative_reordering=false)
Fill out the VariableValue arrays from the system solution vector.
virtual void meshChanged() override
Set flag indicating that the mesh has changed.
Definition: Exodus.C:158
virtual void output() override
Overload the OutputBase::output method, this is required for ExodusII output due to the method utiliz...
Definition: Exodus.C:443
std::unique_ptr< libMesh::ExodusII_IO > _exodus_io_ptr
Pointer to the libMesh::ExodusII_IO object that performs the actual data output.
Definition: Exodus.h:147
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
MeshBase & mesh
bool _write_hdf5
Flag to output HDF5 format (when available) in Exodus.
Definition: Exodus.h:209
bool _elemental_as_nodal
Flags to control nodal output.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const Parallel::Communicator & comm() const
virtual std::string filename() override
Returns the current filename, this method handles the -s000 suffix common to ExodusII files...
Definition: Exodus.C:498
std::string _file_base
The base filename from the input paramaters.
Definition: FileOutput.h:89
bool _overwrite
Flag for overwriting timesteps.
Definition: Exodus.h:197
virtual void output()
A single call to this function should output all the necessary data for a single timestep.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:33
void clear()
Reset Exodus output.
Definition: Exodus.C:534
bool _side_discontinuous
Flag to output added disjoint fictitious sides for side_discontinuous variables.
Definition: Exodus.h:206
void addRelationshipManager(const std::string &name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback input_parameter_callback=nullptr)
Tells MOOSE about a RelationshipManager that this object needs.
virtual void outputNodalVariables() override
Outputs nodal, nonlinear variables.
Definition: Exodus.C:307
OutputDimension
Definition: Exodus.h:29
OutputDimension _output_dimension
Enum for the output dimension.
Definition: Exodus.h:200
bool _discontinuous
Flag to output discontinuous format in Exodus.
Definition: Exodus.h:203
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
Based class for providing re-positioning and oversampling support to output objects.
Definition: SampledOutput.h:39
bool _exodus_initialized
Flag for indicating the status of the ExodusII file that is being written.
Definition: Exodus.h:167
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
static InputParameters validParams()
Definition: Exodus.C:29
unsigned int _padding
Number of digits to pad the extensions.
Definition: FileOutput.h:83
const std::set< std::string > & getReporterOutput()
The list of Reporter names that are set for output.
uint8_t processor_id_type
virtual libMesh::DofMap & dofMap()
Gets writeable reference to the dof map.
Definition: SystemBase.C:1165
void setOutputDimension(unsigned int dim)
Force the output dimension programatically.
Definition: Exodus.C:132
bool hasNodalVariableOutput()
Returns true if there exists nodal nonlinear variables for output.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
const std::set< std::string > & getScalarOutput()
The list of scalar variables names that are set for output.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:3443
const T & getReporterValue(const ReporterName &reporter_name, const MooseObject &consumer, const ReporterMode &mode, const std::size_t time_index=0) const
Method for returning read only references to Reporter values.
Definition: ReporterData.h:388
bool hasPostprocessorByName(const PostprocessorName &name) const
Determine if the Postprocessor data exists.
bool _recovering
Flag indicating MOOSE is recovering via –recover command-line option.
Definition: Exodus.h:191
bool & _exodus_mesh_changed
A flag indicating to the Exodus object that the mesh has changed.
Definition: Exodus.h:170
Class for output data to the ExodusII format.
Definition: Exodus.h:24
const ExecFlagEnum & getExecuteOnEnum() const
Return the execute on MultiMooseEnum for this object.
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true, bool check_for_git_lfs_pointer=true)
Checks to see if a file is readable (exists and permissions)
Definition: MooseUtils.C:250
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
Definition: Output.h:185
virtual dof_id_type max_elem_id() const=0
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
std::vector< std::string > & getInputFileRecord()
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
std::vector< std::string > _global_names
Storage for names of the above scalar values.
Definition: Exodus.h:153
std::size_t fileSize(const std::string &filename)
Check the file size.
Definition: MooseUtils.C:1201
Exodus(const InputParameters &parameters)
Class constructor.
Definition: Exodus.C:95
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
bool hasScalarOutput()
Returns true if there exists scalar variables for output.
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
Definition: MooseApp.h:237
virtual void meshChanged() override
Called on this object when the mesh changes.
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:84
std::vector< Real > _global_values
Storage for scalar values (postprocessors and scalar AuxVariables)
Definition: Exodus.h:150
const std::string & getObjectName() const
Return the object name that produces the Reporter value.
Definition: ReporterName.C:35
unsigned int & _exodus_num
Count of outputs per exodus file.
Definition: Exodus.h:176
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.
bool _sequence
Sequence flag, if true each timestep is written to a new file.
Definition: Exodus.h:173
const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name, std::size_t t_index=0) const
Get a read-only reference to the value associated with a Postprocessor that exists.
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
Point getOutputPosition() const
Get the output position.
Definition: MooseApp.h:308
const ReporterData & _reporter_data
Storage for Reporter values.
virtual void outputElementalVariables() override
Outputs elemental, nonlinear variables.
Definition: Exodus.C:337
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:314
void outputEmptyTimestep()
A helper function for &#39;initializing&#39; the ExodusII output file, see the comments for the _initialized ...
Definition: Exodus.C:513
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was set by the user.
virtual void outputSetup()
Performs the necessary deletion and re-creating of ExodusII_IO object.
Definition: Exodus.C:174
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
static void setOutputDimensionInExodusWriter(libMesh::ExodusII_IO &exodus_io, const MooseMesh &mesh, OutputDimension output_dim=OutputDimension::DEFAULT)
Helper method to change the output dimension in the passed in Exodus writer depending on the dimensio...
Definition: Exodus.C:274
OStreamProxy out
libMesh::EquationSystems * _es_ptr
Reference the the libMesh::EquationSystems object that contains the data.
Definition: Output.h:194
const MeshBase & get_mesh() const
virtual void outputInput() override
Writes the input file to the ExodusII output.
Definition: Exodus.C:431
Class for scalar variables (they are different).
virtual MooseMesh & mesh() override
MooseMesh * _mesh_ptr
A convenience pointer to the current mesh (reference or displaced depending on "use_displaced") ...
Definition: Output.h:197
unsigned int mesh_dimension() const
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const std::set< std::string > & getElementalVariableOutput()
The list of elemental nonlinear variables names that are set for output.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
const InputParameters & parameters() const
Get the parameters of the object.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
virtual void outputScalarVariables() override
Writes scalar AuxVariables to global output parameters.
Definition: Exodus.C:382
bool hasReporterValue(const ReporterName &reporter_name) const
Return True if a Reporter value with the given type and name have been created.
Definition: ReporterData.h:445
unsigned int & _file_num
A file number counter, initialized to 0 (this must be controlled by the child class, see Exodus)
Definition: FileOutput.h:80
const std::set< std::string > & getNodalVariableOutput()
The list of nodal nonlinear variables names that are set for output.
Gets an exclusive lock on a file.
Definition: LockFile.h:22
virtual void customizeFileOutput()
Customizes file output settings.
Definition: Exodus.C:265
const std::string & getValueName() const
Return the data name for the Reporter value.
Definition: ReporterName.C:41
void printInputFile(ActionWarehouse &wh)
virtual dof_id_type max_node_id() const=0
virtual dof_id_type n_elem() const=0
processor_id_type processor_id() const
SystemBase & sys()
Get the system this variable is part of.
Real getGlobalTimeOffset() const
Each App has it&#39;s own local time.
Definition: MooseApp.h:338
const ExecFlagType EXEC_FINAL
Definition: Moose.C:42
static InputParameters validParams()
Definition: SampledOutput.C:25
const VariableValue & sln() const
virtual void outputPostprocessors() override
Writes postprocessor values to global output parameters.
Definition: Exodus.C:351
virtual Real getOutputTime()
Get the time that will be used for stream/file outputting.
Definition: PetscOutput.C:273
void ErrorVector unsigned int
The Reporter system is comprised of objects that can contain any number of data values.
Definition: ReporterName.h:30
virtual dof_id_type n_nodes() const=0
registerMooseObject("MooseApp", Exodus)
void handleExodusIOMeshRenumbering()
Handle the call to mesh renumbering in libmesh&#39;s ExodusIO on non-contiguously numbered meshes...
Definition: Exodus.C:540
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...
virtual void initialSetup() override
Performs basic error checking and initial setup of ExodusII_IO output object.
Definition: Exodus.C:139
virtual void initialSetup() override
Call init() method on setup.
Definition: SampledOutput.C:76
const ExecFlagType EXEC_INITIAL
Definition: Moose.C:28