www.mooseframework.org
Function.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 "Function.h"
16 
17 template <>
20 {
22 
23  params.registerBase("Function");
24 
25  return params;
26 }
27 
29  : MooseObject(parameters),
30  SetupInterface(this),
31  TransientInterface(this),
33  UserObjectInterface(this),
34  Restartable(parameters, "Functions"),
35  MeshChangedInterface(parameters),
36  ScalarCoupleable(this)
37 {
38 }
39 
41 
42 Real
43 Function::value(Real /*t*/, const Point & /*p*/)
44 {
45  return 0.0;
46 }
47 
49 Function::gradient(Real /*t*/, const Point & /*p*/)
50 {
51  return RealGradient(0, 0, 0);
52 }
53 
54 Real
55 Function::timeDerivative(Real /*t*/, const Point & /*p*/)
56 {
57  mooseError("timeDerivative method not defined for function ", name());
58  return 0;
59 }
60 
62 Function::vectorValue(Real /*t*/, const Point & /*p*/)
63 {
64  return RealVectorValue(0, 0, 0);
65 }
66 
67 Real
69 {
70  mooseError("Integral method not defined for function ", name());
71  return 0;
72 }
73 
74 Real
76 {
77  mooseError("Average method not defined for function ", name());
78  return 0;
79 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
InputParameters validParams< Function >()
Definition: Function.C:19
RealVectorValue RealGradient
Definition: Assembly.h:43
virtual Real value(Real t, const Point &p)
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
Definition: Function.C:43
A class for creating restricted objects.
Definition: Restartable.h:31
virtual RealGradient gradient(Real t, const Point &p)
Function objects can optionally provide a gradient at a point.
Definition: Function.C:49
VectorValue< Real > RealVectorValue
Definition: Assembly.h:40
virtual Real average()
Definition: Function.C:75
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Function(const InputParameters &parameters)
Class constructor.
Definition: Function.C:28
void registerBase(const std::string &value)
This method must be called from every base "Moose System" to create linkage with the Action System...
Interface for objects that needs transient capabilities.
Interface for notifications that the mesh has changed.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
Interface for objects that need to use UserObjects.
virtual Real timeDerivative(Real t, const Point &p)
Get the time derivative of the function.
Definition: Function.C:55
InputParameters validParams< MooseObject >()
Definition: MooseObject.C:22
virtual RealVectorValue vectorValue(Real t, const Point &p)
Override this to evaluate the vector function at a point (t,x,y,z), by default this returns a zero ve...
Definition: Function.C:62
Interface for objects that needs scalar coupling capabilities.
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
virtual ~Function()
Function destructor.
Definition: Function.C:40
Interface class for classes which interact with Postprocessors.
virtual Real integral()
Definition: Function.C:68