www.mooseframework.org
DistributionInterface.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "DistributionInterface.h"
11 #include "Distribution.h"
12 #include "SubProblem.h"
13 #include "MooseTypes.h"
14 
15 template <>
18 {
19  return emptyInputParameters();
20 }
21 
23  : _dni_params(moose_object->parameters()),
24  _dni_feproblem(*_dni_params.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
25  _dni_moose_object_ptr(moose_object)
26 {
27 }
28 
29 const Distribution &
30 DistributionInterface::getDistribution(const std::string & name) const
31 {
32  DistributionName dist_name = _dni_params.get<DistributionName>(name);
33  return _dni_feproblem.getDistribution(dist_name);
34 }
35 
36 const Distribution &
37 DistributionInterface::getDistributionByName(const DistributionName & name) const
38 {
39  return _dni_feproblem.getDistribution(name);
40 }
virtual Distribution & getDistribution(const std::string &name)
DistributionInterface(const MooseObject *moose_object)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
All Distributions should inherit from this class.
Definition: Distribution.h:22
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
InputParameters emptyInputParameters()
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
const Distribution & getDistributionByName(const DistributionName &name) const
Get a distribution with a given name.
FEProblemBase & _dni_feproblem
Reference to FEProblemBase instance.
const Distribution & getDistribution(const std::string &name) const
Get a distribution with a given name.
const InputParameters & _dni_params
Parameters of the object with this interface.
InputParameters validParams< DistributionInterface >()