LCOV - code coverage report
Current view: top level - src/actions - AddSurrogateAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose stochastic_tools: f45d79 Lines: 12 13 92.3 %
Date: 2025-07-25 05:00:46 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        2898 : AddSurrogateAction::validParams()
      20             : {
      21        2898 :   InputParameters params = MooseObjectAction::validParams();
      22        2898 :   params.addClassDescription("Adds SurrogateTrainer and SurrogateModel objects contained within "
      23             :                              "the `[Trainers]` and `[Surrogates]` input blocks.");
      24        2898 :   return params;
      25           0 : }
      26             : 
      27        2898 : AddSurrogateAction::AddSurrogateAction(const InputParameters & params) : MooseObjectAction(params)
      28             : {
      29        2898 : }
      30             : 
      31             : void
      32        2890 : AddSurrogateAction::act()
      33             : {
      34        2890 :   if (_current_task == "add_trainer")
      35        1448 :     _problem->addUserObject(_type, _name, _moose_object_pars);
      36        1442 :   else if (_current_task == "add_surrogate")
      37        2880 :     _problem->addObject<SurrogateModel>(_type, _name, _moose_object_pars, /* threaded = */ false);
      38        2866 : }

Generated by: LCOV version 1.14