www.mooseframework.org
NodalAreaAction.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 /****************************************************************/
7 #include "NodalAreaAction.h"
8 
9 #include "Factory.h"
10 #include "FEProblem.h"
11 #include "Parser.h"
12 #include "MooseApp.h"
13 #include "Conversion.h"
14 
15 static unsigned int counter = 0;
16 
17 template <>
18 InputParameters
20 {
21  MooseEnum orders("FIRST SECOND THIRD FOURTH", "FIRST");
22 
23  InputParameters params = validParams<Action>();
24  params.addParam<BoundaryName>("slave", "The slave surface");
25 
26  // Set this action to build "NodalArea"
27  params.set<std::string>("type") = "NodalArea";
28  return params;
29 }
30 
31 NodalAreaAction::NodalAreaAction(const InputParameters & params) : MooseObjectAction(params) {}
32 
33 void
35 {
36  _moose_object_pars.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("slave")};
37  _moose_object_pars.set<std::vector<VariableName>>("variable") = {"nodal_area_" + _name};
38 
39  mooseAssert(_problem, "Problem pointer is NULL");
40  _moose_object_pars.set<MultiMooseEnum>("execute_on") = "initial timestep_begin";
41  _moose_object_pars.set<bool>("use_displaced_mesh") = true;
42 
43  _problem->addUserObject(
44  "NodalArea", "nodal_area_object_" + Moose::stringify(counter++), _moose_object_pars);
45 }
InputParameters validParams< NodalAreaAction >()
virtual void act()
static unsigned int counter
NodalAreaAction(const InputParameters &params)