LCOV - code coverage report
Current view: top level - src/nodalkernels - PenaltyDirichletOldValuePD.C (source / functions) Hit Total Coverage
Test: idaholab/moose peridynamics: #31405 (292dce) with base fef103 Lines: 12 13 92.3 %
Date: 2025-09-04 07:55: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 "PenaltyDirichletOldValuePD.h"
      11             : 
      12             : registerMooseObject("PeridynamicsApp", PenaltyDirichletOldValuePD);
      13             : 
      14             : InputParameters
      15          11 : PenaltyDirichletOldValuePD::validParams()
      16             : {
      17          11 :   InputParameters params = NodalKernel::validParams();
      18          11 :   params.addClassDescription("Enforces a Dirichlet boundary condition "
      19             :                              "in a weak sense by penalizing differences between the current "
      20             :                              "solution and the old solution for transient problems.");
      21             : 
      22          22 :   params.addRequiredParam<Real>("penalty", "Penalty scalar");
      23             : 
      24          11 :   return params;
      25           0 : }
      26             : 
      27           6 : PenaltyDirichletOldValuePD::PenaltyDirichletOldValuePD(const InputParameters & parameters)
      28          12 :   : NodalKernel(parameters), _p(getParam<Real>("penalty")), _u_old(_var.dofValuesOld())
      29             : {
      30           6 : }
      31             : 
      32             : Real
      33        5104 : PenaltyDirichletOldValuePD::computeQpResidual()
      34             : {
      35        5104 :   return _p * (-_u_old[_qp] + _u[_qp]);
      36             : }
      37             : 
      38             : Real
      39         660 : PenaltyDirichletOldValuePD::computeQpJacobian()
      40             : {
      41         660 :   return _p;
      42             : }

Generated by: LCOV version 1.14