https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FunctionLayeredIntegral.C
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
11
13
16{
17 InputParameters params =
19 params += LayeredBase::validParams();
20 params.addClassDescription("Integrates a function in layers");
21 return params;
22}
23
28
29void
35
36void
38{
39 Real integral_value = computeIntegral();
40
41 unsigned int layer = getLayer(_current_elem->vertex_average());
42
43 setLayerValue(layer, getLayerValue(layer) + integral_value);
44}
45
46void
51
52void
58
59const std::vector<Point>
61{
62 std::vector<Point> points;
63
64 for (const auto & l : _layer_centers)
65 {
66 Point pt(0.0, 0.0, 0.0);
67 pt(_direction) = l;
68 points.push_back(pt);
69 }
70
71 return points;
72}
registerMooseObject("MooseApp", FunctionLayeredIntegral)
const Elem *const & _current_elem
The current element pointer (available during execute())
This user object computes a volume integral of a specified function.
This UserObject computes volume integrals of a function storing partial sums for the specified number...
static InputParameters validParams()
FunctionLayeredIntegral(const InputParameters &parameters)
virtual void threadJoin(const UserObject &y) override
Must override.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual void finalize() override
Finalize.
virtual const std::vector< Point > spatialPoints() const override
Optional interface function for providing the points at which a UserObject attains spatial values.
virtual void execute() override
Execute method.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
This base class computes volume integrals of a variable storing partial sums for the specified number...
Definition LayeredBase.h:37
virtual void threadJoin(const UserObject &y)
virtual Real getLayerValue(unsigned int layer) const
Get the value for a given layer.
virtual unsigned int getLayer(const Point &p) const
Helper function to return the layer the point lies in.
void setLayerValue(unsigned int layer, Real value)
Set the value for a particular layer.
std::vector< Real > _layer_centers
center coordinates of each layer
static InputParameters validParams()
Definition LayeredBase.C:22
unsigned int _direction
The component direction the layers are going in. We cache this for speed (so we're not always going t...
virtual void finalize()
virtual void initialize()
Base class for creating a user object with the SpatialUserObject and Moose::Functor APIs.
static InputParameters validParams()
Base class for user-specific data.
Definition UserObject.h:20