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