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 "LinearFVElementalKernel.h" 11 : #include "Assembly.h" 12 : #include "SubProblem.h" 13 : 14 : InputParameters 15 11205 : LinearFVElementalKernel::validParams() 16 : { 17 11205 : InputParameters params = LinearFVKernel::validParams(); 18 11205 : params.registerSystemAttributeName("LinearFVElementalKernel"); 19 11205 : return params; 20 0 : } 21 : 22 1011 : LinearFVElementalKernel::LinearFVElementalKernel(const InputParameters & params) 23 1011 : : LinearFVKernel(params), _current_elem_info(nullptr) 24 : { 25 1011 : } 26 : 27 : void 28 1141408 : LinearFVElementalKernel::addMatrixContribution() 29 : { 30 : // These only contribute to the diagonal of the matrix, so we just get 31 : // the contribution and insert it immediately. We add it to every tagged matrix. 32 1141408 : const auto mx_contrib = computeMatrixContribution(); 33 2282858 : for (auto & matrix : _matrices) 34 1141450 : (*matrix).add(_dof_id, _dof_id, mx_contrib); 35 1141408 : } 36 : 37 : void 38 1141408 : LinearFVElementalKernel::addRightHandSideContribution() 39 : { 40 : // These only contribute to one entry of the right hand side, so we just get 41 : // the contribution and insert it immediately. We add it to every tagged 42 : // vector. 43 1141408 : const auto rhs_contrib = computeRightHandSideContribution(); 44 2282858 : for (auto & vector : _vectors) 45 1141450 : (*vector).add(_dof_id, rhs_contrib); 46 1141408 : } 47 : 48 : void 49 1141408 : LinearFVElementalKernel::setCurrentElemInfo(const ElemInfo * elem_info) 50 : { 51 1141408 : _current_elem_info = elem_info; 52 1141408 : _dof_id = _current_elem_info->dofIndices()[_sys_num][_var_num]; 53 1141408 : }