LCOV - code coverage report
Current view: top level - src/kokkos/nodalkernels - KokkosCoupledForceNodalKernel.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://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 "KokkosCoupledForceNodalKernel.h"
      11             : 
      12             : registerMooseObject("MooseApp", KokkosCoupledForceNodalKernel);
      13             : 
      14             : InputParameters
      15        9270 : KokkosCoupledForceNodalKernel::validParams()
      16             : {
      17        9270 :   InputParameters params = NodalKernel::validParams();
      18       18540 :   params.addClassDescription("Adds a force proportional to the value of the coupled variable");
      19       37080 :   params.addRequiredCoupledVar("v", "The coupled variable which provides the force");
      20       18572 :   params.addParam<Real>(
      21       18476 :       "coef", 1.0, "Coefficent ($\\sigma$) multiplier for the coupled force term.");
      22             : 
      23        9270 :   return params;
      24           0 : }
      25             : 
      26         160 : KokkosCoupledForceNodalKernel::KokkosCoupledForceNodalKernel(const InputParameters & parameters)
      27             :   : NodalKernel(parameters),
      28          64 :     _v_var(coupled("v")),
      29         128 :     _v(kokkosCoupledNodalValue("v")),
      30         192 :     _coef(getParam<Real>("coef"))
      31             : {
      32          80 :   if (_var.number() == _v_var)
      33           0 :     mooseError(
      34             :         "Coupled variable 'v' needs to be different from 'variable' with CoupledForceNodalKernel, "
      35             :         "consider using Reaction or somethig similar");
      36          80 : }

Generated by: LCOV version 1.14