LCOV - code coverage report
Current view: top level - src/outputs - Gnuplot.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 18 18 100.0 %
Date: 2025-07-17 01:28:37 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      13             : registerMooseObject("MooseApp", Gnuplot);
      14             : 
      15             : InputParameters
      16       14337 : Gnuplot::validParams()
      17             : {
      18             :   // Get the parameters from the parent object
      19       14337 :   InputParameters params = TableOutput::validParams();
      20       14337 :   params.addClassDescription("Output for postprocessors and scalar variables in GNU plot format.");
      21             : 
      22             :   // Set an enum for the possible file extensions
      23       14337 :   MooseEnum ext("png ps gif", "png", true);
      24       14337 :   params.addParam<MooseEnum>("extension", ext, "GNU plot file extension");
      25             : 
      26       28674 :   return params;
      27       14337 : }
      28             : 
      29          36 : Gnuplot::Gnuplot(const InputParameters & parameters)
      30          36 :   : TableOutput(parameters), _extension(getParam<MooseEnum>("extension"))
      31             : {
      32          36 : }
      33             : 
      34             : std::string
      35         102 : Gnuplot::filename()
      36             : {
      37         102 :   return _file_base;
      38             : }
      39             : 
      40             : void
      41          66 : Gnuplot::output()
      42             : {
      43             :   // Call the base class output (populates tables)
      44          66 :   TableOutput::output();
      45             : 
      46             :   // Print the table containing all the data to a file
      47          66 :   if (!_all_data_table.empty())
      48          66 :     _all_data_table.makeGnuplot(filename(), _extension);
      49             : 
      50             :   // Update the file number
      51          66 :   _file_num++;
      52          66 : }

Generated by: LCOV version 1.14