LCOV - code coverage report
Current view: top level - src/actions - AddKernelAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 329044 Lines: 15 17 88.2 %
Date: 2026-08-03 21:12:22 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      117860 : AddKernelAction::validParams()
      19             : {
      20      117860 :   InputParameters params = MooseObjectAction::validParams();
      21      117860 :   params.addClassDescription("Add a Kernel object to the simulation.");
      22      117860 :   return params;
      23           0 : }
      24             : 
      25      117733 : AddKernelAction::AddKernelAction(const InputParameters & params) : MooseObjectAction(params) {}
      26             : 
      27             : void
      28      115843 : AddKernelAction::act()
      29             : {
      30             : #ifdef MOOSE_KOKKOS_ENABLED
      31       87568 :   if (_moose_object_pars.isKokkosObject())
      32             :   {
      33        4299 :     if (_current_task == "add_kernel")
      34        3663 :       _problem->addKokkosKernel(_type, _name, _moose_object_pars);
      35             :     else
      36         636 :       _problem->addKokkosAuxKernel(_type, _name, _moose_object_pars);
      37             :   }
      38             :   else
      39             : #endif
      40             :   {
      41      111544 :     if (_current_task == "add_kernel")
      42       79019 :       _problem->addKernel(_type, _name, _moose_object_pars);
      43             :     else
      44             :     {
      45       97575 :       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       32525 :       _problem->addAuxKernel(_type, _name, _moose_object_pars);
      50             :     }
      51             :   }
      52      115565 : }

Generated by: LCOV version 1.14