www.mooseframework.org
LayeredSideAverage.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 "LayeredSideAverage.h"
16 
17 template <>
20 {
22 
23  return params;
24 }
25 
27  : LayeredSideIntegral(parameters)
28 {
30 }
31 
32 void
34 {
36 
37  for (auto & vol : _layer_volumes)
38  vol = 0.0;
39 }
40 
41 void
43 {
45 
46  unsigned int layer = getLayer(_current_elem->centroid());
48 }
49 
50 void
52 {
54 
56 
57  // Compute the average for each layer
58  for (unsigned int i = 0; i < _layer_volumes.size(); i++)
59  if (layerHasValue(i))
61 }
62 
63 void
65 {
67  const LayeredSideAverage & lsa = static_cast<const LayeredSideAverage &>(y);
68  for (unsigned int i = 0; i < _layer_volumes.size(); i++)
69  if (lsa.layerHasValue(i))
70  _layer_volumes[i] += lsa._layer_volumes[i];
71 }
virtual void execute() override
Execute method.
virtual void initialize() override
bool layerHasValue(unsigned int layer) const
Whether or not a layer has a value.
Definition: LayeredBase.h:85
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...
std::vector< Real > _layer_volumes
Value of the volume for each layer.
This UserObject computes side averages of a variable storing partial sums for the specified number of...
InputParameters validParams< LayeredSideAverage >()
virtual void finalize() override
virtual Real getLayerValue(unsigned int layer) const
Get the value for a given layer.
Definition: LayeredBase.C:218
const Real & _current_side_volume
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 finalize() override
unsigned int _num_layers
Number of layers to split the mesh into.
Definition: LayeredBase.h:103
virtual void execute() override
Execute method.
virtual void threadJoin(const UserObject &y) override
LayeredSideAverage(const InputParameters &parameters)
This UserObject computes volume integrals of a variable storing partial sums for the specified number...
const Elem *& _current_elem
virtual void threadJoin(const UserObject &y) override
virtual void initialize() override
Base class for user-specific data.
Definition: UserObject.h:42
InputParameters validParams< LayeredSideIntegral >()