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...
 
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
 
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 41 of file VectorPostprocessor.h.

Constructor & Destructor Documentation

VectorPostprocessor::VectorPostprocessor ( const InputParameters parameters)

Definition at line 35 of file VectorPostprocessor.C.

36  : OutputInterface(parameters),
37  _vpp_name(MooseUtils::shortName(parameters.get<std::string>("_object_name"))),
38  _vpp_fe_problem(parameters.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
39  _vpp_tid(parameters.isParamValid("_tid") ? parameters.get<THREAD_ID>("_tid") : 0)
40 {
41 }
FEProblemBase * _vpp_fe_problem
Pointer to FEProblemBase.
std::string _vpp_name
The name of the VectorPostprocessor.
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:325
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
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...
unsigned int THREAD_ID
Definition: MooseTypes.h:79
virtual VectorPostprocessor::~VectorPostprocessor ( )
virtualdefault

Member Function Documentation

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 67 of file OutputInterface.C.

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

68 {
69  // Set of available names
70  const std::set<OutputName> & avail = _oi_output_warehouse.getOutputNames();
71 
72  // Check for 'none'; hide variables on all outputs
73  if (_oi_outputs.find("none") != _oi_outputs.end())
74  for (const auto & name : avail)
75  _oi_output_warehouse.addInterfaceHideVariables(name, variable_names);
76 
77  // Check for empty and 'all' in 'outputs' parameter; do not perform any variable restrictions in
78  // these cases
79  else if (_oi_outputs.empty() || _oi_outputs.find("all") != _oi_outputs.end())
80  return;
81 
82  // Limit the variable output to Output objects listed
83  else
84  {
85  // Create a list of outputs where the variable should be hidden
86  std::set<OutputName> hide;
87  std::set_difference(avail.begin(),
88  avail.end(),
89  _oi_outputs.begin(),
90  _oi_outputs.end(),
91  std::inserter(hide, hide.begin()));
92 
93  // If 'outputs' is specified add the object name to the list of items to hide
94  for (const auto & name : hide)
95  _oi_output_warehouse.addInterfaceHideVariables(name, variable_names);
96  }
97 }
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.
VectorPostprocessorValue & VectorPostprocessor::declareVector ( const std::string &  vector_name)
protected

Register a new vector to fill up.

Definition at line 50 of file VectorPostprocessor.C.

Referenced by CSVReader::initialize(), LeastSquaresFit::LeastSquaresFit(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), PPName(), SamplerBase::setupVariables(), and SphericalAverage::SphericalAverage().

51 {
52  if (_vpp_tid)
53  return _thread_local_vectors.emplace(vector_name, VectorPostprocessorValue()).first->second;
54  else
56 }
FEProblemBase * _vpp_fe_problem
Pointer to FEProblemBase.
std::string _vpp_name
The name of the VectorPostprocessor.
VectorPostprocessorValue & declareVectorPostprocessorVector(const VectorPostprocessorName &name, const std::string &vector_name)
Declare a new VectorPostprocessor vector.
std::map< std::string, VectorPostprocessorValue > _thread_local_vectors
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:74
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 100 of file OutputInterface.C.

101 {
102  return _oi_outputs;
103 }
std::set< OutputName > _oi_outputs
The set of Output object names listed in the &#39;outputs&#39; parameter.
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 44 of file VectorPostprocessor.C.

45 {
47 }
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)
Get a reference to the value associated with the VectorPostprocessor.
std::string VectorPostprocessor::PPName ( )
inline

Returns the name of the VectorPostprocessor.

Definition at line 56 of file VectorPostprocessor.h.

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

Friends And Related Function Documentation

friend class SamplerBase
friend

Definition at line 70 of file VectorPostprocessor.h.

Member Data Documentation

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

Definition at line 75 of file VectorPostprocessor.h.

Referenced by declareVector().

FEProblemBase* VectorPostprocessor::_vpp_fe_problem
protected

Pointer to FEProblemBase.

Definition at line 68 of file VectorPostprocessor.h.

Referenced by declareVector(), and getVector().

std::string VectorPostprocessor::_vpp_name
protected

The name of the VectorPostprocessor.

Definition at line 65 of file VectorPostprocessor.h.

Referenced by declareVector(), getVector(), and PPName().

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: