Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ 4 : /* */ 5 : /* Copyright 2017 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #include "RadialGreensSource.h" 10 : 11 : registerMooseObject("MagpieApp", RadialGreensSource); 12 : 13 : InputParameters 14 54 : RadialGreensSource::validParams() 15 : { 16 54 : InputParameters params = Kernel::validParams(); 17 54 : params.addClassDescription( 18 : "Apply the convolution from a RadialGreensConvolution object to a non-linear variable"); 19 108 : params.addRequiredParam<UserObjectName>("convolution", "RadialGreensConvolution user object"); 20 108 : params.addParam<Real>("gamma", 1.0, "Rate factor"); 21 54 : return params; 22 0 : } 23 : 24 30 : RadialGreensSource::RadialGreensSource(const InputParameters & parameters) 25 : : Kernel(parameters), 26 30 : _convolution(getUserObject<RadialGreensConvolution>("convolution").getConvolution()), 27 90 : _gamma(getParam<Real>("gamma")) 28 : { 29 30 : } 30 : 31 : void 32 110320 : RadialGreensSource::precalculateResidual() 33 : { 34 110320 : _result = _convolution.find(_current_elem->id()); 35 110320 : if (_result == _convolution.end()) 36 0 : mooseError("Current element not found in convolution result"); 37 110320 : } 38 : 39 : Real 40 2074480 : RadialGreensSource::computeQpResidual() 41 : { 42 2074480 : return -_gamma * _result->second[_qp] / (_JxW[_qp] * _coord[_qp]) * _test[_i][_qp]; 43 : }