www.mooseframework.org
FileOutput.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef FILEOUTPUT_H
16 #define FILEOUTPUT_H
17 
18 // MOOSE includes
19 #include "PetscOutput.h"
20 
21 // Forward declerations
22 class FileOutput;
23 
24 template <>
26 
32 class FileOutput : public PetscOutput
33 {
34 public:
39 
44  virtual std::string filename();
45 
52  void setFileNumber(unsigned int num);
53 
60  unsigned int getFileNumber();
61 
71  static std::string getOutputFileBase(MooseApp & app, std::string suffix = "_out");
72 
73 protected:
77  virtual bool shouldOutput(const ExecFlagType & type) override;
78 
84  bool checkFilename();
85 
87  std::string _file_base;
88 
90  unsigned int & _file_num;
91 
93  unsigned int _padding;
94 
96  std::vector<std::string> _output_if_base_contains;
97 
98 private:
99  // OutputWarehouse needs access to _file_num for MultiApp ninja wizardry (see
100  // OutputWarehouse::merge)
101  friend class OutputWarehouse;
102 };
103 
104 #endif /* FILEOUTPUT_H */
virtual std::string filename()
The filename for the output file.
Definition: FileOutput.C:170
virtual bool shouldOutput(const ExecFlagType &type) override
Checks if the output method should be executed.
Definition: FileOutput.C:137
static std::string getOutputFileBase(MooseApp &app, std::string suffix="_out")
Returns the default output file base.
Definition: FileOutput.C:112
Base class for MOOSE-based applications.
Definition: MooseApp.h:58
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
unsigned int getFileNumber()
Return the current file number for this outputter.
Definition: FileOutput.C:182
std::string _file_base
The base filename from the input paramaters.
Definition: FileOutput.h:87
void setFileNumber(unsigned int num)
Sets the file number manually.
Definition: FileOutput.C:176
unsigned int _padding
Number of digits to pad the extensions.
Definition: FileOutput.h:93
Class for storing and utilizing output objects.
MatType type
std::vector< std::string > _output_if_base_contains
Storage for &#39;output_if_base_contains&#39;.
Definition: FileOutput.h:96
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
unsigned int & _file_num
A file number counter, initialized to 0 (this must be controlled by the child class, see Exodus)
Definition: FileOutput.h:90
InputParameters validParams< FileOutput >()
Definition: FileOutput.C:28
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
FileOutput(const InputParameters &parameters)
Class constructor.
Definition: FileOutput.C:53
An outputter with filename support.
Definition: FileOutput.h:32
Adds the ability to output on every nonlinear and/or linear residual.
Definition: PetscOutput.h:30
bool checkFilename()
Checks the filename for output Checks the output against the &#39;output_if_base_contians&#39; list...
Definition: FileOutput.C:145