https://mooseframework.inl.gov
AddSurrogateAction.C
Go to the documentation of this file.
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 
20 {
22  params.addClassDescription("Adds SurrogateTrainer and SurrogateModel objects contained within "
23  "the `[Trainers]` and `[Surrogates]` input blocks.");
24  return params;
25 }
26 
28 {
29 }
30 
31 void
33 {
34  if (_current_task == "add_trainer")
35  _problem->addUserObject(_type, _name, _moose_object_pars);
36  else if (_current_task == "add_surrogate")
37  _problem->addObject<SurrogateModel>(_type, _name, _moose_object_pars, /* threaded = */ false);
38 }
static InputParameters validParams()
virtual void act() override
const std::string & _current_task
registerMooseAction("StochasticToolsApp", AddSurrogateAction, "add_trainer")
const std::string _name
AddSurrogateAction(const InputParameters &params)
std::string _type
InputParameters _moose_object_pars
void addClassDescription(const std::string &doc_string)
std::shared_ptr< FEProblemBase > & _problem
static InputParameters validParams()