LCOV - code coverage report
Current view: top level - src/hdgkernels - IPHDGKernel.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31405 (292dce) with base fef103 Lines: 48 58 82.8 %
Date: 2025-09-04 07:52:05 Functions: 12 14 85.7 %
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 "IPHDGAssemblyHelper.h"
      11             : #include "IPHDGKernel.h"
      12             : 
      13             : using namespace libMesh;
      14             : 
      15             : InputParameters
      16       29738 : IPHDGKernel::validParams()
      17             : {
      18       29738 :   auto params = HDGKernel::validParams();
      19       29738 :   return params;
      20             : }
      21             : 
      22         606 : IPHDGKernel::IPHDGKernel(const InputParameters & params) : HDGKernel(params), _cached_elem(nullptr)
      23             : {
      24         606 : }
      25             : 
      26             : void
      27     1093336 : IPHDGKernel::compute()
      28             : {
      29     1093336 :   auto & iphdg_helper = iphdgHelper();
      30     1093336 :   iphdg_helper.resizeResiduals();
      31     1093336 :   iphdg_helper.scalarVolume();
      32     1093336 : }
      33             : 
      34             : void
      35     3904380 : IPHDGKernel::computeOnSide()
      36             : {
      37     3904380 :   auto & iphdg_helper = iphdgHelper();
      38     3904380 :   iphdg_helper.resizeResiduals();
      39     3904380 :   iphdg_helper.scalarFace();
      40     3904380 :   iphdg_helper.lmFace();
      41     3904380 : }
      42             : 
      43             : void
      44      732855 : IPHDGKernel::computeResidual()
      45             : {
      46      732855 :   compute();
      47     2198565 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      48     1465710 :     addResiduals(_assembly, residual_packet);
      49      732855 : }
      50             : 
      51             : void
      52      360481 : IPHDGKernel::computeJacobian()
      53             : {
      54      360481 :   compute();
      55     1081443 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      56      720962 :     addJacobian(_assembly, residual_packet);
      57      360481 : }
      58             : 
      59             : void
      60           0 : IPHDGKernel::computeResidualAndJacobian()
      61             : {
      62           0 :   compute();
      63           0 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      64           0 :     addResidualsAndJacobian(_assembly, residual_packet);
      65           0 : }
      66             : 
      67             : void
      68     2616942 : IPHDGKernel::computeResidualOnSide()
      69             : {
      70     2616942 :   computeOnSide();
      71     7850826 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      72     5233884 :     addResiduals(_assembly, residual_packet);
      73     2616942 : }
      74             : 
      75             : void
      76     1287438 : IPHDGKernel::computeJacobianOnSide()
      77             : {
      78     1287438 :   computeOnSide();
      79     3862314 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      80     2574876 :     addJacobian(_assembly, residual_packet);
      81     1287438 : }
      82             : 
      83             : void
      84           0 : IPHDGKernel::computeResidualAndJacobianOnSide()
      85             : {
      86           0 :   computeOnSide();
      87           0 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      88           0 :     addResidualsAndJacobian(_assembly, residual_packet);
      89           0 : }
      90             : 
      91             : void
      92         777 : IPHDGKernel::jacobianSetup()
      93             : {
      94         777 :   _cached_elem = nullptr;
      95         777 : }
      96             : 
      97             : void
      98      722362 : IPHDGKernel::computeOffDiagJacobian(const unsigned int)
      99             : {
     100      722362 :   if (_cached_elem != _current_elem)
     101             :   {
     102      360481 :     computeJacobian();
     103      360481 :     _cached_elem = _current_elem;
     104             :   }
     105      722362 : }
     106             : 
     107             : std::set<std::string>
     108         589 : IPHDGKernel::additionalROVariables()
     109             : {
     110         589 :   return iphdgHelper().additionalROVariables();
     111             : }
     112             : 
     113             : const std::unordered_set<unsigned int> &
     114        2468 : IPHDGKernel::getMatPropDependencies() const
     115             : {
     116        2468 :   return iphdgHelper().getMatPropDependencies();
     117             : }

Generated by: LCOV version 1.14