www.mooseframework.org
TransientInterface.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 "TransientInterface.h"
11 #include "FEProblem.h"
12 
15 {
16 
18  params.addParam<bool>(
19  "implicit",
20  true,
21  "Determines whether this object is calculated using an implicit or explicit form");
22 
23  params.addParamNamesToGroup("implicit", "Advanced");
24  return params;
25 }
26 
28  : _ti_params(moose_object->parameters()),
29  _ti_feproblem(*_ti_params.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
30  _is_implicit(_ti_params.have_parameter<bool>("implicit") ? _ti_params.get<bool>("implicit")
31  : true),
32  _t(_is_implicit ? _ti_feproblem.time() : _ti_feproblem.timeOld()),
33  _t_step(_ti_feproblem.timeStep()),
34  _dt(_ti_feproblem.dt()),
35  _dt_old(_ti_feproblem.dtOld()),
36  _is_transient(_ti_feproblem.isTransient()),
37  _ti_name(MooseUtils::shortName(_ti_params.get<std::string>("_object_name")))
38 {
39 }
40 
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
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
InputParameters emptyInputParameters()
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:598
TransientInterface(const MooseObject *moose_object)
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
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...
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...