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 30 of file SamplerInterface.h.

Constructor & Destructor Documentation

◆ SamplerInterface()

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 22 of file SamplerInterface.C.

23  : _smi_params(moose_object->parameters()),
24  _smi_feproblem(*_smi_params.get<FEProblemBase *>("_fe_problem_base")),
25  _smi_tid(_smi_params.have_parameter<THREAD_ID>("_tid") ? _smi_params.get<THREAD_ID>("_tid") : 0)
26 {
27 }
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:57
const InputParameters & _smi_params
Parameters of the object with this interface.
THREAD_ID _smi_tid
Thread ID.
unsigned int THREAD_ID
Definition: MooseTypes.h:112

Member Function Documentation

◆ getSampler()

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 30 of file SamplerInterface.C.

31 {
32  return _smi_feproblem.getSampler(_smi_params.get<SamplerName>(name), _smi_tid);
33 }
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.

◆ getSamplerByName()

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 36 of file SamplerInterface.C.

37 {
38  return _smi_feproblem.getSampler(name, _smi_tid);
39 }
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

◆ _smi_feproblem

FEProblemBase& SamplerInterface::_smi_feproblem
private

Reference to FEProblemBase instance.

Definition at line 60 of file SamplerInterface.h.

Referenced by getSampler(), and getSamplerByName().

◆ _smi_params

const InputParameters& SamplerInterface::_smi_params
private

Parameters of the object with this interface.

Definition at line 57 of file SamplerInterface.h.

Referenced by getSampler().

◆ _smi_tid

THREAD_ID SamplerInterface::_smi_tid
private

Thread ID.

Definition at line 63 of file SamplerInterface.h.

Referenced by getSampler(), and getSamplerByName().


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