Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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 
26 {
27 }
28 
29 void
31 {
34 }
35 
36 void
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 
46 void
48 {
50 }
51 
52 void
54 {
57 }
58 
59 const 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 }
FunctionLayeredIntegral(const InputParameters &parameters)
virtual void threadJoin(const UserObject &y) override
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
Definition: LayeredBase.C:22
std::vector< Real > _layer_centers
center coordinates of each layer
Definition: LayeredBase.h:133
virtual void initialize() override
virtual void threadJoin(const UserObject &y)
Definition: LayeredBase.C:339
unsigned int _direction
The component direction the layers are going in. We cache this for speed (so we&#39;re not always going t...
Definition: LayeredBase.h:112
virtual const std::vector< Point > spatialPoints() const override
Optional interface function for providing the points at which a UserObject attains spatial values...
virtual void finalize() override
virtual Real getLayerValue(unsigned int layer) const
Get the value for a given layer.
Definition: LayeredBase.C:293
void setLayerValue(unsigned int layer, Real value)
Set the value for a particular layer.
Definition: LayeredBase.C:407
virtual unsigned int getLayer(const Point &p) const
Helper function to return the layer the point lies in.
Definition: LayeredBase.C:348
virtual void initialize()
Definition: LayeredBase.C:301
This user object computes a volume integral of a specified function.
virtual void finalize()
Definition: LayeredBase.C:314
registerMooseObject("MooseApp", FunctionLayeredIntegral)
This UserObject computes volume integrals of a function storing partial sums for the specified number...
virtual void execute() override
Execute method.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Elem *const & _current_elem
The current element pointer (available during execute())
This base class computes volume integrals of a variable storing partial sums for the specified number...
Definition: LayeredBase.h:36
Base class for creating a user object with the SpatialUserObject and Moose::Functor APIs...
static InputParameters validParams()
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...
static InputParameters validParams()
Base class for user-specific data.
Definition: UserObject.h:39