www.mooseframework.org
VectorPostprocessor.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 "VectorPostprocessor.h"
17 #include "SubProblem.h"
18 #include "Conversion.h"
19 #include "UserObject.h"
21 #include "FEProblem.h"
22 
23 template <>
26 {
28  params += validParams<OutputInterface>();
29 
30  params.addParamNamesToGroup("outputs", "Advanced");
31  params.registerBase("VectorPostprocessor");
32  return params;
33 }
34 
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 }
42 
44 VectorPostprocessor::getVector(const std::string & vector_name)
45 {
47 }
48 
50 VectorPostprocessor::declareVector(const std::string & vector_name)
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.
InputParameters validParams< OutputInterface >()
A class to provide an common interface to objects requiring "outputs" option.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual VectorPostprocessorValue & getVector(const std::string &vector_name)
This will get called to actually grab the final value the VectorPostprocessor has calculated...
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:325
InputParameters validParams< UserObject >()
Definition: UserObject.C:23
VectorPostprocessorValue & declareVectorPostprocessorVector(const VectorPostprocessorName &name, const std::string &vector_name)
Declare a new VectorPostprocessor vector.
InputParameters validParams< VectorPostprocessor >()
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.
VectorPostprocessor(const InputParameters &parameters)
std::map< std::string, VectorPostprocessorValue > _thread_local_vectors
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:74
VectorPostprocessorValue & getVectorPostprocessorValue(const VectorPostprocessorName &name, const std::string &vector_name)
Get a reference to the value associated with the VectorPostprocessor.
unsigned int THREAD_ID
Definition: MooseTypes.h:79
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...