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 "VectorConstantPointSource.h" 11 : 12 : registerMooseObject("MooseApp", VectorConstantPointSource); 13 : 14 : InputParameters 15 14390 : VectorConstantPointSource::validParams() 16 : { 17 14390 : InputParameters params = VectorDiracKernel::validParams(); 18 14390 : params.addClassDescription("Residual contribution of a constant point source term."); 19 14390 : params.addRequiredParam<RealVectorValue>("values", "The value of the point source"); 20 14390 : params.addRequiredParam<std::vector<Real>>("point", "The x,y,z coordinates of the point"); 21 14390 : params.declareControllable("values"); 22 14390 : return params; 23 0 : } 24 : 25 65 : VectorConstantPointSource::VectorConstantPointSource(const InputParameters & parameters) 26 : : VectorDiracKernel(parameters), 27 65 : _values(getParam<RealVectorValue>("values")), 28 130 : _point_param(getParam<std::vector<Real>>("point")) 29 : { 30 65 : _p(0) = _point_param[0]; 31 65 : if (_point_param.size() > 1) 32 : { 33 65 : _p(1) = _point_param[1]; 34 65 : if (_point_param.size() > 2) 35 39 : _p(2) = _point_param[2]; 36 : } 37 65 : } 38 : 39 : void 40 2476 : VectorConstantPointSource::addPoints() 41 : { 42 2476 : addPoint(_p); 43 2476 : } 44 : 45 : Real 46 22480 : VectorConstantPointSource::computeQpResidual() 47 : { 48 : // This is negative because it's a forcing function that has been brought over to the left side 49 22480 : return -_test[_i][_qp] * _values; 50 : }