https://mooseframework.inl.gov
ConstantFunction.h
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 
10 #pragma once
11 
12 #include "Function.h"
13 
17 class ConstantFunction : public Function
18 {
19 public:
21 
23 
24  using Function::value;
25  virtual Real value(Real t, const Point & p) const override;
26  virtual ADReal value(const ADReal & t, const ADPoint & p) const override;
27 
28  virtual Real timeDerivative(Real t, const Point & p) const override;
29  virtual RealVectorValue gradient(Real t, const Point & p) const override;
30 
31  virtual Real timeIntegral(Real t1, Real t2, const Point & p) const override;
32 
33 protected:
34  const Real & _value;
35 };
const Real & _value
Class that represents constant function.
virtual Real timeIntegral(Real t1, Real t2, const Point &p) const override
Computes the time integral at a spatial point between two time values.
Base class for function objects.
Definition: Function.h:36
virtual Real value(Real t, const Point &p) const override
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
ConstantFunction(const InputParameters &parameters)
virtual Real timeDerivative(Real t, const Point &p) const override
Get the time derivative of the function.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:47
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const InputParameters & parameters() const
Get the parameters of the object.
virtual Real value(Real t, const Point &p) const
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
Definition: Function.C:44
static InputParameters validParams()
virtual RealVectorValue gradient(Real t, const Point &p) const override
Function objects can optionally provide a gradient at a point.