www.mooseframework.org
VectorPostprocessorInterface.h
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 
10 #pragma once
11 
12 // MOOSE includes
13 #include "MooseTypes.h"
14 
15 // Forward Declarations
16 class FEProblemBase;
17 class InputParameters;
18 class MooseObject;
19 template <typename T>
21 
23 {
24 public:
26 
33  VectorPostprocessorInterface(const MooseObject * moose_object, bool broadcast_by_default = false);
34 
38  virtual ~VectorPostprocessorInterface() = default;
39 
58  getVectorPostprocessorValue(const std::string & param_name,
59  const std::string & vector_name) const;
60 
79  getVectorPostprocessorValueByName(const VectorPostprocessorName & name,
80  const std::string & vector_name) const;
81 
94  getVectorPostprocessorValueOld(const std::string & param_name,
95  const std::string & vector_name) const;
96 
114  getVectorPostprocessorValueOldByName(const VectorPostprocessorName & name,
115  const std::string & vector_name) const;
116 
117  // doco-normal-methods-begin
134  const VectorPostprocessorValue & getVectorPostprocessorValue(const std::string & param_name,
135  const std::string & vector_name,
136  bool needs_broadcast) const;
137  // doco-normal-methods-end
138 
156  getVectorPostprocessorValueByName(const VectorPostprocessorName & name,
157  const std::string & vector_name,
158  bool needs_broadcast) const;
159 
170  const VectorPostprocessorValue & getVectorPostprocessorValueOld(const std::string & param_name,
171  const std::string & vector_name,
172  bool needs_broadcast) const;
173 
190  getVectorPostprocessorValueOldByName(const VectorPostprocessorName & name,
191  const std::string & vector_name,
192  bool needs_broadcast) const;
193 
206  getScatterVectorPostprocessorValue(const std::string & param_name,
207  const std::string & vector_name) const;
208 
221  getScatterVectorPostprocessorValueByName(const VectorPostprocessorName & name,
222  const std::string & vector_name) const;
223 
236  getScatterVectorPostprocessorValueOld(const std::string & param_name,
237  const std::string & vector_name) const;
238 
251  getScatterVectorPostprocessorValueOldByName(const VectorPostprocessorName & name,
252  const std::string & vector_name) const;
253 
262  bool hasVectorPostprocessor(const std::string & param_name,
263  const std::string & vector_name) const;
264 
273  bool hasVectorPostprocessorByName(const VectorPostprocessorName & name,
274  const std::string & vector_name) const;
275 
281  bool hasVectorPostprocessor(const std::string & param_name) const;
282 
288  bool hasVectorPostprocessorByName(const VectorPostprocessorName & name) const;
289 
291 
294  bool isVectorPostprocessorDistributed(const std::string & param_name) const;
295  bool isVectorPostprocessorDistributedByName(const VectorPostprocessorName & name) const;
297 
303  const VectorPostprocessorName & getVectorPostprocessorName(const std::string & param_name) const;
304 
305 protected:
310  virtual void
311  addVectorPostprocessorDependencyHelper(const VectorPostprocessorName & /* name */) const
312  {
313  }
314 
315 private:
320  getVectorPostprocessorByNameHelper(const VectorPostprocessorName & name,
321  const std::string & vector_name,
322  bool broadcast,
323  std::size_t t_index) const;
324 
329  getVectorPostprocessorContextByNameHelper(const VectorPostprocessorName & name,
330  const std::string & vector_name) const;
331 
333 
340  void possiblyCheckHasVectorPostprocessor(const std::string & param_name,
341  const std::string & vector_name) const;
342  void possiblyCheckHasVectorPostprocessorByName(const VectorPostprocessorName & name,
343  const std::string & vector_name) const;
345 
349  bool vectorPostprocessorsAdded() const;
350 
353 
356 
359 
362 };
std::string name(const ElemQuality q)
virtual ~VectorPostprocessorInterface()=default
This class has virtual methods, so it needs a virtual dtor.
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper(const VectorPostprocessorName &name, const std::string &vector_name) const
Helper for getting the VPP context that handles scatter values.
bool hasVectorPostprocessor(const std::string &param_name, const std::string &vector_name) const
Determine if the VectorPostprocessor data exists by parameter.
void possiblyCheckHasVectorPostprocessor(const std::string &param_name, const std::string &vector_name) const
Helpers for "possibly" checking if a vpp exists.
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOldByName(const VectorPostprocessorName &name, const std::string &vector_name) const
Return the old scatter value for the post processor.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
VectorPostprocessorInterface(const MooseObject *moose_object, bool broadcast_by_default=false)
Constructor.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const VectorPostprocessorName & getVectorPostprocessorName(const std::string &param_name) const
Get the name of a VectorPostprocessor associated with a parameter.
bool isVectorPostprocessorDistributedByName(const VectorPostprocessorName &name) const
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName(const VectorPostprocessorName &name, const std::string &vector_name) const
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
const VectorPostprocessorValue & getVectorPostprocessorValue(const std::string &param_name, const std::string &vector_name) const
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
void possiblyCheckHasVectorPostprocessorByName(const VectorPostprocessorName &name, const std::string &vector_name) const
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
const VectorPostprocessorValue & getVectorPostprocessorByNameHelper(const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const
Helper function for extracting VPP data from ReporterData object.
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOld(const std::string &param_name, const std::string &vector_name) const
Return the old scatter value for the post processor.
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValue(const std::string &param_name, const std::string &vector_name) const
Return the scatter value for the post processor.
virtual void addVectorPostprocessorDependencyHelper(const VectorPostprocessorName &) const
Helper for deriving classes to override to add dependencies when a VectorPostprocessor is requested...
bool isVectorPostprocessorDistributed(const std::string &param_name) const
Return true if the VectorPostprocessor is marked with parallel_type as DISTRIBUTED.
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:192
Real ScatterVectorPostprocessorValue
Definition: MooseTypes.h:193
bool hasVectorPostprocessorByName(const VectorPostprocessorName &name, const std::string &vector_name) const
Determine if the VectorPostprocessor data exists by name.
const MooseObject & _vpi_moose_object
The MooseObject that uses this interface.
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueByName(const VectorPostprocessorName &name, const std::string &vector_name) const
Return the scatter value for the post processor.
const VectorPostprocessorValue & getVectorPostprocessorValueByName(const VectorPostprocessorName &name, const std::string &vector_name) const
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
const bool _broadcast_by_default
Whether or not to force broadcasting by default.
const VectorPostprocessorValue & getVectorPostprocessorValueOld(const std::string &param_name, const std::string &vector_name) const
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
const FEProblemBase & _vpi_feproblem
Reference the FEProblemBase class.
unsigned int THREAD_ID
Definition: MooseTypes.h:198