LCOV - code coverage report
Current view: top level - src/bcs - ArrayVacuumBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 16 19 84.2 %
Date: 2025-07-17 01:28:37 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 "ArrayVacuumBC.h"
      11             : 
      12             : registerMooseObject("MooseApp", ArrayVacuumBC);
      13             : 
      14             : InputParameters
      15       14522 : ArrayVacuumBC::validParams()
      16             : {
      17       14522 :   InputParameters params = ArrayIntegratedBC::validParams();
      18       14522 :   params.addParam<RealEigenVector>("alpha", "Ratio between directional gradient and solution");
      19       14522 :   params.addClassDescription("Imposes the Robin boundary condition $\\partial_n "
      20             :                              "\\vec{u}=-\\frac{\\vec{\\alpha}}{2}\\vec{u}$.");
      21       14522 :   return params;
      22           0 : }
      23             : 
      24         130 : ArrayVacuumBC::ArrayVacuumBC(const InputParameters & parameters)
      25             :   : ArrayIntegratedBC(parameters),
      26         377 :     _alpha(isParamValid("alpha") ? getParam<RealEigenVector>("alpha")
      27         377 :                                  : RealEigenVector::Ones(_count))
      28             : {
      29         130 :   if (_alpha.size() != _count)
      30           0 :     paramError(
      31           0 :         "alpha", "Number of values must equal number of variable components (", _count, ").");
      32             : 
      33         130 :   _alpha /= 2;
      34         130 : }
      35             : 
      36             : void
      37       48608 : ArrayVacuumBC::computeQpResidual(RealEigenVector & residual)
      38             : {
      39       48608 :   residual = _alpha.cwiseProduct(_u[_qp]) * _test[_i][_qp];
      40       48608 : }
      41             : 
      42             : RealEigenVector
      43      239008 : ArrayVacuumBC::computeQpJacobian()
      44             : {
      45      478016 :   return _test[_i][_qp] * _phi[_j][_qp] * _alpha;
      46             : }

Generated by: LCOV version 1.14