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 21 of file CavityPressureAction.h.

Constructor & Destructor Documentation

◆ CavityPressureAction()

CavityPressureAction::CavityPressureAction ( const InputParameters &  params)

Definition at line 34 of file CavityPressureAction.C.

34 : Action(params) {}

Member Function Documentation

◆ act()

void CavityPressureAction::act ( )
overridevirtual

Definition at line 37 of file CavityPressureAction.C.

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

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