www.mooseframework.org
LayeredAverage.C
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 #include "LayeredAverage.h"
16 
17 template <>
20 {
22 
23  return params;
24 }
25 
27 {
29 }
30 
31 void
33 {
35 
36  for (auto & vol : _layer_volumes)
37  vol = 0.0;
38 }
39 
40 void
42 {
44 
45  unsigned int layer = getLayer(_current_elem->centroid());
47 }
48 
49 void
51 {
53 
55 
56  // Compute the average for each layer
57  for (unsigned int i = 0; i < _layer_volumes.size(); i++)
58  if (layerHasValue(i))
60 }
61 
62 void
64 {
66  const LayeredAverage & la = static_cast<const LayeredAverage &>(y);
67  for (unsigned int i = 0; i < _layer_volumes.size(); i++)
68  _layer_volumes[i] += la._layer_volumes[i];
69 }
virtual void execute() override
Execute method.
This UserObject computes volume integrals of a variable storing partial sums for the specified number...
bool layerHasValue(unsigned int layer) const
Whether or not a layer has a value.
Definition: LayeredBase.h:85
InputParameters validParams< LayeredIntegral >()
LayeredAverage(const InputParameters &parameters)
virtual unsigned int getLayer(Point p) const
Helper function to return the layer the point lies in.
Definition: LayeredBase.C:263
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void initialize() override
const Real & _current_elem_volume
The current element volume (available during execute())
std::vector< Real > _layer_volumes
Value of the volume for each layer.
virtual Real getLayerValue(unsigned int layer) const
Get the value for a given layer.
Definition: LayeredBase.C:218
This UserObject computes averages of a variable storing partial sums for the specified number of inte...
virtual void execute() override
Execute method.
virtual void initialize() override
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition: UserObject.h:119
void setLayerValue(unsigned int layer, Real value)
Set the value for a particular layer.
Definition: LayeredBase.C:303
virtual void threadJoin(const UserObject &y) override
unsigned int _num_layers
Number of layers to split the mesh into.
Definition: LayeredBase.h:103
const Elem *& _current_elem
The current element pointer (available during execute())
InputParameters validParams< LayeredAverage >()
virtual void threadJoin(const UserObject &y) override
virtual void finalize() override
Base class for user-specific data.
Definition: UserObject.h:42
virtual void finalize() override