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