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 "FVFunctionIC.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("MooseApp", FVFunctionIC); 14 : 15 : InputParameters 16 14611 : FVFunctionIC::validParams() 17 : { 18 14611 : InputParameters params = FVInitialCondition::validParams(); 19 58444 : params.addRequiredParam<FunctionName>("function", "The initial condition function."); 20 : 21 29222 : 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 43833 : params.addParam<Real>("scaling_factor", 1, "Scaling factor to apply on the function"); 24 : 25 14611 : return params; 26 0 : } 27 : 28 179 : FVFunctionIC::FVFunctionIC(const InputParameters & parameters) 29 : : FVInitialCondition(parameters), 30 179 : _func(getFunction("function")), 31 537 : _scaling(getParam<Real>("scaling_factor")) 32 : { 33 179 : } 34 : 35 : Real 36 28646 : FVFunctionIC::value(const Point & p) 37 : { 38 28646 : return _scaling * _func.value(_t, p); 39 : } 40 : 41 : const FunctionName 42 0 : FVFunctionIC::functionName() const 43 : { 44 0 : return _func.name(); 45 : }