www.mooseframework.org
CavityPressurePPAction.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 "Factory.h"
9 #include "FEProblem.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Action>();
16  params.addParam<std::string>("output", "The name to use for the cavity pressure value");
17  params.addParam<std::string>("output_initial_moles",
18  "The name to use when reporting the initial moles of gas");
19  return params;
20 }
21 
22 CavityPressurePPAction::CavityPressurePPAction(InputParameters params) : Action(params) {}
23 
24 void
26 {
27  std::string uo_name = _name + "UserObject";
28 
29  InputParameters params = _factory.getValidParams("CavityPressurePostprocessor");
30  params.set<MultiMooseEnum>("execute_on") = "initial linear";
31  params.set<UserObjectName>("cavity_pressure_uo") = uo_name;
32  params.set<std::string>("quantity") = "cavity_pressure";
33 
34  _problem->addPostprocessor("CavityPressurePostprocessor",
35  isParamValid("output") ? getParam<std::string>("output") : _name,
36  params);
37 
38  if (isParamValid("output_initial_moles"))
39  {
40  params.set<std::string>("quantity") = "initial_moles";
41  _problem->addPostprocessor(
42  "CavityPressurePostprocessor", getParam<std::string>("output_initial_moles"), params);
43  }
44 }
CavityPressurePPAction(InputParameters params)
InputParameters validParams< CavityPressurePPAction >()