www.mooseframework.org
StochasticResults.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
15 
20 {
21  StochasticResultsData(const VectorPostprocessorName & name, VectorPostprocessorValue *);
22  VectorPostprocessorName name;
25 };
26 
31 {
32 public:
34 
36  virtual void initialize() override;
37  virtual void finalize() override;
38  virtual void execute() override {}
39 
40  // This method is used by the Transfers for populating data within the vectors for this VPP; this
41  // is required to allow for the "contains_complete_history = true" to operate correctly with the
42  // different modes of parallel operation, without the Transfer objects needing knowledge of the
43  // modes.
44  //
45  // In practice, the Transfer objects are responsible for populating the vector that contains the
46  // current data from sub-application for this local process. This object then handles the
47  // communication and updating of the actual VPP data being mindfull of the
48  // "contains_complete_history". An r-value reference is used by this object to take ownership of
49  // the data to avoid unnecessary copying, because the supplied data can be very large.
50  //
51  // For an example use, please refer to SamplerPostprocessorTransfer.
52  //
53  // @param vector_name: name of the vector to populated, should be the name of the sampler.
54  // @paran current: current local VPP data from sub-applications (see SamplerPostprocessorTranfer)
55  void setCurrentLocalVectorPostprocessorValue(const std::string & vector_name,
56  const VectorPostprocessorValue && current);
57 
58 protected:
60  std::vector<StochasticResultsData> _sample_vectors;
61 
66  void initVector(const std::string & vector_name);
67  friend void StochasticResultsAction::act();
68 };
static InputParameters validParams()
std::vector< StochasticResultsData > _sample_vectors
Storage for declared vectors.
StochasticResults(const InputParameters &parameters)
virtual void act() override
Storage helper for managing data being assigned to this VPP by a Transfer object. ...
virtual void finalize() override
VectorPostprocessorName name
VectorPostprocessorValue current
A tool for output Sampler data.
void initVector(const std::string &vector_name)
Create a VPP vector for results data for a given Sampler, see StochasticResultsAction for more detail...
void setCurrentLocalVectorPostprocessorValue(const std::string &vector_name, const VectorPostprocessorValue &&current)
StochasticResultsData(const VectorPostprocessorName &name, VectorPostprocessorValue *)
virtual void execute() override
virtual void initialize() override
std::vector< Real > VectorPostprocessorValue
const InputParameters & parameters() const
VectorPostprocessorValue * vector