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 "DefectAnnihilation.h" 10 : 11 : registerMooseObject("MagpieApp", DefectAnnihilation); 12 : 13 : InputParameters 14 18 : DefectAnnihilation::validParams() 15 : { 16 18 : InputParameters params = Kernel::validParams(); 17 18 : params.addClassDescription("Annihilation rate kernel that is proportional to the product of the " 18 : "kernel variable and the coupled variable"); 19 36 : params.addRequiredCoupledVar("v", "Other defect concentration"); 20 36 : params.addParam<Real>("prefactor", 1.0, "Annihilation rate"); 21 18 : return params; 22 0 : } 23 : 24 10 : DefectAnnihilation::DefectAnnihilation(const InputParameters & parameters) 25 : : Kernel(parameters), 26 10 : _v(coupledValue("v")), 27 10 : _v_var(coupled("v")), 28 30 : _prefactor(getParam<Real>("prefactor")) 29 : { 30 10 : } 31 : 32 : Real 33 48000 : DefectAnnihilation::computeQpResidual() 34 : { 35 48000 : return _prefactor * _u[_qp] * _v[_qp] * _test[_i][_qp]; 36 : } 37 : 38 : Real 39 115200 : DefectAnnihilation::computeQpJacobian() 40 : { 41 115200 : return _prefactor * _phi[_j][_qp] * _v[_qp] * _test[_i][_qp]; 42 : } 43 : 44 : Real 45 115200 : DefectAnnihilation::computeQpOffDiagJacobian(unsigned int jvar) 46 : { 47 115200 : if (jvar == _v_var) 48 115200 : return _prefactor * _u[_qp] * _phi[_j][_qp] * _test[_i][_qp]; 49 : 50 : return 0.0; 51 : }