Interface for objects that need to use samplers. More...
#include <SurrogateModelInterface.h>
Public Member Functions | |
SurrogateModelInterface (const MooseObject *moose_object) | |
template<> | |
SurrogateModel & | getSurrogateModelByName (const UserObjectName &name) const |
template<> | |
SurrogateModel & | getSurrogateModel (const std::string &name) const |
template<> | |
SurrogateTrainerBase & | getSurrogateTrainerByName (const UserObjectName &name) const |
template<> | |
SurrogateTrainerBase & | getSurrogateTrainer (const std::string &name) const |
template<typename T = SurrogateModel> | |
T & | getSurrogateModel (const std::string &name) const |
Get a SurrogateModel/Trainer with a given name. More... | |
template<typename T = SurrogateTrainerBase> | |
T & | getSurrogateTrainer (const std::string &name) const |
template<typename T = SurrogateModel> | |
T & | getSurrogateModelByName (const UserObjectName &name) const |
Get a sampler with a given name. More... | |
template<typename T = SurrogateTrainerBase> | |
T & | getSurrogateTrainerByName (const UserObjectName &name) const |
Static Public Member Functions | |
static InputParameters | validParams () |
Private Attributes | |
const InputParameters & | _smi_params |
Parameters of the object with this interface. More... | |
FEProblemBase & | _smi_feproblem |
Reference to FEProblemBase instance. More... | |
const THREAD_ID | _smi_tid |
Thread ID. More... | |
Interface for objects that need to use samplers.
This practically adds two methods for getting SurrogateModel objects:
getSurrogateModel
or getSurrogateModelByName
without a template parameter and you will get a SurrogateModel
base object (see SurrogateModelInterface.C for the template specialization).getSurrogateModel<MySurrogateModel>
or getSurrogateModelByName<MySurrogateModel>
to perform a cast to the desired type, as done for UserObjects. Definition at line 31 of file SurrogateModelInterface.h.
SurrogateModelInterface::SurrogateModelInterface | ( | const MooseObject * | moose_object | ) |
params | The parameters used by the object being instantiated. This class needs them so it can get the sampler named in the input file, but the object calling getSurrogateModel only needs to use the name on the left hand side of the statement "sampler = sampler_name" |
Definition at line 22 of file SurrogateModelInterface.C.
SurrogateModel& SurrogateModelInterface::getSurrogateModel | ( | const std::string & | name | ) | const |
Definition at line 46 of file SurrogateModelInterface.C.
T & SurrogateModelInterface::getSurrogateModel | ( | const std::string & | name | ) | const |
Get a SurrogateModel/Trainer with a given name.
name | The name of the parameter key of the sampler to retrieve |
Definition at line 81 of file SurrogateModelInterface.h.
Referenced by SurrogateTrainer::initialize().
SurrogateModel& SurrogateModelInterface::getSurrogateModelByName | ( | const UserObjectName & | name | ) | const |
Definition at line 31 of file SurrogateModelInterface.C.
T & SurrogateModelInterface::getSurrogateModelByName | ( | const UserObjectName & | name | ) | const |
Get a sampler with a given name.
name | The name of the sampler to retrieve |
Definition at line 88 of file SurrogateModelInterface.h.
Referenced by CrossValidationScores::CrossValidationScores(), EvaluateSurrogate::EvaluateSurrogate(), and InverseMapping::initialSetup().
T & SurrogateModelInterface::getSurrogateTrainer | ( | const std::string & | name | ) | const |
Definition at line 104 of file SurrogateModelInterface.h.
SurrogateTrainerBase& SurrogateModelInterface::getSurrogateTrainer | ( | const std::string & | name | ) | const |
Definition at line 60 of file SurrogateModelInterface.C.
SurrogateTrainerBase& SurrogateModelInterface::getSurrogateTrainerByName | ( | const UserObjectName & | name | ) | const |
Definition at line 53 of file SurrogateModelInterface.C.
T & SurrogateModelInterface::getSurrogateTrainerByName | ( | const UserObjectName & | name | ) | const |
Definition at line 111 of file SurrogateModelInterface.h.
Referenced by SurrogateTrainerOutput::output().
|
static |
Definition at line 17 of file SurrogateModelInterface.C.
Referenced by GaussianProcessData::validParams(), SurrogateModelScalarAux::validParams(), DRLRewardReporter::validParams(), LibtorchNeuralNetControlTransfer::validParams(), EvaluateSurrogate::validParams(), PODSurrogateTester::validParams(), SurrogateModel::validParams(), and SurrogateModelAuxKernelTempl< ComputeValueType >::validParams().
|
private |
Reference to FEProblemBase instance.
Definition at line 73 of file SurrogateModelInterface.h.
Referenced by getSurrogateModelByName(), and getSurrogateTrainerByName().
|
private |
Parameters of the object with this interface.
Definition at line 70 of file SurrogateModelInterface.h.
Referenced by getSurrogateModel(), and getSurrogateTrainer().
|
private |
Thread ID.
Definition at line 76 of file SurrogateModelInterface.h.
Referenced by getSurrogateTrainerByName().