www.mooseframework.org
SamplerBase.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef SAMPLERBASE_H
16 #define SAMPLERBASE_H
17 
18 // MOOSE includes
19 #include "MooseTypes.h"
20 
21 // Forward Declarations
22 class InputParameters;
23 class SamplerBase;
25 
26 namespace libMesh
27 {
28 class Point;
29 
30 namespace Parallel
31 {
32 class Communicator;
33 }
34 }
35 
36 template <typename T>
38 
39 template <>
41 
47 {
48 public:
54  SamplerBase(const InputParameters & parameters,
55  VectorPostprocessor * vpp,
56  const libMesh::Parallel::Communicator & comm);
57  virtual ~SamplerBase() = default;
58 
59 protected:
67  void setupVariables(const std::vector<std::string> & variable_names);
68 
75  virtual void addSample(const Point & p, const Real & id, const std::vector<Real> & values);
76 
82  virtual void initialize();
83 
89  virtual void finalize();
90 
99  virtual void threadJoin(const SamplerBase & y);
100 
103 
106 
108  const libMesh::Parallel::Communicator & _comm;
109 
111  std::vector<std::string> _variable_names;
112 
114  const unsigned int _sort_by;
115 
122 
125 
126  std::vector<VectorPostprocessorValue *> _values;
127 };
128 
129 #endif
Base class for VectorPostprocessors that need to do "sampling" of values in the domain.
Definition: SamplerBase.h:46
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< std::string > _variable_names
The variable names.
Definition: SamplerBase.h:111
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
VectorPostprocessorValue & _y
y coordinate of the points
Definition: SamplerBase.h:119
const unsigned int _sort_by
What to sort by.
Definition: SamplerBase.h:114
std::vector< VectorPostprocessorValue * > _values
Definition: SamplerBase.h:126
VectorPostprocessor * _vpp
The child VectorPostprocessor.
Definition: SamplerBase.h:105
VectorPostprocessorValue & _x
x coordinate of the points
Definition: SamplerBase.h:117
const InputParameters & _sampler_params
The child params.
Definition: SamplerBase.h:102
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:74
VectorPostprocessorValue & _id
The node ID of each point.
Definition: SamplerBase.h:124
InputParameters validParams()
InputParameters validParams< SamplerBase >()
Definition: SamplerBase.C:26
MPI_Comm comm
VectorPostprocessorValue & _z
x coordinate of the points
Definition: SamplerBase.h:121
const libMesh::Parallel::Communicator & _comm
The communicator of the child.
Definition: SamplerBase.h:108
Base class for Postprocessors that produce a vector of values.