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 "FunctionDiracSource.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("MooseApp", FunctionDiracSource); 14 : 15 : InputParameters 16 3441 : FunctionDiracSource::validParams() 17 : { 18 3441 : InputParameters params = DiracKernel::validParams(); 19 6882 : params.addClassDescription("Residual contribution from a point source defined by a function."); 20 13764 : params.addRequiredParam<FunctionName>( 21 : "function", "The function to use for controlling the specified dirac source."); 22 10323 : params.addRequiredParam<Point>("point", "The x,y,z coordinates of the point"); 23 3441 : return params; 24 0 : } 25 : 26 201 : FunctionDiracSource::FunctionDiracSource(const InputParameters & parameters) 27 804 : : DiracKernel(parameters), _function(getFunction("function")), _p(getParam<Point>("point")) 28 : { 29 201 : } 30 : 31 : void 32 15125 : FunctionDiracSource::addPoints() 33 : { 34 15125 : addPoint(_p); 35 15125 : } 36 : 37 : Real 38 120536 : FunctionDiracSource::computeQpResidual() 39 : { 40 120536 : return -_test[_i][_qp] * _function.value(_t, _p); 41 : }