LCOV - code coverage report
Current view: top level - src/actions - THMAddControlAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 15 17 88.2 %
Date: 2026-05-29 20:41:18 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 "THMAddControlAction.h"
      11             : #include "THMProblem.h"
      12             : #include "FEProblem.h"
      13             : #include "Factory.h"
      14             : #include "Control.h"
      15             : #include "THMControl.h"
      16             : 
      17             : registerMooseAction("ThermalHydraulicsApp", THMAddControlAction, "THM:add_control_logic");
      18             : 
      19             : InputParameters
      20        5423 : THMAddControlAction::validParams()
      21             : {
      22        5423 :   InputParameters params = AddControlAction::validParams();
      23        5423 :   params.addClassDescription("Adds Controls from the ControlLogic block.");
      24        5423 :   return params;
      25           0 : }
      26             : 
      27        5423 : THMAddControlAction::THMAddControlAction(const InputParameters & parameters)
      28        5423 :   : AddControlAction(parameters)
      29             : {
      30        5423 : }
      31             : 
      32             : void
      33        5407 : THMAddControlAction::act()
      34             : {
      35        5407 :   THMProblem * thm_problem = dynamic_cast<THMProblem *>(_problem.get());
      36        5407 :   if (thm_problem)
      37             :   {
      38        5407 :     _moose_object_pars.addPrivateParam<FEProblemBase *>("_fe_problem_base", _problem.get());
      39        5407 :     _moose_object_pars.addPrivateParam<THMProblem *>("_thm_problem", thm_problem);
      40        5407 :     std::shared_ptr<Control> control = _factory.create<Control>(_type, _name, _moose_object_pars);
      41       16215 :     _problem->getControlWarehouse().addObject(control);
      42             :   }
      43             :   else
      44           0 :     AddControlAction::act();
      45        5405 : }

Generated by: LCOV version 1.14