Interface for objects that need to use samplers. More...
#include <SamplerInterface.h>
Public Member Functions | |
SamplerInterface (const MooseObject *moose_object) | |
template<typename T = Sampler> | |
T & | getSampler (const std::string &name) |
Get a sampler with a given name. More... | |
template<typename T = Sampler> | |
T & | getSamplerByName (const SamplerName &name) |
Get a sampler with a given name. More... | |
template<> | |
Sampler & | getSampler (const std::string &name) |
template<> | |
Sampler & | getSamplerByName (const SamplerName &name) |
Static Public Member Functions | |
static InputParameters | validParams () |
Private Attributes | |
const InputParameters & | _si_params |
Parameters of the object with this interface. More... | |
FEProblemBase & | _si_feproblem |
Reference to FEProblemBase instance. More... | |
THREAD_ID | _si_tid |
Thread ID. More... | |
Interface for objects that need to use samplers.
This practically adds two methods for getting Sampler objects:
getSampler
or getSamplerByName
without a template parameter and you will get a Sampler
base object (see SamplerInterface.C for the template specialization).getSampler<MySampler>
or getSamplerByName<MySampler>
to perform a cast to the desired type, as done for UserObjects. Definition at line 28 of file SamplerInterface.h.
SamplerInterface::SamplerInterface | ( | 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 getSampler only needs to use the name on the left hand side of the statement "sampler = sampler_name" |
Definition at line 21 of file SamplerInterface.C.
Sampler& SamplerInterface::getSampler | ( | const std::string & | name | ) |
Definition at line 30 of file SamplerInterface.C.
T & SamplerInterface::getSampler | ( | const std::string & | name | ) |
Get a sampler with a given name.
name | The name of the parameter key of the sampler to retrieve |
Definition at line 70 of file SamplerInterface.h.
Sampler& SamplerInterface::getSamplerByName | ( | const SamplerName & | name | ) |
Definition at line 37 of file SamplerInterface.C.
T & SamplerInterface::getSamplerByName | ( | const SamplerName & | name | ) |
Get a sampler with a given name.
name | The name of the sampler to retrieve |
Definition at line 77 of file SamplerInterface.h.
|
static |
Definition at line 16 of file SamplerInterface.C.
|
private |
Reference to FEProblemBase instance.
Definition at line 62 of file SamplerInterface.h.
Referenced by getSampler(), and getSamplerByName().
|
private |
Parameters of the object with this interface.
Definition at line 59 of file SamplerInterface.h.
Referenced by getSampler().
|
private |