www.mooseframework.org
ContactPressureVarAction.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 
9 #include "Factory.h"
10 #include "FEProblem.h"
11 #include "Parser.h"
12 #include "MooseApp.h"
13 #include "libmesh/string_to_enum.h"
14 
15 template <>
16 InputParameters
18 {
19  MooseEnum orders("CONSTANT FIRST SECOND THIRD FOURTH", "FIRST");
20 
21  InputParameters params = validParams<Action>();
22  params.addParam<MooseEnum>("order", orders, "The finite element order: " + orders.getRawNames());
23  return params;
24 }
25 
26 ContactPressureVarAction::ContactPressureVarAction(const InputParameters & params) : Action(params)
27 {
28 }
29 
30 void
32 {
33  if (!_problem->getDisplacedProblem())
34  {
35  mooseError("Contact requires updated coordinates. Use the 'displacements = ...' line in the "
36  "Mesh block.");
37  }
38 
39  _problem->addAuxVariable("contact_pressure",
40  FEType(Utility::string_to_enum<Order>(getParam<MooseEnum>("order")),
41  Utility::string_to_enum<FEFamily>("LAGRANGE")));
42 }
InputParameters validParams< ContactPressureVarAction >()
ContactPressureVarAction(const InputParameters &params)