https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
16class FEProblemBase;
17class InputParameters;
18class MooseObject;
19template <typename T>
21
23{
24public:
26
33 VectorPostprocessorInterface(const MooseObject * moose_object, bool broadcast_by_default = false);
34
35#ifdef MOOSE_KOKKOS_ENABLED
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
313protected:
318 virtual void
319 addVectorPostprocessorDependencyHelper(const VectorPostprocessorName & /* name */) const
320 {
321 }
322
323private:
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};
Real ScatterVectorPostprocessorValue
Definition MooseTypes.h:232
unsigned int THREAD_ID
Definition MooseTypes.h:237
std::vector< Real > VectorPostprocessorValue
Definition MooseTypes.h:231
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueByName(const VectorPostprocessorName &name, const std::string &vector_name) const
Return the scatter value for the post processor.
bool hasVectorPostprocessor(const std::string &param_name, const std::string &vector_name) const
Determine if the VectorPostprocessor data exists by parameter.
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...
bool isVectorPostprocessorDistributed(const std::string &param_name) const
Return true if the VectorPostprocessor is marked with parallel_type as DISTRIBUTED.
bool hasVectorPostprocessorByName(const VectorPostprocessorName &name, const std::string &vector_name) const
Determine if the VectorPostprocessor data exists by name.
const FEProblemBase & _vpi_feproblem
Reference the FEProblemBase class.
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.
void possiblyCheckHasVectorPostprocessorByName(const VectorPostprocessorName &name, const std::string &vector_name) const
virtual void addVectorPostprocessorDependencyHelper(const VectorPostprocessorName &) const
Helper for deriving classes to override to add dependencies when a VectorPostprocessor is requested.
void possiblyCheckHasVectorPostprocessor(const std::string &param_name, const std::string &vector_name) const
Helpers for "possibly" checking if a vpp exists.
virtual ~VectorPostprocessorInterface()=default
This class has virtual methods, so it needs a virtual dtor.
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOldByName(const VectorPostprocessorName &name, const std::string &vector_name) const
Return the old scatter value for the post processor.
const VectorPostprocessorName & getVectorPostprocessorName(const std::string &param_name) const
Get the name of a VectorPostprocessor associated with a parameter.
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 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 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.
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper(const VectorPostprocessorName &name, const std::string &vector_name) const
Helper for getting the VPP context that handles scatter values.
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...
bool isVectorPostprocessorDistributedByName(const VectorPostprocessorName &name) const
const bool _broadcast_by_default
Whether or not to force broadcasting by default.
const MooseObject & _vpi_moose_object
The MooseObject that uses this interface.