LCOV - code coverage report
Current view: top level - src/kernels - VectorMassMatrix.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 17 21 81.0 %
Date: 2025-08-14 10:14:56 Functions: 3 4 75.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 "VectorMassMatrix.h"
      11             : 
      12             : registerMooseObject("NavierStokesApp", VectorMassMatrix);
      13             : 
      14             : InputParameters
      15          41 : VectorMassMatrix::validParams()
      16             : {
      17          41 :   InputParameters params = VectorKernel::validParams();
      18          41 :   params.addClassDescription("Computes a finite element mass matrix meant for use in "
      19             :                              "preconditioning schemes which require one");
      20          82 :   params.addParam<Real>("density", 1, "Optional density for scaling the computed mass.");
      21          82 :   params.set<MultiMooseEnum>("vector_tags") = "";
      22          82 :   params.set<MultiMooseEnum>("matrix_tags") = "";
      23          41 :   params.suppressParameter<MultiMooseEnum>("vector_tags");
      24          41 :   params.suppressParameter<std::vector<TagName>>("extra_vector_tags");
      25          41 :   params.suppressParameter<std::vector<TagName>>("absolute_value_vector_tags");
      26          41 :   params.set<bool>("matrix_only") = true;
      27          41 :   return params;
      28           0 : }
      29             : 
      30          22 : VectorMassMatrix::VectorMassMatrix(const InputParameters & parameters)
      31          44 :   : VectorKernel(parameters), _density(getParam<Real>("density"))
      32             : {
      33          44 :   if (!isParamValid("matrix_tags") && !isParamValid("extra_matrix_tags"))
      34           0 :     mooseError("One of 'matrix_tags' or 'extra_matrix_tags' must be provided");
      35          22 : }
      36             : 
      37             : Real
      38           0 : VectorMassMatrix::computeQpResidual()
      39             : {
      40           0 :   mooseError("should never be called");
      41             : }
      42             : 
      43             : Real
      44     5038848 : VectorMassMatrix::computeQpJacobian()
      45             : {
      46     5038848 :   return _density * _phi[_j][_qp] * _test[_i][_qp];
      47             : }

Generated by: LCOV version 1.14