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 45759 : LinearFVElementalKernel::validParams() 16 : { 17 45759 : InputParameters params = LinearFVKernel::validParams(); 18 45759 : params.registerSystemAttributeName("LinearFVElementalKernel"); 19 45759 : return params; 20 0 : } 21 : 22 1482 : LinearFVElementalKernel::LinearFVElementalKernel(const InputParameters & params) 23 1482 : : LinearFVKernel(params), _current_elem_info(nullptr) 24 : { 25 1482 : } 26 : 27 : void 28 1619506 : 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 1619506 : const auto mx_contrib = computeMatrixContribution(); 33 3239060 : for (auto & matrix : _matrices) 34 1619554 : (*matrix).add(_dof_id, _dof_id, mx_contrib); 35 1619506 : } 36 : 37 : void 38 1619506 : 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 1619506 : const auto rhs_contrib = computeRightHandSideContribution(); 44 3239060 : for (auto & vector : _vectors) 45 1619554 : (*vector).add(_dof_id, rhs_contrib); 46 1619506 : } 47 : 48 : void 49 1619506 : LinearFVElementalKernel::setCurrentElemInfo(const ElemInfo * elem_info) 50 : { 51 1619506 : _current_elem_info = elem_info; 52 1619506 : _dof_id = _current_elem_info->dofIndices()[_sys_num][_var_num]; 53 1619506 : }