LCOV - code coverage report
Current view: top level - src/actions - THMAddControlAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 15 17 88.2 %
Date: 2025-07-30 13:02:48 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       11050 : THMAddControlAction::validParams()
      21             : {
      22       11050 :   InputParameters params = AddControlAction::validParams();
      23       11050 :   params.addClassDescription("Adds Controls from the ControlLogic block.");
      24       11050 :   return params;
      25           0 : }
      26             : 
      27       11050 : THMAddControlAction::THMAddControlAction(const InputParameters & parameters)
      28       11050 :   : AddControlAction(parameters)
      29             : {
      30       11050 : }
      31             : 
      32             : void
      33       11034 : THMAddControlAction::act()
      34             : {
      35       11034 :   THMProblem * thm_problem = dynamic_cast<THMProblem *>(_problem.get());
      36       11034 :   if (thm_problem)
      37             :   {
      38       11034 :     _moose_object_pars.addPrivateParam<FEProblemBase *>("_fe_problem_base", _problem.get());
      39       11034 :     _moose_object_pars.addPrivateParam<THMProblem *>("_thm_problem", thm_problem);
      40       11034 :     std::shared_ptr<Control> control = _factory.create<Control>(_type, _name, _moose_object_pars);
      41       33096 :     _problem->getControlWarehouse().addObject(control);
      42             :   }
      43             :   else
      44           0 :     AddControlAction::act();
      45       11032 : }

Generated by: LCOV version 1.14