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

Generated by: LCOV version 1.14