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 //
92 // We're still defaulting to 32 until our apps in CI start using
93 // this option (and/or re-golding) downstream.
94 //
95 // If someone tries to set truncation at less than 32 they're
96 // probably making a mistake.
97 params.addRangeCheckedParam<unsigned int>("max_output_name_length",
98 32,
99 "32<=max_output_name_length<=80",
100 "Maximum length for names in Exodus file output.");
101
102 params.addParamNamesToGroup("write_hdf5 max_output_name_length", "Advanced");
103
104 // Need a layer of geometric ghosting for mesh serialization
105 params.addRelationshipManager("ElementPointNeighborLayers",
107
108 // Return the InputParameters
109 return params;
110}
111
113 : SampledOutput(parameters),
114 _exodus_initialized(false),
115 _exodus_mesh_changed(declareRestartableData<bool>("exodus_mesh_changed", true)),
116 _sequence(isParamValid("sequence") ? getParam<bool>("sequence")
117 : _use_displaced ? true
118 : false),
119 _exodus_num(declareRestartableData<unsigned int>("exodus_num", 0)),
120 _recovering(_app.isRecovering()),
121 _overwrite(getParam<bool>("overwrite")),
122 _output_dimension(getParam<MooseEnum>("output_dimension").getEnum<OutputDimension>()),
123 _discontinuous(getParam<bool>("discontinuous")),
124 _side_discontinuous(getParam<bool>("side_discontinuous")),
125 _write_hdf5(getParam<bool>("write_hdf5")),
126 _max_output_name_length(getParam<unsigned int>("max_output_name_length"))
127{
128 if (isParamValid("use_problem_dimension"))
129 {
130 auto use_problem_dimension = getParam<bool>("use_problem_dimension");
131
132 if (use_problem_dimension)
134 else
136 }
137 // If user sets 'discontinuous = true' and 'elemental_as_nodal = false', issue an error that these
138 // are incompatible states
139 if (_discontinuous && parameters.isParamSetByUser("elemental_as_nodal") && !_elemental_as_nodal)
141 ": Invalid parameters. 'elemental_as_nodal' set to false while 'discontinuous' set "
142 "to true.");
143 // At this point, if we have discontinuous ouput, we know the user hasn't explicitly set
144 // 'elemental_as_nodal = false', so we can safely default it to true
145 if (_discontinuous)
146 _elemental_as_nodal = true;
147}
148
149void
150Exodus::setOutputDimension(unsigned int /*dim*/)
151{
153 "This method is no longer needed. We can determine output dimension programmatically");
154}
155
156void
158{
159 // Call base class setup method
161
162 // The libMesh::ExodusII_IO will fail when it is closed if the object is created but
163 // nothing is written to the file. This checks that at least something will be written.
164 if (!hasOutput())
165 mooseError("The current settings result in nothing being output to the Exodus file.");
166
167 // Test that some sort of variable output exists (case when all variables are disabled but input
168 // output is still enabled
171 mooseError("The current settings results in only the input file and no variables being output "
172 "to the Exodus file, this is not supported.");
173}
174
175void
177{
178 // Maintain Sampled::meshChanged() functionality
180
181 // Indicate to the Exodus object that the mesh has changed
183}
184
185void
187{
188 _sequence = state;
189}
190
191void
193{
194 if (_exodus_io_ptr)
195 {
196 // Do nothing if the ExodusII_IO objects exists, but has not been initialized
198 return;
199
200 // Do nothing if the output is using oversampling. In this case the mesh that is being output
201 // has not been changed, so there is no need to create a new ExodusII_IO object
203 return;
204
205 // Do nothing if the mesh has not changed and sequential output is not desired
207 return;
208 }
209
210 auto serialize = [this](auto & moose_mesh)
211 {
212 auto & lm_mesh = moose_mesh.getMesh();
213 // Exodus is serial output so that we have to gather everything to "zero".
214 lm_mesh.gather_to_zero();
215 // This makes the face information out-of-date on process 0 for distributed meshes, e.g.
216 // elements will have neighbors that they didn't previously have
217 if ((this->processor_id() == 0) && !lm_mesh.is_replicated())
218 moose_mesh.markFiniteVolumeInfoDirty();
219 };
220 serialize(_problem_ptr->mesh());
221
222 // We need to do the same thing for displaced mesh to make them consistent.
223 // In general, it is a good idea to make the reference mesh and the displaced mesh
224 // consistent since some operations or calculations are already based on this assumption.
225 // For example,
226 // FlagElementsThread::onElement(const Elem * elem)
227 // if (_displaced_problem)
228 // _displaced_problem->mesh().elemPtr(elem->id())->set_refinement_flag((Elem::RefinementState)marker_value);
229 // Here we assume that the displaced mesh and the reference mesh are identical except
230 // coordinations.
232 serialize(_problem_ptr->getDisplacedProblem()->mesh());
233
234 // Create the ExodusII_IO object
235 _exodus_io_ptr = std::make_unique<ExodusII_IO>(_es_ptr->get_mesh());
236 _exodus_initialized = false;
237
238 if (_write_hdf5)
239 {
240#ifndef LIBMESH_HAVE_HDF5
241 mooseError("Moose input requested HDF Exodus output, but libMesh was built without HDF5.");
242#endif
243
244 // This is redundant unless the libMesh default changes
245 _exodus_io_ptr->set_hdf5_writing(true);
246 }
247 else
248 {
249 _exodus_io_ptr->set_hdf5_writing(false);
250 }
251
252 _exodus_io_ptr->set_max_name_length(_max_output_name_length);
253
255 _exodus_io_ptr->write_added_sides(true);
256
257 // Increment file number and set appending status, append if all the following conditions are met:
258 // (1) If the application is recovering (not restarting)
259 // (2) The mesh has NOT changed
260 // (3) An existing Exodus file exists for appending (_exodus_num > 0)
261 // (4) Sequential output is NOT desired
262 // (5) Exodus is NOT being output only on FINAL
264 (getExecuteOnEnum().size() != 1 || !getExecuteOnEnum().contains(EXEC_FINAL)))
265 {
266 // Set the recovering flag to false so that this special case is not triggered again
267 _recovering = false;
268
269 // Set the append flag to true b/c on recover the file is being appended
270 _exodus_io_ptr->append(true);
271 }
272 else
273 {
274 // Disable file appending and reset exodus file number count
275 _exodus_io_ptr->append(false);
276
277 // Customize file output
279 }
280
282}
283
284void
292
293void
295 const MooseMesh & mesh,
296 OutputDimension output_dimension)
297{
298 switch (output_dimension)
299 {
301 // If the mesh_dimension is 1, we need to write out as 3D.
302 //
303 // This works around an issue in Paraview where 1D meshes cannot
304 // not be visualized correctly. Otherwise, write out based on the effectiveSpatialDimension.
305 if (mesh.getMesh().mesh_dimension() == 1)
306 exodus_io.write_as_dimension(3);
307 else
308 exodus_io.write_as_dimension(static_cast<int>(mesh.effectiveSpatialDimension()));
309 break;
310
314 exodus_io.write_as_dimension(static_cast<int>(output_dimension));
315 break;
316
318 exodus_io.use_mesh_dimension_instead_of_spatial_dimension(true);
319 break;
320
321 default:
322 ::mooseError("Unknown output_dimension in Exodus writer");
323 }
324}
325
326void
328{
329 // Set the output variable to the nodal variables
330 std::vector<std::string> nodal(getNodalVariableOutput().begin(), getNodalVariableOutput().end());
331 _exodus_io_ptr->set_output_variables(nodal);
332
333 // Check if the mesh is contiguously numbered, because exodus output will renumber to force that
334 const auto & mesh = _problem_ptr->mesh().getMesh();
335 const bool mesh_contiguous_numbering =
336 (mesh.n_nodes() == mesh.max_node_id()) && (mesh.n_elem() == mesh.max_elem_id());
337
338 // Write the data via libMesh::ExodusII_IO
339 if (_discontinuous)
340 _exodus_io_ptr->write_timestep_discontinuous(
342 else
343 _exodus_io_ptr->write_timestep(
345
346 if (!_overwrite)
347 _exodus_num++;
348
349 if (!mesh_contiguous_numbering)
351
352 // This satisfies the initialization of the ExodusII_IO object
353 _exodus_initialized = true;
354}
355
356void
358{
359 // Make sure the the file is ready for writing of elemental data
362
363 // Write the elemental data
364 std::vector<std::string> elemental(getElementalVariableOutput().begin(),
366 _exodus_io_ptr->set_output_variables(elemental);
367 _exodus_io_ptr->write_element_data(*_es_ptr);
368}
369
370void
372{
373 // List of desired postprocessor outputs
374 const std::set<std::string> & pps = getPostprocessorOutput();
375
376 // Append the postprocessor data to the global name value parameters; scalar outputs
377 // also append these member variables
378 for (const auto & name : pps)
379 {
380 _global_names.push_back(name);
382 }
383}
384
385void
387{
388 for (const auto & combined_name : getReporterOutput())
389 {
390 ReporterName r_name(combined_name);
391 if (_reporter_data.hasReporterValue<Real>(r_name) &&
393 {
394 const Real & value = _reporter_data.getReporterValue<Real>(r_name);
395 _global_names.push_back(r_name.getValueName());
396 _global_values.push_back(value);
397 }
398 }
399}
400
401void
403{
404 // List of desired scalar outputs
405 const std::set<std::string> & out = getScalarOutput();
406
407 // Append the scalar to the global output lists
408 for (const auto & out_name : out)
409 {
410 // Make sure scalar values are in sync with the solution vector
411 // and are visible on this processor. See TableOutput.C for
412 // TableOutput::outputScalarVariables() explanatory comments
413
414 MooseVariableScalar & scalar_var = _problem_ptr->getScalarVariable(0, out_name);
415 scalar_var.reinit();
416 VariableValue value(scalar_var.sln());
417
418 const std::vector<dof_id_type> & dof_indices = scalar_var.dofIndices();
419 const unsigned int n = dof_indices.size();
420 value.resize(n);
421
422 const DofMap & dof_map = scalar_var.sys().dofMap();
423 for (unsigned int i = 0; i != n; ++i)
424 {
425 const processor_id_type pid = dof_map.dof_owner(dof_indices[i]);
426 this->comm().broadcast(value[i], pid);
427 }
428
429 // If the scalar has a single component, output the name directly
430 if (n == 1)
431 {
432 _global_names.push_back(out_name);
433 _global_values.push_back(value[0]);
434 }
435
436 // If the scalar as many components add indices to the end of the name
437 else
438 {
439 for (unsigned int i = 0; i < n; ++i)
440 {
441 std::ostringstream os;
442 os << out_name << "_" << i;
443 _global_names.push_back(os.str());
444 _global_values.push_back(value[i]);
445 }
446 }
447 }
448}
449
450void
452{
453 // Format the input file
454 ExodusFormatter syntax_formatter;
455 syntax_formatter.printInputFile(_app.actionWarehouse());
456 syntax_formatter.format();
457
458 // Store the information
459 _input_record = syntax_formatter.getInputFileRecord();
460}
461
462void
464{
465 // Prepare the ExodusII_IO object
466 outputSetup();
467 LockFile lf(filename(), processor_id() == 0);
468
469 // Adjust the position of the output
471 _exodus_io_ptr->set_coordinate_offset(_app.getOutputPosition());
472
473 // Clear the global variables (postprocessors and scalars)
474 _global_names.clear();
475 _global_values.clear();
476
477 // Call the individual output methods
479
480 // Write the global variables (populated by the output methods)
481 if (!_global_values.empty())
482 {
485 _exodus_io_ptr->write_global_data(_global_values, _global_names);
486 }
487
488 // Write the input file record if it exists and the output file is initialized
489 if (!_input_record.empty() && _exodus_initialized)
490 {
491 _exodus_io_ptr->write_information_records(_input_record);
492 _input_record.clear();
493 }
494
495 // Reset the mesh changed flag
496 _exodus_mesh_changed = false;
497
498 // It is possible to have an empty file created with the following scenario. By default the
499 // 'execute_on_input' flag is setup to run on INITIAL. If the 'execute_on' is set to FINAL
500 // but the simulation stops early (e.g., --test-checkpoint-half-transient) the Exodus file is
501 // created but there is no data in it, because of the initial call to write the input data seems
502 // to create the file but doesn't actually write the data into the solution/mesh is also supplied
503 // to the IO object. Then if --recover is used this empty file fails to open for appending.
504 //
505 // The code below will delete any empty files that exist. Another solution is to set the
506 // 'execute_on_input' flag to NONE.
507 std::string current = filename();
508 if (processor_id() == 0 && MooseUtils::checkFileReadable(current, false, false) &&
509 (MooseUtils::fileSize(current) == 0))
510 {
511 int err = std::remove(current.c_str());
512 if (err != 0)
513 mooseError("MOOSE failed to remove the empty file ", current);
514 }
515}
516
517std::string
519{
520 // Append the .e extension on the base file name
521 std::ostringstream output;
522 output << _file_base + ".e";
523
524 // Add the -s00x extension to the file
525 if (_file_num > 1)
526 output << "-s" << std::setw(_padding) << std::setprecision(0) << std::setfill('0') << std::right
527 << _file_num;
528
529 return output.str();
530}
531
532void
534{
535 // Check if the mesh is contiguously numbered, because exodus output will renumber to force that
536 const auto & mesh = _problem_ptr->mesh().getMesh();
537 const bool mesh_contiguous_numbering =
538 (mesh.n_nodes() == mesh.max_node_id()) && (mesh.n_elem() == mesh.max_elem_id());
539
540 // Write a timestep with no variables
541 _exodus_io_ptr->set_output_variables(std::vector<std::string>());
542 _exodus_io_ptr->write_timestep(
544
545 if (!_overwrite)
546 _exodus_num++;
547
548 if (!mesh_contiguous_numbering)
550 _exodus_initialized = true;
551}
552
553void
555{
556 _exodus_io_ptr.reset();
558}
559
560void
562{
563 // We renumbered our mesh, so we need the other mesh to do the same
564 if (auto * const disp_problem = _problem_ptr->getDisplacedProblem().get(); disp_problem)
565 {
566 auto & disp_eq = disp_problem->es();
567 auto & other_mesh = &disp_eq == _es_ptr ? _problem_ptr->mesh().getMesh() : disp_eq.get_mesh();
568 mooseAssert(
569 !other_mesh.allow_renumbering(),
570 "The only way we shouldn't have contiguous numbering is if we've disabled renumbering");
571 other_mesh.allow_renumbering(true);
572 other_mesh.renumber_nodes_and_elements();
573 // Copying over the comment in MeshOutput::write_equation_systems
574 // Not sure what good going back to false will do here, the
575 // renumbering horses have already left the barn...
576 other_mesh.allow_renumbering(false);
577 }
578
579 // Objects that depend on element/node ids are no longer valid
581 /*intermediate_change=*/false, /*contract_mesh=*/false, /*clean_refinement_flags=*/false);
582}
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:186
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:192
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:554
virtual void outputScalarVariables() override
Writes scalar AuxVariables to global output parameters.
Definition Exodus.C:402
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:518
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:157
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:112
void handleExodusIOMeshRenumbering()
Handle the call to mesh renumbering in libmesh's ExodusIO on non-contiguously numbered meshes.
Definition Exodus.C:561
virtual void outputElementalVariables() override
Outputs elemental, nonlinear variables.
Definition Exodus.C:357
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:285
virtual void outputInput() override
Writes the input file to the ExodusII output.
Definition Exodus.C:451
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:463
void outputEmptyTimestep()
A helper function for 'initializing' the ExodusII output file, see the comments for the _initialized ...
Definition Exodus.C:533
void setOutputDimension(unsigned int dim)
Force the output dimension programatically.
Definition Exodus.C:150
virtual void meshChanged() override
Set flag indicating that the mesh has changed.
Definition Exodus.C:176
virtual void outputNodalVariables() override
Outputs nodal, nonlinear variables.
Definition Exodus.C:327
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:371
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:294
virtual void outputReporters() override
Writes the Reporter values to the ExodusII output.
Definition Exodus.C:386
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:217
Point getOutputPosition() const
Get the output position.
Definition MooseApp.h:288
bool hasOutputPosition() const
Whether or not an output position has been set.
Definition MooseApp.h:282
Real getGlobalTimeOffset() const
Each App has it's own local time.
Definition MooseApp.h:318
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:3557
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:265