www.mooseframework.org
Gnuplot.C
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 // MOOSE includes
16 #include "Gnuplot.h"
17 
18 template <>
21 {
22  // Get the parameters from the parent object
24 
25  // Set an enum for the possible file extensions
26  MooseEnum ext("png ps gif", "png", true);
27  params.addParam<MooseEnum>("extension", ext, "GNU plot file extension");
28 
29  return params;
30 }
31 
32 Gnuplot::Gnuplot(const InputParameters & parameters)
33  : TableOutput(parameters), _extension(getParam<MooseEnum>("extension"))
34 {
35 }
36 
37 std::string
39 {
40  return _file_base;
41 }
42 
43 void
45 {
46  // Call the base class output (populates tables)
47  TableOutput::output(type);
48 
49  // Print the table containing all the data to a file
50  if (!_all_data_table.empty())
52 
53  // Update the file number
54  _file_num++;
55 }
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)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::string _file_base
The base filename from the input paramaters.
Definition: FileOutput.h:87
virtual std::string filename() override
The filename for the output file.
Definition: Gnuplot.C:38
virtual void output(const ExecFlagType &type)
A single call to this function should output all the necessary data for a single timestep.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
virtual void output(const ExecFlagType &type) override
Output the table to a *.csv file.
Definition: Gnuplot.C:44
FormattedTable & _all_data_table
Table containing postprocessor values and scalar aux variables.
Definition: TableOutput.h:82
MatType type
InputParameters validParams< Gnuplot >()
Definition: Gnuplot.C:20
Base class for scalar variables and postprocessors output objects.
Definition: TableOutput.h:39
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
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
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
std::string _extension
Desired file extension.
Definition: Gnuplot.h:58
InputParameters validParams< TableOutput >()
Definition: TableOutput.C:32
Gnuplot(const InputParameters &parameters)
Class constructor.
Definition: Gnuplot.C:32