https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SpatialAverageBase.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
13
19{
20public:
22
24
25 virtual void initialize() override;
26 virtual void execute() override;
27 virtual void finalize() override;
28 virtual void threadJoin(const UserObject & y) override;
29
30protected:
32 virtual Real computeDistance() = 0;
33
35 const unsigned int _nbins;
36
38 const Real _radius;
39
41 const Point _origin;
42
44 const Real _deltaR;
45
47 const unsigned int _nvals;
48
50 const std::vector<const VariableValue *> _values;
51
53 unsigned int _qp;
54
56 const Real _empty_bin_value;
57
60
62 std::vector<unsigned int> _counts;
63
65 std::vector<VectorPostprocessorValue *> _average;
66};
std::vector< Real > VectorPostprocessorValue
Definition MooseTypes.h:231
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Base clase for computing spatial average of a variable over simple spatial regions of the computation...
static InputParameters validParams()
const std::vector< const VariableValue * > _values
coupled variable that is being binned
const unsigned int _nvals
number of coupled variables
std::vector< VectorPostprocessorValue * > _average
aggregated global average vectors
const Point _origin
origin of sphere [or other body]
virtual void threadJoin(const UserObject &y) override
Must override.
std::vector< unsigned int > _counts
sample count per bin
const Real _deltaR
bin width
virtual Real computeDistance()=0
compute the distance of the current quadarature point for binning
const unsigned int _nbins
number of histogram bins
const Real _radius
maximum variable value
unsigned int _qp
current quadrature point - used in computeVolume()
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
const Real _empty_bin_value
value to assign to empty bins
VectorPostprocessorValue & _bin_center
value mid point of the bin
virtual void finalize() override
Finalize.
virtual void execute() override
Execute method.
Base class for user-specific data.
Definition UserObject.h:20