https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MooseParsedGradFunction.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// MOOSE includes
13#include "Function.h"
15
24{
25public:
31
33
38
39 using Function::value;
45 virtual Real value(Real t, const Point & p) const override;
46
53 virtual RealGradient gradient(Real t, const Point & p) const override;
54
59 virtual RealVectorValue vectorValue(Real t, const Point & p) const override;
60
65 virtual void initialSetup() override;
66
67protected:
69 std::string _value;
70
72 std::string _grad_value;
73
75 std::unique_ptr<MooseParsedFunctionWrapper> _grad_function_ptr;
76};
Base class for function objects.
Definition Function.h:30
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:30
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Adds user facing parameters for parsed function.
This class is similar to ParsedFunction except it also supports returning the gradient of the functio...
virtual RealVectorValue vectorValue(Real t, const Point &p) const override
Method invalid for ParsedGradFunction.
virtual ~MooseParsedGradFunction()
Destructor necessary for std::unique_ptr usage.
virtual RealGradient gradient(Real t, const Point &p) const override
Compute the gradient of the function.
std::string _grad_value
String for the gradient, vector function string.
virtual void initialSetup() override
Creates two libMesh::ParsedFunction objects for returning a vector via the 'gradient' method and a sc...
virtual Real value(Real t, const Point &p) const override
Return a scalar value from the function.
static InputParameters validParams()
Class constructor.
std::unique_ptr< MooseParsedFunctionWrapper > _grad_function_ptr
Pointer to the Parsed function wrapper object for the gradient.
std::string _value
String for the scalar function string.