22 "boundary",
"The list of boundary IDs from the mesh where the pressure will be applied");
24 "The nonlinear displacement variables");
25 params.
addParam<std::vector<AuxVariableName>>(
26 "save_in", {},
"Auxiliary variables to save the displacement residuals");
27 params.
addParam<std::string>(
"output",
"The name to use for the cavity pressure value");
29 "use_displaced_mesh",
true,
"Whether to use displaced mesh in the boundary condition");
30 params.
addParam<
bool>(
"use_automatic_differentiation",
32 "Flag to use automatic differentiation (AD) objects when possible");
33 params.
addParam<std::vector<TagName>>(
"extra_vector_tags",
34 "The extra tags for the vectors this Kernel should fill");
35 params.
addParam<std::vector<TagName>>(
36 "absolute_value_vector_tags",
37 "The tags for the vectors this residual object should fill with the " 38 "absolute value of the residual contribution");
44 :
Action(params), _use_ad(getParam<bool>(
"use_automatic_differentiation"))
51 auto displacements = getParam<std::vector<VariableName>>(
"displacements");
52 auto save_in = getParam<std::vector<AuxVariableName>>(
"save_in");
54 unsigned int ndisp = displacements.size();
55 if (save_in.size() > 0 && save_in.size() != ndisp)
56 mooseError(
"Number of save_in variables should equal to the number of displacement variables ",
59 std::string ad_prepend =
"";
63 std::string kernel_name = ad_prepend +
"Pressure";
68 params.
set<PostprocessorName>(
"postprocessor") =
71 for (
unsigned int i = 0; i < ndisp; ++i)
73 params.
set<NonlinearVariableName>(
"variable") = displacements[i];
75 params.
set<std::vector<AuxVariableName>>(
"save_in") = {save_in[i]};
78 _problem->addBoundaryCondition(kernel_name, unique_kernel_name, params);
InputParameters getValidParams(const std::string &name) const
CavityPressureAction(const InputParameters ¶ms)
bool isParamValid(const std::string &name) const
static InputParameters validParams()
registerMooseAction("SolidMechanicsApp", CavityPressureAction, "add_bc")
std::string stringify(const T &t)
const bool _use_ad
Flag to use automatic differentiation where possible.
virtual void act() override
static InputParameters validParams()
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const