www.mooseframework.org
VectorPostprocessorInterface.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
11 #include "FEProblem.h"
12 #include "VectorPostprocessor.h"
13 #include "MooseTypes.h"
14 
16  bool broadcast_by_default)
17  : _broadcast_by_default(broadcast_by_default),
18  _vpi_params(moose_object->parameters()),
19  _vpi_feproblem(*_vpi_params.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
20  _vpi_tid(_vpi_params.have_parameter<THREAD_ID>("_tid") ? _vpi_params.get<THREAD_ID>("_tid") : 0)
21 {
22 }
23 
26  const std::string & vector_name)
27 {
29  _vpi_params.get<VectorPostprocessorName>(name), vector_name, _broadcast_by_default);
30 }
31 
34  const VectorPostprocessorName & name, const std::string & vector_name)
35 {
37 }
38 
41  const std::string & vector_name)
42 {
44  _vpi_params.get<VectorPostprocessorName>(name), vector_name, _broadcast_by_default);
45 }
46 
49  const VectorPostprocessorName & name, const std::string & vector_name)
50 {
52 }
53 
56  const std::string & vector_name,
57  bool needs_broadcast)
58 {
59  return _vpi_feproblem.getVectorPostprocessorValue(_vpi_params.get<VectorPostprocessorName>(name),
60  vector_name,
61  needs_broadcast || _broadcast_by_default);
62 }
63 
66  const VectorPostprocessorName & name, const std::string & vector_name, bool needs_broadcast)
67 {
69  name, vector_name, needs_broadcast || _broadcast_by_default);
70 }
71 
74  const std::string & vector_name,
75  bool needs_broadcast)
76 {
78  _vpi_params.get<VectorPostprocessorName>(name),
79  vector_name,
80  needs_broadcast || _broadcast_by_default);
81 }
82 
85  const VectorPostprocessorName & name, const std::string & vector_name, bool needs_broadcast)
86 {
88  name, vector_name, needs_broadcast || _broadcast_by_default);
89 }
90 
93  const std::string & vector_name)
94 {
96  _vpi_params.get<VectorPostprocessorName>(name), vector_name);
97 }
98 
101  const std::string & name, const std::string & vector_name)
102 {
103  return _vpi_feproblem.getScatterVectorPostprocessorValue(name, vector_name);
104 }
105 
108  const std::string & vector_name)
109 {
111  _vpi_params.get<VectorPostprocessorName>(name), vector_name);
112 }
113 
116  const std::string & name, const std::string & vector_name)
117 {
118  return _vpi_feproblem.getScatterVectorPostprocessorValueOld(name, vector_name);
119 }
120 
121 bool
123 {
124  return _vpi_feproblem.hasVectorPostprocessor(_vpi_params.get<VectorPostprocessorName>(name));
125 }
126 
127 bool
129  const VectorPostprocessorName & name) const
130 {
132 }
virtual const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValue(const std::string &name, const std::string &vector_name)
Return the scatter value for the post processor.
virtual const VectorPostprocessorValue & getVectorPostprocessorValueByName(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...
ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValue(const VectorPostprocessorName &vpp_name, const std::string &vector_name)
Return the scatter value for the post processor.
FEProblemBase & _vpi_feproblem
Reference the the FEProblemBase class.
bool hasVectorPostprocessor(const std::string &name)
Check existence of the VectorPostprocessor.
VectorPostprocessorInterface(const MooseObject *moose_object, bool broadcast_by_default=false)
Constructor.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOldByName(const std::string &name, const std::string &vector_name)
Return the old scatter value for the post processor.
ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOld(const VectorPostprocessorName &vpp_name, const std::string &vector_name)
Return the scatter value for the post processor.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
bool _broadcast_by_default
Whether or not to force broadcasting by default.
bool hasVectorPostprocessorByName(const VectorPostprocessorName &name) const
Determine if the VectorPostprocessor exists.
const VectorPostprocessorValue & getVectorPostprocessorValueOld(const std::string &name, const std::string &vector_name)
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
const InputParameters & _vpi_params
VectorPostprocessorInterface Parameters.
VectorPostprocessorValue & getVectorPostprocessorValueOld(const std::string &name, const std::string &vector_name)
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
virtual const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueByName(const std::string &name, const std::string &vector_name)
Return the scatter value for the post processor.
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:155
Real ScatterVectorPostprocessorValue
Definition: MooseTypes.h:156
bool hasVectorPostprocessor(const std::string &name) const
Determine if the VectorPostprocessor exists.
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...
virtual const VectorPostprocessorValue & getVectorPostprocessorValue(const std::string &name, const std::string &vector_name)
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
virtual const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOld(const std::string &name, const std::string &vector_name)
Return the old scatter value for the post processor.
unsigned int THREAD_ID
Definition: MooseTypes.h:161
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName(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...