www.mooseframework.org
SpatialUserObjectAux.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 "SpatialUserObjectAux.h"
16 #include "UserObject.h"
17 
18 template <>
21 {
23  params.addRequiredParam<UserObjectName>(
24  "user_object",
25  "The UserObject UserObject to get values from. Note that the UserObject "
26  "_must_ implement the spatialValue() virtual function!");
27  return params;
28 }
29 
31  : AuxKernel(parameters), _user_object(getUserObjectBase("user_object"))
32 {
33 }
34 
35 Real
37 {
38  if (isNodal())
40  else
41  return _user_object.spatialValue(_current_elem->centroid());
42 }
const Elem *& _current_elem
Current element (valid only for elemental kernels)
Definition: AuxKernel.h:176
InputParameters validParams< SpatialUserObjectAux >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const UserObject & _user_object
UserObject to be queried for a value.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
virtual Real computeValue() override
InputParameters validParams< AuxKernel >()
Definition: AuxKernel.C:30
const Node *& _current_node
Current node (valid only for nodal kernels)
Definition: AuxKernel.h:186
bool isNodal()
Nodal or elemental kernel?
Definition: AuxKernel.h:89
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:51
SpatialUserObjectAux(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
virtual Real spatialValue(const Point &) const
Optional interface function for "evaluating" a UserObject at a spatial position.
Definition: UserObject.h:99