LCOV - code coverage report
Current view: top level - src/interfacekernels - InterfaceDiffusion.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 8601ad Lines: 32 33 97.0 %
Date: 2025-07-18 13:27:08 Functions: 4 4 100.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 "InterfaceDiffusion.h"
      11             : 
      12             : registerMooseObject("MooseApp", InterfaceDiffusion);
      13             : 
      14             : InputParameters
      15       14912 : InterfaceDiffusion::validParams()
      16             : {
      17       14912 :   InputParameters params = InterfaceKernel::validParams();
      18       14912 :   params.addParam<MaterialPropertyName>("D", "D", "The diffusion coefficient.");
      19       14912 :   params.addParam<MaterialPropertyName>(
      20             :       "D_neighbor", "D_neighbor", "The neighboring diffusion coefficient.");
      21       14912 :   params.addClassDescription(
      22             :       "The kernel is utilized to establish flux equivalence on an interface for variables.");
      23       14912 :   return params;
      24           0 : }
      25             : 
      26         337 : InterfaceDiffusion::InterfaceDiffusion(const InputParameters & parameters)
      27             :   : InterfaceKernel(parameters),
      28         337 :     _D(getMaterialProperty<Real>("D")),
      29         674 :     _D_neighbor(getNeighborMaterialProperty<Real>("D_neighbor"))
      30             : {
      31         337 : }
      32             : 
      33             : Real
      34     6234436 : InterfaceDiffusion::computeQpResidual(Moose::DGResidualType type)
      35             : {
      36     6234436 :   Real r = 0;
      37             : 
      38     6234436 :   switch (type)
      39             :   {
      40     3117218 :     case Moose::Element:
      41     3117218 :       r = _test[_i][_qp] * -_D_neighbor[_qp] * _grad_neighbor_value[_qp] * _normals[_qp];
      42     3117218 :       break;
      43             : 
      44     3117218 :     case Moose::Neighbor:
      45     3117218 :       r = _test_neighbor[_i][_qp] * _D[_qp] * _grad_u[_qp] * _normals[_qp];
      46     3117218 :       break;
      47             :   }
      48             : 
      49     6234436 :   return r;
      50             : }
      51             : 
      52             : Real
      53     4458528 : InterfaceDiffusion::computeQpJacobian(Moose::DGJacobianType type)
      54             : {
      55     4458528 :   Real jac = 0;
      56             : 
      57     4458528 :   switch (type)
      58             :   {
      59     4210824 :     case Moose::ElementElement:
      60             :     case Moose::NeighborNeighbor:
      61     4210824 :       break;
      62             : 
      63      123852 :     case Moose::NeighborElement:
      64      123852 :       jac = _test_neighbor[_i][_qp] * _D[_qp] * _grad_phi[_j][_qp] * _normals[_qp];
      65      123852 :       break;
      66             : 
      67      123852 :     case Moose::ElementNeighbor:
      68      123852 :       jac = _test[_i][_qp] * -_D_neighbor[_qp] * _grad_phi_neighbor[_j][_qp] * _normals[_qp];
      69      123852 :       break;
      70             :   }
      71             : 
      72     4458528 :   return jac;
      73             : }

Generated by: LCOV version 1.14