LCOV - code coverage report
Current view: top level - src/nodalkernels - ADArrayNodalKernel.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 27 29 93.1 %
Date: 2026-05-29 20:35:17 Functions: 5 5 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 "ADArrayNodalKernel.h"
      11             : #include "SubProblem.h"
      12             : #include "SystemBase.h"
      13             : #include "MooseVariableFE.h"
      14             : #include "Assembly.h"
      15             : 
      16             : InputParameters
      17        3105 : ADArrayNodalKernel::validParams()
      18             : {
      19        3105 :   return NodalKernelBase::validParams();
      20             : }
      21             : 
      22          23 : ADArrayNodalKernel::ADArrayNodalKernel(const InputParameters & parameters)
      23             :   : NodalKernelBase(parameters),
      24             :     MooseVariableInterface<RealEigenVector>(this,
      25             :                                             true,
      26             :                                             "variable",
      27             :                                             Moose::VarKindType::VAR_SOLVER,
      28             :                                             Moose::VarFieldType::VAR_FIELD_ARRAY),
      29          46 :     _var(*mooseVariable()),
      30          23 :     _u(_var.adDofValues()),
      31          23 :     _count(_var.count()),
      32          92 :     _work_vector(_count)
      33             : {
      34          23 :   addMooseVariableDependency(mooseVariable());
      35          23 : }
      36             : 
      37             : void
      38         636 : ADArrayNodalKernel::computeResidual()
      39             : {
      40         636 :   if (!_var.isNodalDefined())
      41           0 :     return;
      42         636 :   _qp = 0;
      43         636 :   computeQpResidual(_work_vector);
      44         636 :   addResiduals(_assembly,
      45        1272 :                MetaPhysicL::raw_value(_work_vector),
      46         636 :                _var.dofIndices(),
      47         636 :                _var.arrayScalingFactor());
      48             : }
      49             : 
      50             : void
      51          87 : ADArrayNodalKernel::computeJacobian()
      52             : {
      53          87 :   if (!_var.isNodalDefined())
      54           0 :     return;
      55          87 :   _qp = 0;
      56          87 :   computeQpResidual(_work_vector);
      57          87 :   addJacobian(_assembly, _work_vector, _var.dofIndices(), _var.arrayScalingFactor());
      58             : }
      59             : 
      60             : void
      61          87 : ADArrayNodalKernel::computeOffDiagJacobian(const unsigned int)
      62             : {
      63          87 :   if (_my_node != _current_node)
      64             :   {
      65          87 :     computeJacobian();
      66          87 :     _my_node = _current_node;
      67             :   }
      68          87 : }

Generated by: LCOV version 1.14