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
10 #include "FunctionIC.h"
11 #include "Function.h"
13 registerMooseObject("MooseApp", FunctionIC);
15 template <>
18 {
19  InputParameters params = validParams<InitialCondition>();
20  params.addRequiredParam<FunctionName>("function", "The initial condition function.");
22  params.addClassDescription("An initial condition that uses a normal function of x, y, z to "
23  "produce values (and optionally gradients) for a field variable.");
24  return params;
25 }
28  : InitialCondition(parameters), _func(getFunction("function"))
29 {
30 }
32 Real
33 FunctionIC::value(const Point & p)
34 {
35  return _func.value(_t, p);
36 }
38 RealGradient
39 FunctionIC::gradient(const Point & p)
40 {
41  return _func.gradient(_t, p);
42 }
Defines a boundary condition that forces the value to be a user specified function at the boundary...
Definition: FunctionIC.h:31
virtual RealGradient gradient(const Point &p) override
The value of the gradient at a point.
Definition: FunctionIC.C:39
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
virtual RealGradient gradient(Real t, const Point &p)
Function objects can optionally provide a gradient at a point.
Definition: Function.C:44
registerMooseObject("MooseApp", FunctionIC)
InputParameters validParams< FunctionIC >()
Definition: FunctionIC.C:17
This is a template class that implements the workhorse compute and computeNodal methods.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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 value(const Point &p) override
The value of the variable at a point.
Definition: FunctionIC.C:33
FunctionIC(const InputParameters &parameters)
Definition: FunctionIC.C:27
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
Function & _func
Definition: FunctionIC.h:52