LCOV - code coverage report
Current view: top level - src/actions - AddKernelAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31761 (28487c) with base 701993 Lines: 15 17 88.2 %
Date: 2025-11-11 13:51:07 Functions: 3 3 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 "AddKernelAction.h"
      11             : #include "FEProblem.h"
      12             : 
      13             : registerMooseAction("MooseApp", AddKernelAction, "add_kernel");
      14             : 
      15             : registerMooseAction("MooseApp", AddKernelAction, "add_aux_kernel");
      16             : 
      17             : InputParameters
      18      122852 : AddKernelAction::validParams()
      19             : {
      20      122852 :   InputParameters params = MooseObjectAction::validParams();
      21      122852 :   params.addClassDescription("Add a Kernel object to the simulation.");
      22      122852 :   return params;
      23           0 : }
      24             : 
      25      122255 : AddKernelAction::AddKernelAction(const InputParameters & params) : MooseObjectAction(params) {}
      26             : 
      27             : void
      28      119754 : AddKernelAction::act()
      29             : {
      30             : #ifdef MOOSE_KOKKOS_ENABLED
      31       81228 :   if (_moose_object_pars.isParamValid(MooseBase::kokkos_object_param))
      32             :   {
      33        1785 :     if (_current_task == "add_kernel")
      34        1469 :       _problem->addKokkosKernel(_type, _name, _moose_object_pars);
      35             :     else
      36         316 :       _problem->addKokkosAuxKernel(_type, _name, _moose_object_pars);
      37             :   }
      38             :   else
      39             : #endif
      40             :   {
      41      117969 :     if (_current_task == "add_kernel")
      42       83571 :       _problem->addKernel(_type, _name, _moose_object_pars);
      43             :     else
      44             :     {
      45      103194 :       if (getAllTasks().find("add_aux_bc") != getAllTasks().end())
      46           0 :         mooseWarning("The [AuxBCs] block is deprecated, all AuxKernels including both block and "
      47             :                      "boundary restricted should be added within the [AuxKernels] block");
      48             : 
      49       34398 :       _problem->addAuxKernel(_type, _name, _moose_object_pars);
      50             :     }
      51             :   }
      52      119384 : }

Generated by: LCOV version 1.14