LCOV - code coverage report
Current view: top level - src/dgkernels - MassMatrixDGKernel.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: #32971 (54bef8) with base c6cf66 Lines: 19 23 82.6 %
Date: 2026-05-29 20:37:52 Functions: 4 5 80.0 %
Legend: Lines: hit not hit

          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             : #include "MassMatrix.h"
      12             : 
      13             : registerMooseObject("NavierStokesApp", MassMatrixDGKernel);
      14             : 
      15             : InputParameters
      16          13 : MassMatrixDGKernel::validParams()
      17             : {
      18          13 :   InputParameters params = DGKernel::validParams();
      19          13 :   params.addClassDescription(
      20             :       "Computes a finite element mass matrix on internal faces meant for use in "
      21             :       "preconditioning schemes which require one");
      22          13 :   MassMatrix::setMassMatrixParams(params);
      23          26 :   params.addParam<Real>("density", 1, "The density");
      24          13 :   return params;
      25           0 : }
      26             : 
      27           7 : MassMatrixDGKernel::MassMatrixDGKernel(const InputParameters & parameters)
      28          14 :   : DGKernel(parameters), _density(getParam<Real>("density")), _hmax(0)
      29             : {
      30          14 :   if (!isParamValid("matrix_tags") && !isParamValid("extra_matrix_tags"))
      31           0 :     mooseError("One of 'matrix_tags' or 'extra_matrix_tags' must be provided");
      32           7 : }
      33             : 
      34             : Real
      35           0 : MassMatrixDGKernel::computeQpResidual(Moose::DGResidualType)
      36             : {
      37             :   mooseAssert(false, "should never be called");
      38           0 :   return 0;
      39             : }
      40             : 
      41             : void
      42      588800 : MassMatrixDGKernel::precalculateJacobian()
      43             : {
      44      588800 :   _hmax = _current_side_elem->hmax();
      45      588800 : }
      46             : 
      47             : Real
      48     6782976 : MassMatrixDGKernel::computeQpJacobian(const Moose::DGJacobianType type)
      49             : {
      50             :   Real jac = 0;
      51             : 
      52     6782976 :   switch (type)
      53             :   {
      54     1695744 :     case Moose::ElementElement:
      55     1695744 :       jac = _test[_i][_qp] * _density * _hmax * _phi[_j][_qp];
      56     1695744 :       break;
      57             : 
      58             :     default:
      59             :       jac = 0;
      60             :       break;
      61             :   }
      62             : 
      63     6782976 :   return jac;
      64             : }

Generated by: LCOV version 1.14