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 "SmoothTransitionFunction.h" 11 : 12 : InputParameters 13 76 : SmoothTransitionFunction::validParams() 14 : { 15 76 : InputParameters params = Function::validParams(); 16 : 17 152 : MooseEnum axis("x=0 y=1 z=2 t=3"); 18 152 : params.addRequiredParam<MooseEnum>( 19 : "axis", axis, "Coordinate axis on which the transition occurs"); 20 152 : params.addRequiredParam<FunctionName>("function1", "First function"); 21 152 : params.addRequiredParam<FunctionName>("function2", "Second function"); 22 152 : params.addRequiredParam<Real>("transition_center", "Center position of transition"); 23 152 : params.addRequiredParam<Real>("transition_width", "Width of transition"); 24 : 25 76 : return params; 26 76 : } 27 : 28 40 : SmoothTransitionFunction::SmoothTransitionFunction(const InputParameters & parameters) 29 : : Function(parameters), 30 : FunctionInterface(this), 31 : 32 40 : _component(getParam<MooseEnum>("axis")), 33 40 : _use_time(_component == 3), 34 : 35 40 : _function1(getFunction("function1")), 36 40 : _function2(getFunction("function2")), 37 : 38 80 : _x_center(getParam<Real>("transition_center")), 39 120 : _transition_width(getParam<Real>("transition_width")) 40 : { 41 40 : }