www.mooseframework.org
LayeredSideIntegral.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "LayeredSideIntegral.h"
11 
13 
14 template <>
17 {
19  params += validParams<LayeredBase>();
20  return params;
21 }
22 
24  : SideIntegralVariableUserObject(parameters), LayeredBase(parameters)
25 {
26  if (parameters.isParamValid("block") && parameters.isParamValid("boundary"))
27  mooseError("Both block and boundary cannot be specified in LayeredSideIntegral. If you want to "
28  "define the geometric bounds of the layers from a specified block set "
29  "layer_bounding_block instead.");
30 }
31 
32 void
34 {
37 }
38 
39 void
41 {
42  Real integral_value = computeIntegral();
43 
44  unsigned int layer = getLayer(_current_elem->centroid());
45 
46  setLayerValue(layer, getLayerValue(layer) + integral_value);
47 }
48 
49 void
51 {
53 }
54 
55 void
57 {
60 }
LayeredSideIntegral(const InputParameters &parameters)
virtual void execute() override
Execute method.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
virtual void threadJoin(const UserObject &y)
Definition: LayeredBase.C:274
virtual void finalize() override
registerMooseObject("MooseApp", LayeredSideIntegral)
InputParameters validParams< LayeredSideIntegral >()
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
virtual Real getLayerValue(unsigned int layer) const
Get the value for a given layer.
Definition: LayeredBase.C:235
void setLayerValue(unsigned int layer, Real value)
Set the value for a particular layer.
Definition: LayeredBase.C:323
virtual void initialize()
Definition: LayeredBase.C:243
virtual void finalize()
Definition: LayeredBase.C:256
InputParameters validParams< LayeredBase >()
Definition: LayeredBase.C:23
virtual unsigned int getLayer(Point p) const
Helper function to return the layer the point lies in.
Definition: LayeredBase.C:283
This UserObject (????? this isn&#39;t a userobject) computes volume integrals of a variable storing parti...
Definition: LayeredBase.h:40
This UserObject computes volume integrals of a variable storing partial sums for the specified number...
const Elem *const & _current_elem
virtual void threadJoin(const UserObject &y) override
virtual void initialize() override
InputParameters validParams< SideIntegralVariableUserObject >()
virtual void threadJoin(const UserObject &y) override
Must override.
Base class for user-specific data.
Definition: UserObject.h:37
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
This postprocessor computes a volume integral of the specified variable.