https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15registerMooseAction("StochasticToolsApp", AddSurrogateAction, "add_trainer");
16registerMooseAction("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
30
31void
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}
registerMooseAction("StochasticToolsApp", AddSurrogateAction, "add_trainer")
std::shared_ptr< FEProblemBase > & _problem
const std::string & _current_task
static InputParameters validParams()
virtual void act() override
AddSurrogateAction(const InputParameters &params)
void addClassDescription(const std::string &doc_string)
const std::string & _name
InputParameters _moose_object_pars
static InputParameters validParams()
std::string _type