https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SamplerInterface.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "SamplerInterface.h"
11#include "Sampler.h"
12#include "SubProblem.h"
13#include "MooseTypes.h"
14
20
22 : _si_params(moose_object->parameters()),
23 _si_feproblem(*_si_params.get<FEProblemBase *>("_fe_problem_base")),
24 _si_tid(_si_params.have_parameter<THREAD_ID>("_tid") ? _si_params.get<THREAD_ID>("_tid") : 0)
25{
26}
27
28#ifdef MOOSE_KOKKOS_ENABLED
31 : _si_params(object._si_params), _si_feproblem(object._si_feproblem), _si_tid(object._si_tid)
32{
33}
34#endif
35
36template <>
37Sampler &
38SamplerInterface::getSampler(const std::string & name)
39{
40 return _si_feproblem.getSampler(_si_params.get<SamplerName>(name));
41}
42
43template <>
44Sampler &
45SamplerInterface::getSamplerByName(const SamplerName & name)
46{
47 return _si_feproblem.getSampler(name, _si_tid);
48}
InputParameters emptyInputParameters()
unsigned int THREAD_ID
Definition MooseTypes.h:237
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual Sampler & getSampler(const std::string &name, const THREAD_ID tid=0)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
Interface for objects that need to use samplers.
static InputParameters validParams()
T & getSamplerByName(const SamplerName &name)
Get a sampler with a given name.
T & getSampler(const std::string &name)
Get a sampler with a given name.
const InputParameters & _si_params
Parameters of the object with this interface.
SamplerInterface(const MooseObject *moose_object)
FEProblemBase & _si_feproblem
Reference to FEProblemBase instance.
THREAD_ID _si_tid
Thread ID.
This is the base class for Samplers as used within the Stochastic Tools module.
Definition Sampler.h:52