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 "VectorTimeDerivative.h" 11 : 12 : // MOOSE includes 13 : #include "Assembly.h" 14 : #include "MooseVariableFE.h" 15 : 16 : #include "libmesh/quadrature.h" 17 : 18 : registerMooseObject("MooseApp", VectorTimeDerivative); 19 : 20 : InputParameters 21 14482 : VectorTimeDerivative::validParams() 22 : { 23 14482 : InputParameters params = VectorTimeKernel::validParams(); 24 14482 : params.addClassDescription("The time derivative operator with the weak form of $(\\vec{\\psi_i}, " 25 : "\\frac{\\partial \\vec{u_h}}{\\partial t})$."); 26 14482 : params.addParam<bool>("lumping", false, "True for mass matrix lumping, false otherwise"); 27 : 28 14482 : return params; 29 0 : } 30 : 31 113 : VectorTimeDerivative::VectorTimeDerivative(const InputParameters & parameters) 32 113 : : VectorTimeKernel(parameters), _lumping(getParam<bool>("lumping")) 33 : { 34 113 : } 35 : 36 : Real 37 6298016 : VectorTimeDerivative::computeQpResidual() 38 : { 39 6298016 : return _test[_i][_qp] * _u_dot[_qp]; 40 : } 41 : 42 : Real 43 16192032 : VectorTimeDerivative::computeQpJacobian() 44 : { 45 16192032 : return _test[_i][_qp] * _phi[_j][_qp] * _du_dot_du[_qp]; 46 : } 47 : 48 : void 49 45322 : VectorTimeDerivative::computeJacobian() 50 : { 51 45322 : if (_lumping) 52 : { 53 0 : prepareMatrixTag(_assembly, _var.number(), _var.number()); 54 : 55 0 : precalculateJacobian(); 56 0 : for (_i = 0; _i < _test.size(); _i++) 57 0 : for (_j = 0; _j < _phi.size(); _j++) 58 0 : for (_qp = 0; _qp < _qrule->n_points(); _qp++) 59 0 : _local_ke(_i, _i) += _JxW[_qp] * _coord[_qp] * computeQpJacobian(); 60 : 61 0 : accumulateTaggedLocalMatrix(); 62 : } 63 : else 64 45322 : VectorTimeKernel::computeJacobian(); 65 45322 : }