https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Gnuplot.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// MOOSE includes
11#include "Gnuplot.h"
12
14
17{
18 // Get the parameters from the parent object
20 params.addClassDescription("Output for postprocessors and scalar variables in GNU plot format.");
21
22 // Set an enum for the possible file extensions
23 MooseEnum ext("png ps gif", "png", true);
24 params.addParam<MooseEnum>("extension", ext, "GNU plot file extension");
25
26 return params;
27}
28
30 : TableOutput(parameters), _extension(getParam<MooseEnum>("extension"))
31{
32}
33
34std::string
36{
37 return _file_base;
38}
39
40void
42{
43 // Call the base class output (populates tables)
45
46 // Print the table containing all the data to a file
49
50 // Update the file number
51 _file_num++;
52}
registerMooseObject("MooseApp", Gnuplot)
virtual void output()
A single call to this function should output all the necessary data for a single timestep.
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
bool empty() const
Returns a boolean value based on whether the FormattedTable contains data or not.
void makeGnuplot(const std::string &base_file, const std::string &format)
Based class for adding basic filename support to output base class.
Definition Gnuplot.h:21
Gnuplot(const InputParameters &parameters)
Class constructor.
Definition Gnuplot.C:29
virtual std::string filename() override
The filename for the output file.
Definition Gnuplot.C:35
virtual void output() override
Output the table to a *.csv file.
Definition Gnuplot.C:41
std::string _extension
Desired file extension.
Definition Gnuplot.h:48
static InputParameters validParams()
Definition Gnuplot.C:16
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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 addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
Base class for scalar variables and postprocessors output objects.
Definition TableOutput.h:29
static InputParameters validParams()
Definition TableOutput.C:26
FormattedTable & _all_data_table
Table containing postprocessor values, scalar aux variables, and Real Reporters.