www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
VectorPostprocessor Class Reference

Base class for Postprocessors that produce a vector of values. More...

#include <VectorPostprocessor.h>

Inheritance diagram for VectorPostprocessor:
[legend]

Public Member Functions

 VectorPostprocessor (const InputParameters &parameters)
 
virtual ~VectorPostprocessor ()=default
 
virtual VectorPostprocessorValuegetVector (const std::string &vector_name)
 This will get called to actually grab the final value the VectorPostprocessor has calculated. More...
 
std::string PPName ()
 Returns the name of the VectorPostprocessor. More...
 
bool containsCompleteHistory () const
 Return whether or not this VectorPostprocessor contains complete history. More...
 
void buildOutputHideVariableList (std::set< std::string > variable_names)
 Builds hide lists for output objects NOT listed in the 'outputs' parameter. More...
 
const std::set< OutputName > & getOutputs ()
 Get the list of output objects that this class is restricted. More...
 

Protected Member Functions

VectorPostprocessorValuedeclareVector (const std::string &vector_name)
 Register a new vector to fill up. More...
 

Protected Attributes

std::string _vpp_name
 The name of the VectorPostprocessor. More...
 
FEProblemBase_vpp_fe_problem
 Pointer to FEProblemBase. More...
 

Private Attributes

THREAD_ID _vpp_tid
 
const bool _contains_complete_history
 
const bool _is_broadcast
 
std::map< std::string, VectorPostprocessorValue_thread_local_vectors
 

Friends

class SamplerBase
 

Detailed Description

Base class for Postprocessors that produce a vector of values.

Definition at line 36 of file VectorPostprocessor.h.

Constructor & Destructor Documentation

◆ VectorPostprocessor()

VectorPostprocessor::VectorPostprocessor ( const InputParameters parameters)

Definition at line 40 of file VectorPostprocessor.C.

