https://mooseframework.inl.gov
CoupledPressureBC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "CoupledPressureBC.h"
11 #include "PressureAction.h"
12 
13 registerMooseObject("SolidMechanicsApp", CoupledPressureBC);
14 
15 registerMoosePressureAction("SolidMechanicsApp", CoupledPressureBC, CoupledPressureAction);
16 
17 template <bool is_ad>
20 {
22  params.addClassDescription(
23  "Applies a pressure from a variable on a given boundary in a given direction");
24  params += actionParams();
25  return params;
26 }
27 
28 template <bool is_ad>
31 {
33  params.addRequiredCoupledVar("pressure", "Coupled variable containing the pressure");
34  return params;
35 }
36 
37 template <bool is_ad>
39  : PressureParent<is_ad>(parameters),
40  _pressure(this->template coupledGenericValue<is_ad>("pressure"))
41 {
42 }
43 
44 template <bool is_ad>
47 {
48  return _pressure[_qp];
49 }
50 
51 template class CoupledPressureBCTempl<true>;
52 template class CoupledPressureBCTempl<false>;
Moose::GenericType< Real, is_ad > GenericReal
registerMooseObject("SolidMechanicsApp", CoupledPressureBC)
typename std::conditional< is_ad, ADPressureBase, PressureBase >::type PressureParent
Definition: PressureBase.h:99
CoupledPressureBCTempl(const InputParameters &parameters)
InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
Pressure boundary condition using coupled variable to apply pressure in a given direction.
static InputParameters actionParams()
registerMoosePressureAction("SolidMechanicsApp", CoupledPressureBC, CoupledPressureAction)
void addClassDescription(const std::string &doc_string)
virtual GenericReal< is_ad > computePressure() const override
static InputParameters validParams()