www.mooseframework.org
ThermalContactAuxVarsAction.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 #include "FEProblem.h"
9 #include "AddVariableAction.h"
10 
11 #include "libmesh/string_to_enum.h"
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<Action>();
18  params.addRequiredParam<NonlinearVariableName>("variable", "The variable for thermal contact");
19 
20  MooseEnum orders(AddVariableAction::getNonlinearVariableOrders());
21  params.addParam<MooseEnum>("order", orders, "The finite element order");
22 
23  params.addParam<bool>(
24  "quadrature", false, "Whether or not to use quadrature point based gap heat transfer");
25 
26  return params;
27 }
28 
30  : Action(params)
31 {
32 }
33 
34 void
36 {
37  // We need to add variables only once per variable name. However, we don't know how many unique
38  // variable names we will have. So, we'll always add them.
39 
40  MooseEnum order = getParam<MooseEnum>("order");
41  std::string family = "LAGRANGE";
42 
43  std::string penetration_var_name = "penetration";
44 
45  const bool quadrature = getParam<bool>("quadrature");
46  if (quadrature)
47  {
48  order = "CONSTANT";
49  family = "MONOMIAL";
50  penetration_var_name = "qpoint_penetration";
51  }
52 
53  _problem->addAuxVariable(
54  penetration_var_name,
55  FEType(Utility::string_to_enum<Order>(order), Utility::string_to_enum<FEFamily>(family)));
56  _problem->addAuxVariable(
57  getGapValueName(_pars),
58  FEType(Utility::string_to_enum<Order>(order), Utility::string_to_enum<FEFamily>(family)));
59 }
static std::string getGapValueName(const InputParameters &param)
ThermalContactAuxVarsAction(const InputParameters &params)
InputParameters validParams< ThermalContactAuxVarsAction >()