www.mooseframework.org
Public Member Functions | List of all members
CavityPressureAction Class Reference

#include <CavityPressureAction.h>

Inheritance diagram for CavityPressureAction:
[legend]

Public Member Functions

 CavityPressureAction (const InputParameters &params)
 
virtual void act () override
 

Detailed Description

Definition at line 18 of file CavityPressureAction.h.

Constructor & Destructor Documentation

CavityPressureAction::CavityPressureAction ( const InputParameters &  params)

Definition at line 29 of file CavityPressureAction.C.

29 : Action(params) {}

Member Function Documentation

void CavityPressureAction::act ( )
overridevirtual

Definition at line 32 of file CavityPressureAction.C.

33 {
34  auto displacements = getParam<std::vector<NonlinearVariableName>>("displacements");
35  auto save_in = getParam<std::vector<AuxVariableName>>("save_in");
36 
37  unsigned int ndisp = displacements.size();
38  if (save_in.size() > 0 && save_in.size() != ndisp)
39  mooseError("Number of save_in variables should equal to the number of displacement variables ",
40  ndisp);
41 
42  InputParameters params = _factory.getValidParams("Pressure");
43  params.applyParameters(parameters());
44 
45  params.set<PostprocessorName>("postprocessor") =
46  isParamValid("output") ? getParam<std::string>("output") : _name;
47 
48  for (unsigned int i = 0; i < ndisp; ++i)
49  {
50  params.set<unsigned int>("component") = i;
51  params.set<NonlinearVariableName>("variable") = displacements[i];
52  if (!save_in.empty())
53  params.set<std::vector<AuxVariableName>>("save_in") = {save_in[i]};
54 
55  _problem->addBoundaryCondition("Pressure", _name + "_" + Moose::stringify(i), params);
56  }
57 }

The documentation for this class was generated from the following files: