https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FileOutput.h
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#pragma once
11
12// MOOSE includes
13#include "PetscOutput.h"
14
20class FileOutput : public PetscOutput
21{
22public:
24
29
34 virtual std::string filename();
35
41 void setFileBase(const std::string & file_base);
42
49 void setFileNumber(unsigned int num);
50
57 unsigned int getFileNumber();
58
59protected:
63 virtual bool shouldOutput() override;
64
70 bool checkFilename();
71
77 virtual void setFileBaseInternal(const std::string & file_base);
78
80 unsigned int & _file_num;
81
83 unsigned int _padding;
84
86 std::vector<std::string> _output_if_base_contains;
87
89 std::string _file_base;
90
91private:
92 // OutputWarehouse needs access to _file_num for MultiApp ninja wizardry (see
93 // OutputWarehouse::merge)
94 friend class OutputWarehouse;
95};
An outputter with filename support.
Definition FileOutput.h:21
unsigned int getFileNumber()
Return the current file number for this outputter.
Definition FileOutput.C:180
std::vector< std::string > _output_if_base_contains
Storage for 'output_if_base_contains'.
Definition FileOutput.h:86
unsigned int _padding
Number of digits to pad the extensions.
Definition FileOutput.h:83
virtual std::string filename()
The filename for the output file.
Definition FileOutput.C:113
void setFileNumber(unsigned int num)
Sets the file number manually.
Definition FileOutput.C:174
static InputParameters validParams()
Definition FileOutput.C:24
virtual bool shouldOutput() override
Checks if the output method should be executed.
Definition FileOutput.C:80
std::string _file_base
The base filename from the input paramaters.
Definition FileOutput.h:89
void setFileBase(const std::string &file_base)
Sets the file base string if the 'file_base' parameter is not set.
Definition FileOutput.C:119
bool checkFilename()
Checks the filename for output Checks the output against the 'output_if_base_contians' list.
Definition FileOutput.C:88
virtual void setFileBaseInternal(const std::string &file_base)
Internal function that sets the file_base.
Definition FileOutput.C:126
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.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Class for storing and utilizing output objects.
Adds the ability to output on every nonlinear and/or linear residual.
Definition PetscOutput.h:42