www.mooseframework.org
Public Member Functions | Private Attributes | List of all members
SamplerInterface Class Reference

Interface for objects that need to use samplers. More...

#include <SamplerInterface.h>

Public Member Functions

 SamplerInterface (const MooseObject *moose_object)
 
SamplergetSampler (const std::string &name)
 Get a sampler with a given name. More...
 
SamplergetSamplerByName (const SamplerName &name)
 Get a sampler with a given name. More...
 

Private Attributes

const InputParameters_smi_params
 Parameters of the object with this interface. More...
 
FEProblemBase_smi_feproblem
 Reference to FEProblemBase instance. More...
 
THREAD_ID _smi_tid
 Thread ID. More...
 

Detailed Description

Interface for objects that need to use samplers.

Inherit from this class at a very low level to make the getSampler method available.

Definition at line 35 of file SamplerInterface.h.

Constructor & Destructor Documentation

SamplerInterface::SamplerInterface ( const MooseObject moose_object)
Parameters
paramsThe 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 27 of file SamplerInterface.C.

28  : _smi_params(moose_object->parameters()),
29  _smi_feproblem(*_smi_params.get<FEProblemBase *>("_fe_problem_base")),
30  _smi_tid(_smi_params.have_parameter<THREAD_ID>("_tid") ? _smi_params.get<THREAD_ID>("_tid") : 0)
31 {
32 }
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
const InputParameters & _smi_params
Parameters of the object with this interface.
THREAD_ID _smi_tid
Thread ID.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
unsigned int THREAD_ID
Definition: MooseTypes.h:79

Member Function Documentation

Sampler & SamplerInterface::getSampler ( const std::string &  name)

Get a sampler with a given name.

Parameters
nameThe name of the parameter key of the sampler to retrieve
Returns
The sampler with name associated with the parameter 'name'

Definition at line 35 of file SamplerInterface.C.

36 {
37  return _smi_feproblem.getSampler(_smi_params.get<SamplerName>(name), _smi_tid);
38 }
virtual Sampler & getSampler(const std::string &name, THREAD_ID tid=0)
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
const InputParameters & _smi_params
Parameters of the object with this interface.
THREAD_ID _smi_tid
Thread ID.
Sampler & SamplerInterface::getSamplerByName ( const SamplerName &  name)

Get a sampler with a given name.

Parameters
nameThe name of the sampler to retrieve
Returns
The sampler with name 'name'

Definition at line 41 of file SamplerInterface.C.

42 {
43  return _smi_feproblem.getSampler(name, _smi_tid);
44 }
virtual Sampler & getSampler(const std::string &name, THREAD_ID tid=0)
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
THREAD_ID _smi_tid
Thread ID.

Member Data Documentation

FEProblemBase& SamplerInterface::_smi_feproblem
private

Reference to FEProblemBase instance.

Definition at line 65 of file SamplerInterface.h.

Referenced by getSampler(), and getSamplerByName().

const InputParameters& SamplerInterface::_smi_params
private

Parameters of the object with this interface.

Definition at line 62 of file SamplerInterface.h.

Referenced by getSampler().

THREAD_ID SamplerInterface::_smi_tid
private

Thread ID.

Definition at line 68 of file SamplerInterface.h.

Referenced by getSampler(), and getSamplerByName().


The documentation for this class was generated from the following files: