GRINS-0.8.0
List of all members | Public Member Functions | Protected Attributes
GRINS::QoIOutput Class Reference

Encapsulate QoI output flags and functionality. More...

#include <qoi_output.h>

Public Member Functions

 QoIOutput (const GetPot &input)
 
 ~QoIOutput ()
 
bool output_qoi_set () const
 Function to query whether any input options set to output qoi. More...
 
void output_qois (const CompositeQoI &qois, const libMesh::Parallel::Communicator &comm) const
 Output the QoI values for all triggered output modes. More...
 

Protected Attributes

bool _output_to_display
 
bool _output_to_file
 
std::string _file_prefix
 

Detailed Description

Encapsulate QoI output flags and functionality.

This class handles both the parsing of the options for triggering QoI output and implements the functionality for outputting the QoIs (which is really just a wrapper around calling output from QoI classes). Currently, the user can enable printing the QoI info to the display (std::cout) and to a file by specifing the filename in the corresponding input option.

Definition at line 52 of file qoi_output.h.

Constructor & Destructor Documentation

GRINS::QoIOutput::QoIOutput ( const GetPot &  input)

Definition at line 43 of file qoi_output.C.

References _output_to_display, GRINS::OutputParsing::display_section(), grins_warning, GRINS::OutputParsing::output_section(), and GRINS::QoIOptions::output_to_display().

47  {
48  if( input.have_variable("screen-options/print_qoi") )
49  {
50  std::string warning;
51  warning = "WARNING: Option screen-options/print_qoi is DEPRECATED!\n";
52  warning += " Please update input to use ";
54  grins_warning(warning);
55 
56  _output_to_display = input("screen-options/print_qoi", false);
57  }
58  }
std::string _file_prefix
Definition: qoi_output.h:77
static const std::string display_section()
Displace section in input file.
static const std::string output_to_display()
Definition: qoi_options.h:40
bool _output_to_display
Definition: qoi_output.h:73
#define grins_warning(message)
Definition: common.h:34
bool _output_to_file
Definition: qoi_output.h:75
static const std::string qoi_section()
Definition: qoi_options.h:37
static const std::string output_section()
Outer output section in input file.
static const std::string default_file_prefix()
Definition: qoi_options.h:43
GRINS::QoIOutput::~QoIOutput ( )
inline

Definition at line 58 of file qoi_output.h.

58 {}

Member Function Documentation

bool GRINS::QoIOutput::output_qoi_set ( ) const
inline

Function to query whether any input options set to output qoi.

Returns true if user requested to output QoI in any one of the avaiable modes, false otherwise.

Definition at line 63 of file qoi_output.h.

References _output_to_display, and _output_to_file.

64  { return (_output_to_display || _output_to_file ); }
bool _output_to_display
Definition: qoi_output.h:73
bool _output_to_file
Definition: qoi_output.h:75
void GRINS::QoIOutput::output_qois ( const CompositeQoI qois,
const libMesh::Parallel::Communicator &  comm 
) const

Output the QoI values for all triggered output modes.

This function assumes that the qoi values have been assembled by the System.

Definition at line 60 of file qoi_output.C.

References _file_prefix, _output_to_display, _output_to_file, and GRINS::CompositeQoI::output_qoi().

61  {
62  if( _output_to_display )
63  {
64  std::cout << "==========================================================" << std::endl;
65  qois.output_qoi( std::cout );
66  std::cout << "==========================================================" << std::endl;
67  }
68 
69  if( _output_to_file )
70  {
71  if( comm.rank() == 0 )
72  {
73  std::ofstream output;
74  output.open( _file_prefix+".dat" );
75 
76  qois.output_qoi(output);
77 
78  output.close();
79  }
80  }
81  }
std::string _file_prefix
Definition: qoi_output.h:77
bool _output_to_display
Definition: qoi_output.h:73
bool _output_to_file
Definition: qoi_output.h:75

Member Data Documentation

std::string GRINS::QoIOutput::_file_prefix
protected

Definition at line 77 of file qoi_output.h.

Referenced by output_qois().

bool GRINS::QoIOutput::_output_to_display
protected

Definition at line 73 of file qoi_output.h.

Referenced by output_qoi_set(), output_qois(), and QoIOutput().

bool GRINS::QoIOutput::_output_to_file
protected

Definition at line 75 of file qoi_output.h.

Referenced by output_qoi_set(), and output_qois().


The documentation for this class was generated from the following files:

Generated on Tue Dec 19 2017 12:47:32 for GRINS-0.8.0 by  doxygen 1.8.9.1