Line data Source code
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 "VariableFunctionProductIC.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", VariableFunctionProductIC); 14 : 15 : InputParameters 16 4318 : VariableFunctionProductIC::validParams() 17 : { 18 4318 : InputParameters params = InitialCondition::validParams(); 19 8636 : params.addRequiredCoupledVar("var", "Coupled variable"); 20 8636 : params.addRequiredParam<FunctionName>("fn", "User function"); 21 4318 : params.addClassDescription( 22 : "Sets the initial condition as the product of a variable and a function"); 23 4318 : return params; 24 0 : } 25 : 26 2300 : VariableFunctionProductIC::VariableFunctionProductIC(const InputParameters & parameters) 27 2300 : : InitialCondition(parameters), _var(coupledValue("var")), _fn(getFunction("fn")) 28 : { 29 2300 : } 30 : 31 : Real 32 66773 : VariableFunctionProductIC::value(const Point & p) 33 : { 34 66773 : return _var[_qp] * _fn.value(_t, p); 35 : }