41  : OutputInterface(parameters),
42  _vpp_name(MooseUtils::shortName(parameters.get<std::string>("_object_name"))),
43  _vpp_fe_problem(parameters.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
44  _vpp_tid(parameters.isParamValid("_tid") ? parameters.get<THREAD_ID>("_tid") : 0),
45  _contains_complete_history(parameters.get<bool>("contains_complete_history")),
46  _is_broadcast(parameters.get<bool>("_is_broadcast"))
47 {
48 }
FEProblemBase * _vpp_fe_problem
Pointer to FEProblemBase.
std::string _vpp_name
The name of the VectorPostprocessor.
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
OutputInterface(const InputParameters &parameters, bool build_list=true)
Handles &#39;outputs&#39; parameter for objects that desire control of variable outputs.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:360
const bool _contains_complete_history
unsigned int THREAD_ID
Definition: MooseTypes.h:97
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ ~VectorPostprocessor()

virtual VectorPostprocessor::~VectorPostprocessor ( )
virtualdefault

Member Function Documentation

◆ buildOutputHideVariableList()

void OutputInterface::buildOutputHideVariableList ( std::set< std::string >  variable_names)
inherited

Builds hide lists for output objects NOT listed in the 'outputs' parameter.

Parameters
variable_namesA set of variables for which the 'outputs' parameter controls

By default this is called by the constructor and passes the block name as the list of variables. This needs to be called explicitly if the build_list flag is set to False in the constructor. The latter cases is needed by the Material object to work correctly with the automatic material output capability.

Definition at line 62 of file OutputInterface.C.

Referenced by CheckOutputAction::checkVariableOutput(), and OutputInterface::OutputInterface().

63 {
64  // Set of available names
65  const std::set<OutputName> & avail = _oi_output_warehouse.getOutputNames();
66 
67  // Check for 'none'; hide variables on all outputs
68  if (_oi_outputs.find("none") != _oi_outputs.end())
69  for (const auto & name : avail)
70  _oi_output_warehouse.addInterfaceHideVariables(name, variable_names);
71 
72  // Check for empty and 'all' in 'outputs' parameter; do not perform any variable restrictions in
73  // these cases
74  else if (_oi_outputs.empty() || _oi_outputs.find("all") != _oi_outputs.end())
75  return;
76 
77  // Limit the variable output to Output objects listed
78  else
79  {
80  // Create a list of outputs where the variable should be hidden
81  std::set<OutputName> hide;
82  std::set_difference(avail.begin(),
83  avail.end(),
84  _oi_outputs.begin(),
85  _oi_outputs.end(),
86  std::inserter(hide, hide.begin()));
87 
88  // If 'outputs' is specified add the object name to the list of items to hide
89  for (const auto & name : hide)
90  _oi_output_warehouse.addInterfaceHideVariables(name, variable_names);
91  }
92 }
OutputWarehouse & _oi_output_warehouse
Reference to the OutputWarehouse for populating the Output object hide lists.
std::set< OutputName > _oi_outputs
The set of Output object names listed in the &#39;outputs&#39; parameter.
const std::set< OutputName > & getOutputNames()
Get a complete set of all output object names.
void addInterfaceHideVariables(const std::string &output_name, const std::set< std::string > &variable_names)
Insert variable names for hiding via the OutoutInterface.

◆ containsCompleteHistory()

bool VectorPostprocessor::containsCompleteHistory ( ) const
inline

Return whether or not this VectorPostprocessor contains complete history.

Definition at line 56 of file VectorPostprocessor.h.

Referenced by SamplerBase::initialize().

const bool _contains_complete_history

◆ declareVector()

VectorPostprocessorValue & VectorPostprocessor::declareVector ( const std::string &  vector_name)
protected

Register a new vector to fill up.

Definition at line 57 of file VectorPostprocessor.C.

Referenced by CSVReader::initialize(), StatisticsVectorPostprocessor::initialize(), HistogramVectorPostprocessor::initialize(), LeastSquaresFit::LeastSquaresFit(), LeastSquaresFitHistory::LeastSquaresFitHistory(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), SamplerBase::setupVariables(), and SphericalAverage::SphericalAverage().

58 {
59  if (_vpp_tid)
60  return _thread_local_vectors.emplace(vector_name, VectorPostprocessorValue()).first->second;
61  else
64 }
FEProblemBase * _vpp_fe_problem
Pointer to FEProblemBase.
std::string _vpp_name
The name of the VectorPostprocessor.
const bool _contains_complete_history
std::map< std::string, VectorPostprocessorValue > _thread_local_vectors
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:91
VectorPostprocessorValue & declareVectorPostprocessorVector(const VectorPostprocessorName &name, const std::string &vector_name, bool contains_complete_history, bool is_broadcast)
Declare a new VectorPostprocessor vector.

◆ getOutputs()

const std::set< OutputName > & OutputInterface::getOutputs ( )
inherited

Get the list of output objects that this class is restricted.

Returns
A set of OutputNames

Definition at line 95 of file OutputInterface.C.

96 {
97  return _oi_outputs;
98 }
std::set< OutputName > _oi_outputs
The set of Output object names listed in the &#39;outputs&#39; parameter.

◆ getVector()

VectorPostprocessorValue & VectorPostprocessor::getVector ( const std::string &  vector_name)
virtual

This will get called to actually grab the final value the VectorPostprocessor has calculated.

Definition at line 51 of file VectorPostprocessor.C.

52 {
54 }
FEProblemBase * _vpp_fe_problem
Pointer to FEProblemBase.
std::string _vpp_name
The name of the VectorPostprocessor.
VectorPostprocessorValue & getVectorPostprocessorValue(const VectorPostprocessorName &name, const std::string &vector_name)
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...

◆ PPName()

std::string VectorPostprocessor::PPName ( )
inline

Returns the name of the VectorPostprocessor.

Definition at line 51 of file VectorPostprocessor.h.

51 { return _vpp_name; }
std::string _vpp_name
The name of the VectorPostprocessor.

Friends And Related Function Documentation

◆ SamplerBase

friend class SamplerBase
friend

Definition at line 70 of file VectorPostprocessor.h.

Member Data Documentation

◆ _contains_complete_history

const bool VectorPostprocessor::_contains_complete_history
private

Definition at line 75 of file VectorPostprocessor.h.

Referenced by containsCompleteHistory(), and declareVector().

◆ _is_broadcast

const bool VectorPostprocessor::_is_broadcast
private

Definition at line 77 of file VectorPostprocessor.h.

Referenced by declareVector().

◆ _thread_local_vectors

std::map<std::string, VectorPostprocessorValue> VectorPostprocessor::_thread_local_vectors
private

Definition at line 79 of file VectorPostprocessor.h.

Referenced by declareVector().

◆ _vpp_fe_problem

FEProblemBase* VectorPostprocessor::_vpp_fe_problem
protected

Pointer to FEProblemBase.

Definition at line 68 of file VectorPostprocessor.h.

Referenced by declareVector(), LineValueSampler::getValue(), and getVector().

◆ _vpp_name

std::string VectorPostprocessor::_vpp_name
protected

The name of the VectorPostprocessor.

Definition at line 65 of file VectorPostprocessor.h.

Referenced by declareVector(), LineValueSampler::getValue(), getVector(), and PPName().

◆ _vpp_tid

THREAD_ID VectorPostprocessor::_vpp_tid
private

Definition at line 73 of file VectorPostprocessor.h.

Referenced by declareVector().


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