LCOV - code coverage report
Current view: top level - include/nodalkernels - NodalKernel.h (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31706 (f8ed4a) with base bb0a08 Lines: 1 1 100.0 %
Date: 2025-11-03 17:23:24 Functions: 1 1 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             : #pragma once
      11             : 
      12             : #include "NodalKernelBase.h"
      13             : #include "MooseVariableInterface.h"
      14             : 
      15             : /**
      16             :  * Base class for creating nodal kernels with hand-coded Jacobians
      17             :  */
      18             : class NodalKernel : public NodalKernelBase, public MooseVariableInterface<Real>
      19             : {
      20             : public:
      21             :   /**
      22             :    * Class constructor.
      23             :    * @param parameters The InputParameters for the object
      24             :    */
      25             :   static InputParameters validParams();
      26             : 
      27             :   NodalKernel(const InputParameters & parameters);
      28             : 
      29             :   /**
      30             :    * Compute the residual at the current node.
      31             :    *
      32             :    * Note: This is NOT what a user would normally want to override.
      33             :    * Usually a user would override computeQpResidual()
      34             :    */
      35             :   virtual void computeResidual() override;
      36             : 
      37             :   /**
      38             :    * Compute the Jacobian at one node.
      39             :    *
      40             :    * Note: This is NOT what a user would normally want to override.
      41             :    * Usually a user would override computeQpJacobian()
      42             :    */
      43             :   virtual void computeJacobian() override;
      44             : 
      45             :   /**
      46             :    * Compute the off-diagonal Jacobian at one node.
      47             :    *
      48             :    * Note: This is NOT what a user would normally want to override.
      49             :    * Usually a user would override computeQpOffDiagJacobian()
      50             :    */
      51             :   virtual void computeOffDiagJacobian(unsigned int jvar) override;
      52             : 
      53             :   /**
      54             :    * Gets the variable this is active on
      55             :    * @return the variable
      56             :    */
      57     3351501 :   const MooseVariable & variable() const override { return _var; }
      58             : 
      59             : protected:
      60             :   /**
      61             :    * The user can override this function to compute the residual at a node.
      62             :    */
      63             :   virtual Real computeQpResidual() = 0;
      64             : 
      65             :   /**
      66             :    * The user can override this function to compute the "on-diagonal"
      67             :    * Jacobian contribution.  If not overriden,
      68             :    * returns 1.
      69             :    */
      70             :   virtual Real computeQpJacobian();
      71             : 
      72             :   /**
      73             :    * This is the virtual that derived classes should override for
      74             :    * computing an off-diagonal jacobian component.
      75             :    */
      76             :   virtual Real computeQpOffDiagJacobian(unsigned int jvar);
      77             : 
      78             :   /// variable this works on
      79             :   MooseVariable & _var;
      80             : 
      81             :   /// Value of the unknown variable this is acting on
      82             :   const VariableValue & _u;
      83             : 
      84             :   /// The aux variables to save the residual contributions to
      85             :   bool _has_save_in;
      86             :   std::vector<MooseVariableFEBase *> _save_in;
      87             :   std::vector<AuxVariableName> _save_in_strings;
      88             : 
      89             :   /// The aux variables to save the diagonal Jacobian contributions to
      90             :   bool _has_diag_save_in;
      91             :   std::vector<MooseVariableFEBase *> _diag_save_in;
      92             :   std::vector<AuxVariableName> _diag_save_in_strings;
      93             : };

Generated by: LCOV version 1.14