LCOV - code coverage report
Current view: top level - src/actions - AddSurrogateAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose stochastic_tools: #31405 (292dce) with base fef103 Lines: 12 13 92.3 %
Date: 2025-09-04 07:57:52 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 "AddSurrogateAction.h"
      11             : #include "Factory.h"
      12             : #include "FEProblem.h"
      13             : #include "SurrogateModel.h"
      14             : 
      15             : registerMooseAction("StochasticToolsApp", AddSurrogateAction, "add_trainer");
      16             : registerMooseAction("StochasticToolsApp", AddSurrogateAction, "add_surrogate");
      17             : 
      18             : InputParameters
      19        3079 : AddSurrogateAction::validParams()
      20             : {
      21        3079 :   InputParameters params = MooseObjectAction::validParams();
      22        3079 :   params.addClassDescription("Adds SurrogateTrainer and SurrogateModel objects contained within "
      23             :                              "the `[Trainers]` and `[Surrogates]` input blocks.");
      24        3079 :   return params;
      25           0 : }
      26             : 
      27        3079 : AddSurrogateAction::AddSurrogateAction(const InputParameters & params) : MooseObjectAction(params)
      28             : {
      29        3079 : }
      30             : 
      31             : void
      32        3071 : AddSurrogateAction::act()
      33             : {
      34        3071 :   if (_current_task == "add_trainer")
      35        1536 :     _problem->addUserObject(_type, _name, _moose_object_pars);
      36        1535 :   else if (_current_task == "add_surrogate")
      37        3066 :     _problem->addObject<SurrogateModel>(_type, _name, _moose_object_pars, /* threaded = */ false);
      38        3047 : }

Generated by: LCOV version 1.14