https://mooseframework.inl.gov
VariableFunctionProductIC.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 
11 #include "Function.h"
12 
13 registerMooseObject("ThermalHydraulicsApp", VariableFunctionProductIC);
14 
17 {
19  params.addRequiredCoupledVar("var", "Coupled variable");
20  params.addRequiredParam<FunctionName>("fn", "User function");
21  params.addClassDescription(
22  "Sets the initial condition as the product of a variable and a function");
23  return params;
24 }
25 
27  : InitialCondition(parameters), _var(coupledValue("var")), _fn(getFunction("fn"))
28 {
29 }
30 
31 Real
33 {
34  return _var[_qp] * _fn.value(_t, p);
35 }
static InputParameters validParams()
virtual Real value(const Point &p) override
void addRequiredParam(const std::string &name, const std::string &doc_string)
const VariableValue & _var
Coupled variable.
registerMooseObject("ThermalHydraulicsApp", VariableFunctionProductIC)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const Function & _fn
Function.
VariableFunctionProductIC(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
Computes product of a variable and a function.
void addClassDescription(const std::string &doc_string)
virtual Real value(Real t, const Point &p) const