www.mooseframework.org
FileOutput.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
13 #include "PetscOutput.h"
14 
15 // Forward declerations
16 class FileOutput;
17 
18 template <>
20 
26 class FileOutput : public PetscOutput
27 {
28 public:
33 
38  virtual std::string filename();
39 
46  void setFileNumber(unsigned int num);
47 
54  unsigned int getFileNumber();
55 
65  static std::string getOutputFileBase(const MooseApp & app, std::string suffix = "_out");
66 
67 protected:
71  virtual bool shouldOutput(const ExecFlagType & type) override;
72 
78  bool checkFilename();
79 
81  std::string _file_base;
82 
84  unsigned int & _file_num;
85 
87  unsigned int _padding;
88 
90  std::vector<std::string> _output_if_base_contains;
91 
92 private:
93  // OutputWarehouse needs access to _file_num for MultiApp ninja wizardry (see
94  // OutputWarehouse::merge)
95  friend class OutputWarehouse;
96 };
97 
virtual std::string filename()
The filename for the output file.
Definition: FileOutput.C:172
virtual bool shouldOutput(const ExecFlagType &type) override
Checks if the output method should be executed.
Definition: FileOutput.C:139
static std::string getOutputFileBase(const MooseApp &app, std::string suffix="_out")
Returns the default output file base.
Definition: FileOutput.C:111
Base class for MOOSE-based applications.
Definition: MooseApp.h:59
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:184
std::string _file_base
The base filename from the input paramaters.
Definition: FileOutput.h:81
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:53
void setFileNumber(unsigned int num)
Sets the file number manually.
Definition: FileOutput.C:178
unsigned int _padding
Number of digits to pad the extensions.
Definition: FileOutput.h:87
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
Class for storing and utilizing output objects.
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
std::vector< std::string > _output_if_base_contains
Storage for &#39;output_if_base_contains&#39;.
Definition: FileOutput.h:90
unsigned int & _file_num
A file number counter, initialized to 0 (this must be controlled by the child class, see Exodus)
Definition: FileOutput.h:84
InputParameters validParams< FileOutput >()
Definition: FileOutput.C:23
FileOutput(const InputParameters &parameters)
Class constructor.
Definition: FileOutput.C:48
An outputter with filename support.
Definition: FileOutput.h:26
Adds the ability to output on every nonlinear and/or linear residual.
Definition: PetscOutput.h:24
bool checkFilename()
Checks the filename for output Checks the output against the &#39;output_if_base_contians&#39; list...
Definition: FileOutput.C:147