www.mooseframework.org
Function.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 "Function.h"
11 
12 template <>
15 {
17 
18  params.registerBase("Function");
19 
20  return params;
21 }
22 
24  : MooseObject(parameters),
25  SetupInterface(this),
26  TransientInterface(this),
28  UserObjectInterface(this),
29  Restartable(this, "Functions"),
30  MeshChangedInterface(parameters),
31  ScalarCoupleable(this)
32 {
33 }
34 
36 
37 Real
38 Function::value(Real /*t*/, const Point & /*p*/)
39 {
40  return 0.0;
41 }
42 
43 RealGradient
44 Function::gradient(Real /*t*/, const Point & /*p*/)
45 {
46  return RealGradient(0, 0, 0);
47 }
48 
49 Real
50 Function::timeDerivative(Real /*t*/, const Point & /*p*/)
51 {
52  mooseError("timeDerivative method not defined for function ", name());
53  return 0;
54 }
55 
57 Function::vectorValue(Real /*t*/, const Point & /*p*/)
58 {
59  return RealVectorValue(0, 0, 0);
60 }
61 
63 Function::vectorCurl(Real /*t*/, const Point & /*p*/)
64 {
65  return RealVectorValue(0, 0, 0);
66 }
67 
68 Real
70 {
71  mooseError("Integral method not defined for function ", name());
72  return 0;
73 }
74 
75 Real
77 {
78  mooseError("Average method not defined for function ", name());
79  return 0;
80 }
InputParameters validParams< Function >()
Definition: Function.C:14
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:38
A class for creating restricted objects.
Definition: Restartable.h:29
virtual RealGradient gradient(Real t, const Point &p)
Function objects can optionally provide a gradient at a point.
Definition: Function.C:44
VectorValue< Real > RealVectorValue
Definition: Assembly.h:31
virtual Real average()
Definition: Function.C:76
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
Function(const InputParameters &parameters)
Class constructor.
Definition: Function.C:23
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:42
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:50
InputParameters validParams< MooseObject >()
Definition: MooseObject.C:25
virtual RealVectorValue vectorCurl(Real t, const Point &p)
Override this to evaluate the curl of the vector function at a point (t,x,y,z), by default this retur...
Definition: Function.C:63
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:57
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:59
Interface for objects that needs scalar coupling capabilities.
virtual ~Function()
Function destructor.
Definition: Function.C:35
Interface class for classes which interact with Postprocessors.
virtual Real integral()
Definition: Function.C:69