www.mooseframework.org
LayeredIntegral.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 "LayeredIntegral.h"
16 
17 #include "libmesh/mesh_tools.h"
18 
19 template <>
22 {
24  params += validParams<LayeredBase>();
25  return params;
26 }
27 
29  : ElementIntegralVariableUserObject(parameters), LayeredBase(parameters)
30 {
31 }
32 
33 void
35 {
38 }
39 
40 void
42 {
43  Real integral_value = computeIntegral();
44 
45  unsigned int layer = getLayer(_current_elem->centroid());
46 
47  setLayerValue(layer, getLayerValue(layer) + integral_value);
48 }
49 
50 void
52 {
54 }
55 
56 void
58 {
61 }
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
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...
InputParameters validParams< LayeredIntegral >()
virtual void threadJoin(const UserObject &y)
Definition: LayeredBase.C:254
virtual Real getLayerValue(unsigned int layer) const
Get the value for a given layer.
Definition: LayeredBase.C:218
virtual void execute() override
Execute method.
virtual void initialize() override
InputParameters validParams< ElementIntegralVariableUserObject >()
void setLayerValue(unsigned int layer, Real value)
Set the value for a particular layer.
Definition: LayeredBase.C:303
virtual void initialize()
Definition: LayeredBase.C:226
virtual void finalize()
Definition: LayeredBase.C:236
const Elem *& _current_elem
The current element pointer (available during execute())
InputParameters validParams< LayeredBase >()
Definition: LayeredBase.C:28
This UserObject computes volume integrals of a variable storing partial sums for the specified number...
Definition: LayeredBase.h:44
virtual void threadJoin(const UserObject &y) override
This postprocessor computes a volume integral of the specified variable.
LayeredIntegral(const InputParameters &parameters)
Base class for user-specific data.
Definition: UserObject.h:42
virtual void threadJoin(const UserObject &y) override
Must override.
virtual void finalize() override