LCOV - code coverage report
Current view: top level - src/bcs - ADPenaltyDirichletBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32463 (9b8a52) with base a052fd Lines: 12 13 92.3 %
Date: 2026-05-26 14:49:46 Functions: 3 3 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 "ADPenaltyDirichletBC.h"
      11             : 
      12             : registerMooseObject("MooseApp", ADPenaltyDirichletBC);
      13             : 
      14             : InputParameters
      15        3105 : ADPenaltyDirichletBC::validParams()
      16             : {
      17        3105 :   InputParameters params = ADIntegratedBC::validParams();
      18       12420 :   params.addRequiredParam<Real>("penalty", "Penalty scalar");
      19        9315 :   params.addParam<Real>("value", 0.0, "Boundary value of the variable");
      20        9315 :   params.declareControllable("value");
      21        3105 :   params.addClassDescription("Enforces a Dirichlet boundary condition "
      22             :                              "in a weak sense by penalizing differences between the current "
      23             :                              "solution and the Dirichlet data.");
      24        3105 :   return params;
      25           0 : }
      26             : 
      27          23 : ADPenaltyDirichletBC::ADPenaltyDirichletBC(const InputParameters & parameters)
      28          92 :   : ADIntegratedBC(parameters), _p(getParam<Real>("penalty")), _v(getParam<Real>("value"))
      29             : {
      30          23 : }
      31             : 
      32             : ADReal
      33     2950560 : ADPenaltyDirichletBC::computeQpResidual()
      34             : {
      35     2950560 :   return _p * _test[_i][_qp] * (-_v + _u[_qp]);
      36             : }

Generated by: LCOV version 1.14