https://mooseframework.inl.gov
VectorPostprocessorInterface.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
35 #ifdef MOOSE_KOKKOS_ENABLED
36 
40  const Moose::Kokkos::FunctorCopy & key);
41 #endif
42 
46  virtual ~VectorPostprocessorInterface() = default;
47 
66  getVectorPostprocessorValue(const std::string & param_name,
67  const std::string & vector_name) const;
68 
87  getVectorPostprocessorValueByName(const VectorPostprocessorName & name,
88  const std::string & vector_name) const;
89 
102  getVectorPostprocessorValueOld(const std::string & param_name,
103  const std::string & vector_name) const;
104 
122  getVectorPostprocessorValueOldByName(const VectorPostprocessorName & name,
123  const std::string & vector_name) const;
124 
125  // doco-normal-methods-begin
142  const VectorPostprocessorValue & getVectorPostprocessorValue(const std::string & param_name,
143  const std::string & vector_name,
144  bool needs_broadcast) const;
145  // doco-normal-methods-end
146 
164  getVectorPostprocessorValueByName(const VectorPostprocessorName & name,
165  const std::string & vector_name,
166  bool needs_broadcast) const;
167 
178  const VectorPostprocessorValue & getVectorPostprocessorValueOld(const std::string & param_name,
179  const std::string & vector_name,
180  bool needs_broadcast) const;
181 
198  getVectorPostprocessorValueOldByName(const VectorPostprocessorName & name,
199  const std::string & vector_name,
200  bool needs_broadcast) const;
201 
214  getScatterVectorPostprocessorValue(const std::string & param_name,
215  const std::string & vector_name) const;
216 
229  getScatterVectorPostprocessorValueByName(const VectorPostprocessorName & name,
230  const std::string & vector_name) const;
231 
244  getScatterVectorPostprocessorValueOld(const std::string & param_name,
245  const std::string & vector_name) const;
246 
259  getScatterVectorPostprocessorValueOldByName(const VectorPostprocessorName & name,
260  const std::string & vector_name) const;
261 
270  bool hasVectorPostprocessor(const std::string & param_name,
271  const std::string & vector_name) const;
272 
281  bool hasVectorPostprocessorByName(const VectorPostprocessorName & name,
282  const std::string & vector_name) const;
283 
289  bool hasVectorPostprocessor(const std::string & param_name) const;
290 
296  bool hasVectorPostprocessorByName(const VectorPostprocessorName & name) const;
297 
299 
302  bool isVectorPostprocessorDistributed(const std::string & param_name) const;
303  bool isVectorPostprocessorDistributedByName(const VectorPostprocessorName & name) const;
305 
311  const VectorPostprocessorName & getVectorPostprocessorName(const std::string & param_name) const;
312 
313 protected:
318  virtual void
319  addVectorPostprocessorDependencyHelper(const VectorPostprocessorName & /* name */) const
320  {
321  }
322 
323 private:
328  getVectorPostprocessorByNameHelper(const VectorPostprocessorName & name,
329  const std::string & vector_name,
330  bool broadcast,
331  std::size_t t_index) const;
332 
337  getVectorPostprocessorContextByNameHelper(const VectorPostprocessorName & name,
338  const std::string & vector_name) const;
339 
341 
348  void possiblyCheckHasVectorPostprocessor(const std::string & param_name,
349  const std::string & vector_name) const;
350  void possiblyCheckHasVectorPostprocessorByName(const VectorPostprocessorName & name,
351  const std::string & vector_name) const;
353 
357  bool vectorPostprocessorsAdded() const;
358 
361 
364 
367 
370 };
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:27
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:203
Real ScatterVectorPostprocessorValue
Definition: MooseTypes.h:204
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:209