LCOV - code coverage report
Current view: top level - src/interfacekernels - ParallelElectricFieldInterface.C (source / functions) Hit Total Coverage
Test: idaholab/moose electromagnetics: #32971 (54bef8) with base c6cf66 Lines: 35 36 97.2 %
Date: 2026-05-29 20:36:10 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 "ParallelElectricFieldInterface.h"
      11             : 
      12             : registerMooseObject("ElectromagneticsApp", ParallelElectricFieldInterface);
      13             : 
      14             : InputParameters
      15          76 : ParallelElectricFieldInterface::validParams()
      16             : {
      17          76 :   InputParameters params = VectorInterfaceKernel::validParams();
      18          76 :   params.addClassDescription("VectorInterfaceKernel that implements the condition "
      19             :                              "$\\vec{E}_{1}^{\\parallel} - \\vec{E}_{2}^{\\parallel} = 0$");
      20          76 :   return params;
      21           0 : }
      22             : 
      23          40 : ParallelElectricFieldInterface::ParallelElectricFieldInterface(const InputParameters & parameters)
      24          40 :   : VectorInterfaceKernel(parameters)
      25             : {
      26          40 : }
      27             : 
      28             : Real
      29      345600 : ParallelElectricFieldInterface::computeQpResidual(Moose::DGResidualType type)
      30             : {
      31      345600 :   _u_parallel = -_normals[_qp].cross(_normals[_qp].cross(_u[_qp]));
      32      345600 :   _secondary_parallel = -_normals[_qp].cross(_normals[_qp].cross(_neighbor_value[_qp]));
      33             : 
      34             :   Real res = 0;
      35             : 
      36      345600 :   switch (type)
      37             :   {
      38      172800 :     case Moose::Element:
      39      172800 :       res = _test[_i][_qp] * (_u_parallel - _secondary_parallel);
      40      172800 :       break;
      41             : 
      42      172800 :     case Moose::Neighbor:
      43      172800 :       res = _test_neighbor[_i][_qp] * -(_u_parallel - _secondary_parallel);
      44      172800 :       break;
      45             :   }
      46             : 
      47      345600 :   return res;
      48             : }
      49             : 
      50             : Real
      51     4147200 : ParallelElectricFieldInterface::computeQpJacobian(Moose::DGJacobianType type)
      52             : {
      53     4147200 :   _phi_u_parallel = -_normals[_qp].cross(_normals[_qp].cross(_phi[_j][_qp]));
      54     4147200 :   _phi_secondary_parallel = -_normals[_qp].cross(_normals[_qp].cross(_phi_neighbor[_j][_qp]));
      55             : 
      56             :   Real jac = 0;
      57             : 
      58     4147200 :   switch (type)
      59             :   {
      60     1036800 :     case Moose::ElementElement:
      61     1036800 :       jac = _test[_i][_qp] * _phi_u_parallel;
      62     1036800 :       break;
      63             : 
      64     1036800 :     case Moose::NeighborNeighbor:
      65     1036800 :       jac = _test_neighbor[_i][_qp] * _phi_secondary_parallel;
      66     1036800 :       break;
      67             : 
      68     1036800 :     case Moose::NeighborElement:
      69     1036800 :       jac = _test_neighbor[_i][_qp] * -_phi_u_parallel;
      70     1036800 :       break;
      71             : 
      72     1036800 :     case Moose::ElementNeighbor:
      73     1036800 :       jac = _test[_i][_qp] * -_phi_secondary_parallel;
      74     1036800 :       break;
      75             :   }
      76             : 
      77     4147200 :   return jac;
      78             : }

Generated by: LCOV version 1.14