https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
14
17{
19 params.addRequiredCoupledVar("var", "Coupled variable");
20 params.addRequiredParam<FunctionName>("fn", "User function");
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
31Real
33{
34 return _var[_qp] * _fn.value(_t, p);
35}
const Real p
registerMooseObject("ThermalHydraulicsApp", VariableFunctionProductIC)
virtual Real value(Real t, const Point &p) const
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Computes product of a variable and a function.
VariableFunctionProductIC(const InputParameters &parameters)
const VariableValue & _var
Coupled variable.
const Function & _fn
Function.
virtual Real value(const Point &p) override
static InputParameters validParams()