www.mooseframework.org
MooseObject.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 // MOOSE includes
11 #include "MooseObject.h"
12 #include "MooseApp.h"
13 #include "MooseUtils.h"
14 
15 class FEProblem;
16 class FEProblemBase;
17 class EigenProblem;
18 class SubProblem;
19 class SystemBase;
20 class AuxiliarySystem;
21 class Transient;
22 
25 {
27  params.addParam<bool>("enable", true, "Set the enabled status of the MooseObject.");
28  params.addParam<std::vector<std::string>>(
29  "control_tags",
30  "Adds user-defined labels for accessing object parameters via control logic.");
31  params.addParamNamesToGroup("enable control_tags", "Advanced");
32  params.addPrivateParam<std::string>("_type"); // The name of the class being built
33  params.addPrivateParam<std::string>("_object_name"); // The name passed to Factory::create
34  params.addPrivateParam<std::string>("_unique_name"); // The unique name generated in the warehouse
35  params.addPrivateParam<FEProblem *>("_fe_problem", nullptr);
36  params.addPrivateParam<FEProblemBase *>("_fe_problem_base", nullptr);
37  params.addPrivateParam<EigenProblem *>("_eigen_problem", nullptr);
38  params.addPrivateParam<SubProblem *>("_subproblem", nullptr);
39  params.addPrivateParam<SystemBase *>("_sys", nullptr);
40  params.addPrivateParam<SystemBase *>("_nl_sys", nullptr);
41  params.addPrivateParam<Transient *>("_executioner", nullptr);
42  params.addPrivateParam<THREAD_ID>("_tid");
43  params.addPrivateParam<bool>("_residual_object", false);
44  return params;
45 }
46 
48  : MooseBase(parameters.get<std::string>("_type"),
49  parameters.get<std::string>("_object_name"),
50  *parameters.getCheckedPointerParam<MooseApp *>("_moose_app")),
55  _enabled(getParam<bool>("enable"))
56 {
57 }
ParallelObject(const Parallel::Communicator &comm_in)
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:26
Every object that can be built by the factory should be derived from this class.
Interface for objects that need to resolve data file paths (MooseObject and Action) ...
Base class for everything in MOOSE with a name and a type.
Definition: MooseBase.h:31
void addPrivateParam(const std::string &name, const T &value)
These method add a parameter to the InputParameters object which can be retrieved like any other para...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Definition: FEProblem.h:20
Interface that provides APIs to output errors/warnings/info messages.
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
Definition: MooseUtils.h:1147
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:47
Base class for MOOSE-based applications.
Definition: MooseApp.h:69
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for a system (of equations)
Definition: SystemBase.h:84
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:33
const bool & _enabled
Reference to the "enable" InputParameters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:53
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:75
const InputParameters & parameters() const
Get the parameters of the object.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
Problem for solving eigenvalue problems.
Definition: EigenProblem.h:21
static InputParameters validParams()
Definition: MooseObject.C:24
A system that holds auxiliary variables.
unsigned int THREAD_ID
Definition: MooseTypes.h:198
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...