https://mooseframework.inl.gov
Loading...
Searching...
No Matches
VectorPostprocessor.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#include "OutputInterface.h"
15#include "MooseEnum.h"
16#include "ReporterContext.h"
18
19// libMesh
20#include "libmesh/parallel.h"
21
22// Forward declarations
23class FEProblemBase;
24class InputParameters;
25class SamplerBase;
26class VectorPostprocessorData;
27
28template <typename T>
30
35{
36public:
38
39 VectorPostprocessor(const MooseObject * moose_object);
40
41 virtual ~VectorPostprocessor() = default;
42
43#ifdef MOOSE_KOKKOS_ENABLED
48#endif
49
53 std::string PPName() const { return _vpp_name; }
54
59
63 bool isDistributed() const { return _is_distributed; }
64
68 const std::set<std::string> & getVectorNames() const;
69
70protected:
74 VectorPostprocessorValue & declareVector(const std::string & vector_name);
75
77 const std::string _vpp_name;
78
81
84
85 friend class SamplerBase;
86
87private:
89
91
93
94 const bool _is_distributed;
95
96 const bool _is_broadcast;
97
98 std::map<std::string, VectorPostprocessorValue> _thread_local_vectors;
99
100 std::set<std::string> _vector_names;
101};
102
104// The following items were created to maintain the various getScatter methods in the
105// VectorPostprocessorInterface.
106
107// Special consumer module add
109
110/*
111 * Special ReporterContext that performs a scatter operation if a getScatter method is called on the
112 * VPP value.
113 *
114 * The source file contains an explicit instantiation.
115 * @see VectorPostprocessorInterface
116 */
117template <typename T>
Real ScatterVectorPostprocessorValue
Definition MooseTypes.h:232
unsigned int THREAD_ID
Definition MooseTypes.h:237
std::vector< Real > VectorPostprocessorValue
Definition MooseTypes.h:231
const ReporterMode REPORTER_MODE_VPP_SCATTER
InputParameters validParams()
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.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
An interface for accessing Moose::Functors for systems that do not care about automatic differentiati...
A class to provide an common interface to objects requiring "outputs" option.
const ReporterState< T > & state() const
Return a reference to the ReporterState object that is storing the Reporter value.
MooseEnumItem that automatically creates the ID and doesn't allow the ID to be assigned.
A special version of RestartableData to aid in storing Reporter values.
Base class for VectorPostprocessors that need to do "sampling" of values in the domain.
Definition SamplerBase.h:38
const ScatterVectorPostprocessorValue & getScatterValueOld() const
virtual void copyValuesBack() override
Called by FEProblemBase::advanceState via ReporterData.
const ScatterVectorPostprocessorValue & getScatterValue() const
ScatterVectorPostprocessorValue _scatter_value_old
virtual void finalize() override
Perform automatic parallel communication based on the producer/consumer modes.
ScatterVectorPostprocessorValue _scatter_value
Base class for Postprocessors that produce a vector of values.
const MooseObject & _vpp_moose_object
std::set< std::string > _vector_names
std::map< std::string, VectorPostprocessorValue > _thread_local_vectors
bool isDistributed() const
Return true if the VPP is operating in distributed mode.
std::string PPName() const
Returns the name of the VectorPostprocessor.
virtual ~VectorPostprocessor()=default
bool containsCompleteHistory() const
Return whether or not this VectorPostprocessor contains complete history.
const MooseEnum & _parallel_type
DISTRIBUTED or REPLICATED.
const std::set< std::string > & getVectorNames() const
Return the names of the vectors associated with this object.
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.
FEProblemBase & _vpp_fe_problem
The FEProblemBase.
const std::string _vpp_name
The name of the VectorPostprocessor.
static InputParameters validParams()
const bool _contains_complete_history