Loading [MathJax]/jax/output/HTML-CSS/config.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
FVFunctionIC.C
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 #include "FVFunctionIC.h"
11 #include "Function.h"
12 
14 
17 {
19  params.addRequiredParam<FunctionName>("function", "The initial condition function.");
20 
21  params.addClassDescription("An initial condition that uses a normal function of x, y, z to "
22  "produce values (and optionally gradients) for a field variable.");
23  params.addParam<Real>("scaling_factor", 1, "Scaling factor to apply on the function");
24 
25  return params;
26 }
27 
29  : FVInitialCondition(parameters),
30  _func(getFunction("function")),
31  _scaling(getParam<Real>("scaling_factor"))
32 {
33 }
34 
35 Real
36 FVFunctionIC::value(const Point & p)
37 {
38  return _scaling * _func.value(_t, p);
39 }
40 
41 const FunctionName
43 {
44  return _func.name();
45 }
const Function & _func
Function to evaluate to form the initial condition.
Definition: FVFunctionIC.h:50
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real value(const Point &p) override
The value of the variable at a point.
Definition: FVFunctionIC.C:36
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
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...
registerMooseObject("MooseApp", FVFunctionIC)
const FunctionName functionName() const
Definition: FVFunctionIC.C:42
Defines a boundary condition that forces the value to be a user specified function at the boundary...
Definition: FVFunctionIC.h:26
static InputParameters validParams()
Definition: FVFunctionIC.C:16
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FVFunctionIC(const InputParameters &parameters)
Definition: FVFunctionIC.C:28
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...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
static InputParameters validParams()
const Real _scaling
Scaling factor, to be able to use a function with multiple ICs.
Definition: FVFunctionIC.h:53
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
This is a template class that implements the workhorse compute and computeNodal methods.