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 "VectorFunctionAux.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("MooseApp", VectorFunctionAux); 14 : 15 : InputParameters 16 14340 : VectorFunctionAux::validParams() 17 : { 18 14340 : InputParameters params = VectorAuxKernel::validParams(); 19 14340 : params.addClassDescription( 20 : "Auxiliary Kernel that creates and updates a vector field variable by " 21 : "sampling a Function object, via the vectorValue method, through space and time."); 22 14340 : params.addRequiredParam<FunctionName>("function", "The function to use as the value."); 23 14340 : return params; 24 0 : } 25 : 26 39 : VectorFunctionAux::VectorFunctionAux(const InputParameters & parameters) 27 39 : : VectorAuxKernel(parameters), _function(getFunction("function")) 28 : { 29 39 : } 30 : 31 : RealVectorValue 32 10720 : VectorFunctionAux::computeValue() 33 : { 34 10720 : if (isNodal()) 35 4320 : return _function.vectorValue(_t, *_current_node); 36 : else 37 6400 : return _function.vectorValue(_t, _q_point[_qp]); 38 : }