LCOV - code coverage report
Current view: top level - src/hdgkernels - IPHDGKernel.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 48 58 82.8 %
Date: 2025-08-08 20:01:16 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       29660 : IPHDGKernel::validParams()
      17             : {
      18       29660 :   auto params = HDGKernel::validParams();
      19       29660 :   return params;
      20             : }
      21             : 
      22         567 : IPHDGKernel::IPHDGKernel(const InputParameters & params) : HDGKernel(params), _cached_elem(nullptr)
      23             : {
      24         567 : }
      25             : 
      26             : void
      27     1088566 : IPHDGKernel::compute()
      28             : {
      29     1088566 :   auto & iphdg_helper = iphdgHelper();
      30     1088566 :   iphdg_helper.resizeResiduals();
      31     1088566 :   iphdg_helper.scalarVolume();
      32     1088566 : }
      33             : 
      34             : void
      35     3892266 : IPHDGKernel::computeOnSide()
      36             : {
      37     3892266 :   auto & iphdg_helper = iphdgHelper();
      38     3892266 :   iphdg_helper.resizeResiduals();
      39     3892266 :   iphdg_helper.scalarFace();
      40     3892266 :   iphdg_helper.lmFace();
      41     3892266 : }
      42             : 
      43             : void
      44      729444 : IPHDGKernel::computeResidual()
      45             : {
      46      729444 :   compute();
      47     2188332 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      48     1458888 :     addResiduals(_assembly, residual_packet);
      49      729444 : }
      50             : 
      51             : void
      52      359122 : IPHDGKernel::computeJacobian()
      53             : {
      54      359122 :   compute();
      55     1077366 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      56      718244 :     addJacobian(_assembly, residual_packet);
      57      359122 : }
      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     2608284 : IPHDGKernel::computeResidualOnSide()
      69             : {
      70     2608284 :   computeOnSide();
      71     7824852 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      72     5216568 :     addResiduals(_assembly, residual_packet);
      73     2608284 : }
      74             : 
      75             : void
      76     1283982 : IPHDGKernel::computeJacobianOnSide()
      77             : {
      78     1283982 :   computeOnSide();
      79     3851946 :   for (const auto & residual_packet : iphdgHelper().taggingData())
      80     2567964 :     addJacobian(_assembly, residual_packet);
      81     1283982 : }
      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         717 : IPHDGKernel::jacobianSetup()
      93             : {
      94         717 :   _cached_elem = nullptr;
      95         717 : }
      96             : 
      97             : void
      98      719644 : IPHDGKernel::computeOffDiagJacobian(const unsigned int)
      99             : {
     100      719644 :   if (_cached_elem != _current_elem)
     101             :   {
     102      359122 :     computeJacobian();
     103      359122 :     _cached_elem = _current_elem;
     104             :   }
     105      719644 : }
     106             : 
     107             : std::set<std::string>
     108         550 : IPHDGKernel::additionalROVariables()
     109             : {
     110         550 :   return iphdgHelper().additionalROVariables();
     111             : }
     112             : 
     113             : const std::unordered_set<unsigned int> &
     114        2252 : IPHDGKernel::getMatPropDependencies() const
     115             : {
     116        2252 :   return iphdgHelper().getMatPropDependencies();
     117             : }

Generated by: LCOV version 1.14