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 "MassMatrixDGKernel.h" 11 : 12 : registerMooseObject("NavierStokesApp", MassMatrixDGKernel); 13 : 14 : InputParameters 15 71 : MassMatrixDGKernel::validParams() 16 : { 17 71 : InputParameters params = DGKernel::validParams(); 18 71 : params.addClassDescription("Computes a finite element mass matrix meant for use in " 19 : "preconditioning schemes which require one"); 20 142 : params.addParam<Real>("density", 1, "Optional density for scaling the computed mass."); 21 142 : params.set<MultiMooseEnum>("vector_tags") = ""; 22 142 : params.set<MultiMooseEnum>("matrix_tags") = ""; 23 71 : params.suppressParameter<MultiMooseEnum>("vector_tags"); 24 71 : params.suppressParameter<std::vector<TagName>>("extra_vector_tags"); 25 71 : params.suppressParameter<std::vector<TagName>>("absolute_value_vector_tags"); 26 71 : params.set<bool>("matrix_only") = true; 27 71 : return params; 28 0 : } 29 : 30 39 : MassMatrixDGKernel::MassMatrixDGKernel(const InputParameters & parameters) 31 78 : : DGKernel(parameters), _density(getParam<Real>("density")) 32 : { 33 78 : if (!isParamValid("matrix_tags") && !isParamValid("extra_matrix_tags")) 34 0 : mooseError("One of 'matrix_tags' or 'extra_matrix_tags' must be provided"); 35 39 : } 36 : 37 : Real 38 0 : MassMatrixDGKernel::computeQpResidual(Moose::DGResidualType) 39 : { 40 : mooseAssert(false, "should never be called"); 41 0 : return 0; 42 : } 43 : 44 : Real 45 14929380 : MassMatrixDGKernel::computeQpJacobian(const Moose::DGJacobianType type) 46 : { 47 : Real jac = 0; 48 : 49 14929380 : switch (type) 50 : { 51 3732345 : case Moose::ElementElement: 52 3732345 : jac = _test[_i][_qp] * _density * _phi[_j][_qp]; 53 3732345 : break; 54 : 55 : default: 56 : jac = 0; 57 : break; 58 : } 59 : 60 14929380 : return jac; 61 : }