www.mooseframework.org
SamplerInterface.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "SamplerInterface.h"
16 #include "Sampler.h"
17 #include "SubProblem.h"
18 #include "MooseTypes.h"
19 
20 template <>
23 {
24  return emptyInputParameters();
25 }
26 
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 }
33 
34 Sampler &
35 SamplerInterface::getSampler(const std::string & name)
36 {
37  return _smi_feproblem.getSampler(_smi_params.get<SamplerName>(name), _smi_tid);
38 }
39 
40 Sampler &
41 SamplerInterface::getSamplerByName(const SamplerName & name)
42 {
43  return _smi_feproblem.getSampler(name, _smi_tid);
44 }
Sampler & getSampler(const std::string &name)
Get a sampler with a given name.
InputParameters validParams< SamplerInterface >()
This is the base class for Samplers.
Definition: Sampler.h:46
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
InputParameters emptyInputParameters()
virtual Sampler & getSampler(const std::string &name, THREAD_ID tid=0)
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
const InputParameters & _smi_params
Parameters of the object with this interface.
THREAD_ID _smi_tid
Thread ID.
SamplerInterface(const MooseObject *moose_object)
unsigned int THREAD_ID
Definition: MooseTypes.h:79
Sampler & getSamplerByName(const SamplerName &name)
Get a sampler with a given name.