LCOV - code coverage report
Current view: top level - src/kokkos/kernels - KokkosCoupledForce.K (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 6f668f Lines: 13 15 86.7 %
Date: 2025-09-22 20:01:15 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://www.mooseframework.org
       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 "KokkosCoupledForce.h"
      11             : 
      12             : registerMooseObject("MooseApp", KokkosCoupledForce);
      13             : 
      14             : InputParameters
      15        9176 : KokkosCoupledForce::validParams()
      16             : {
      17        9176 :   InputParameters params = Kernel::validParams();
      18             : 
      19       18352 :   params.addClassDescription("Implements a source term proportional to the value of a coupled "
      20             :                              "variable. Weak form: $(\\psi_i, -\\sigma v)$.");
      21       36704 :   params.addRequiredCoupledVar("v", "The coupled variable which provides the force");
      22       18366 :   params.addParam<Real>(
      23       18324 :       "coef", 1.0, "Coefficent ($\\sigma$) multiplier for the coupled force term.");
      24             : 
      25        9176 :   return params;
      26           0 : }
      27             : 
      28          68 : KokkosCoupledForce::KokkosCoupledForce(const InputParameters & parameters)
      29             :   : Kernel(parameters),
      30          26 :     _v_var(coupled("v")),
      31          52 :     _v(kokkosCoupledValue("v")),
      32          78 :     _coef(getParam<Real>("coef"))
      33             : {
      34          33 :   if (_var.number() == _v_var)
      35           0 :     paramError(
      36             :         "v", "Coupled variable 'v' needs to be different from 'variable' with KokkosCoupledForce.");
      37          33 : }

Generated by: LCOV version 1.14