LCOV - code coverage report
Current view: top level - include/kokkos/kernels - KokkosCoupledTimeDerivative.h (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 5 6 83.3 %
Date: 2026-05-29 20:35:17 Functions: 2 2 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 "KokkosKernelValue.h"
      13             : 
      14             : /**
      15             :  * This calculates the time derivative for a coupled variable
      16             :  **/
      17             : class KokkosCoupledTimeDerivative : public Moose::Kokkos::KernelValue
      18             : {
      19             : public:
      20             :   static InputParameters validParams();
      21             : 
      22             :   KokkosCoupledTimeDerivative(const InputParameters & parameters);
      23             : 
      24             :   template <typename Derived>
      25             :   KOKKOS_FUNCTION Real computeQpResidual(const unsigned int qp, AssemblyDatum & datum) const;
      26             :   template <typename Derived>
      27             :   KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int j,
      28             :                                                 const unsigned int jvar,
      29             :                                                 const unsigned int qp,
      30             :                                                 AssemblyDatum & datum) const;
      31             : 
      32             : protected:
      33             :   const Moose::Kokkos::VariableValue _v_dot;
      34             :   const Moose::Kokkos::Scalar<const Real> _dv_dot;
      35             :   const unsigned int _v_var;
      36             : };
      37             : 
      38             : template <typename Derived>
      39             : KOKKOS_FUNCTION Real
      40      250000 : KokkosCoupledTimeDerivative::computeQpResidual(const unsigned int qp, AssemblyDatum & datum) const
      41             : {
      42      250000 :   return _v_dot(datum, qp);
      43             : }
      44             : 
      45             : template <typename Derived>
      46             : KOKKOS_FUNCTION Real
      47        8800 : KokkosCoupledTimeDerivative::computeQpOffDiagJacobian(const unsigned int j,
      48             :                                                       const unsigned int jvar,
      49             :                                                       const unsigned int qp,
      50             :                                                       AssemblyDatum & datum) const
      51             : {
      52        8800 :   if (jvar == _v_var)
      53        8800 :     return _phi(datum, j, qp) * _dv_dot;
      54             :   else
      55           0 :     return 0;
      56             : }

Generated by: LCOV version 1.14