https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PressureBaseTempl< is_ad > Class Template Referenceabstract

#include <PressureBase.h>

Inheritance diagram for PressureBaseTempl< is_ad >:
[legend]

Public Member Functions

 PressureBaseTempl (const InputParameters &parameters)
 
virtual void initialSetup () override
 

Static Public Member Functions

static InputParameters validParams ()
 
static InputParameters actionParams ()
 

Protected Member Functions

virtual GenericReal< is_ad > computePressure () const =0
 
virtual GenericReal< is_ad > computeQpResidual () override final
 

Protected Attributes

std::vector< unsigned int_disp_var
 Variable numbers of coupled displacement variables. More...
 
const unsigned int _ndisp
 Number of displacement variables. More...
 
const unsigned int _component
 displacement component to apply the bc to More...
 
Moose::CoordinateSystemType _coord_type
 Coordinate system type. More...
 
 usingTransientInterfaceMembers
 

Detailed Description

template<bool is_ad>
class PressureBaseTempl< is_ad >

Definition at line 29 of file PressureBase.h.

Constructor & Destructor Documentation

◆ PressureBaseTempl()

template<bool is_ad>
PressureBaseTempl< is_ad >::PressureBaseTempl ( const InputParameters parameters)

Definition at line 39 of file PressureBase.C.

40  : PressureBaseParent<is_ad>(parameters),
41  _ndisp(this->coupledComponents("displacements")),
42  _component(
43  [this, &parameters]()
44  {
45  for (unsigned int i = 0; i < _ndisp; ++i)
46  _disp_var.push_back(this->coupled("displacements", i));
47 
48  for (unsigned int i = 0; i < _ndisp; ++i)
49  {
50  if (_var.number() == _disp_var[i])
51  {
52  if (parameters.isParamSetByUser("component") &&
53  i != this->template getParam<unsigned int>("component"))
54  this->paramError(
55  "component",
56  "The component this BC is acting on is now inferred from the position "
57  "of the `variable` in the `displacements` variable list. The explicitly "
58  "specified component value is at odds with teh automatically inferred "
59  "value. The `component` parameter has been deprecated. Please double "
60  "check your input for potential mestakes.");
61  return i;
62  }
63  }
64 
65  this->paramError("variable", "The BC variable should be a displacement variable.");
66  }())
67 {
68 }
typename std::conditional< is_ad, ADIntegratedBC, IntegratedBC >::type PressureBaseParent
Pressure applies a pressure on a given boundary in the direction defined by component.
Definition: PressureBase.h:26
std::vector< unsigned int > _disp_var
Variable numbers of coupled displacement variables.
Definition: PressureBase.h:45
const unsigned int _component
displacement component to apply the bc to
Definition: PressureBase.h:51
bool isParamSetByUser(const std::string &name) const
const unsigned int _ndisp
Number of displacement variables.
Definition: PressureBase.h:48

Member Function Documentation

◆ actionParams()

template<bool is_ad>
InputParameters PressureBaseTempl< is_ad >::actionParams ( )
static

Definition at line 30 of file PressureBase.C.

31 {
32  auto params = emptyInputParameters();
33  params.addRequiredCoupledVar("displacements",
34  "The string of displacements suitable for the problem statement");
35  return params;
36 }
InputParameters emptyInputParameters()

◆ computePressure()

template<bool is_ad>
virtual GenericReal<is_ad> PressureBaseTempl< is_ad >::computePressure ( ) const
protectedpure virtual

◆ computeQpResidual()

template<bool is_ad>
GenericReal< is_ad > PressureBaseTempl< is_ad >::computeQpResidual ( )
finaloverrideprotectedvirtual

Definition at line 92 of file PressureBase.C.

93 {
94  return computePressure() * (_normals[_qp](_component) * _test[_i][_qp]);
95 }
virtual GenericReal< is_ad > computePressure() const =0
const unsigned int _component
displacement component to apply the bc to
Definition: PressureBase.h:51

◆ initialSetup()

template<bool is_ad>
void PressureBaseTempl< is_ad >::initialSetup ( )
overridevirtual

Definition at line 72 of file PressureBase.C.

73 {
74  auto boundary_ids = this->boundaryIDs();
75  std::set<SubdomainID> block_ids;
76  for (auto bndry_id : boundary_ids)
77  {
78  auto bids = _mesh.getBoundaryConnectedBlocks(bndry_id);
79  block_ids.insert(bids.begin(), bids.end());
80  }
81 
82  _coord_type = _fe_problem.getCoordSystem(*block_ids.begin());
83  for (auto blk_id : block_ids)
84  {
85  if (_coord_type != _fe_problem.getCoordSystem(blk_id))
86  mooseError("The Pressure BC requires subdomains to have the same coordinate system.");
87  }
88 }
void mooseError(Args &&... args)
Moose::CoordinateSystemType _coord_type
Coordinate system type.
Definition: PressureBase.h:54

◆ validParams()

template<bool is_ad>
InputParameters PressureBaseTempl< is_ad >::validParams ( )
static

Definition at line 19 of file PressureBase.C.

20 {
22  params.addDeprecatedParam<unsigned int>(
23  "component", "The component for the pressure", "This parameter is no longer necessary");
24  params.addParam<bool>("use_displaced_mesh", true, "Whether to use the displaced mesh.");
25  return params;
26 }
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
InputParameters validParams()

Member Data Documentation

◆ _component

template<bool is_ad>
const unsigned int PressureBaseTempl< is_ad >::_component
protected

displacement component to apply the bc to

Definition at line 51 of file PressureBase.h.

◆ _coord_type

template<bool is_ad>
Moose::CoordinateSystemType PressureBaseTempl< is_ad >::_coord_type
protected

Coordinate system type.

Definition at line 54 of file PressureBase.h.

◆ _disp_var

template<bool is_ad>
std::vector<unsigned int> PressureBaseTempl< is_ad >::_disp_var
protected

Variable numbers of coupled displacement variables.

Definition at line 45 of file PressureBase.h.

Referenced by PressureBaseTempl< false >::PressureBaseTempl().

◆ _ndisp

template<bool is_ad>
const unsigned int PressureBaseTempl< is_ad >::_ndisp
protected

Number of displacement variables.

Definition at line 48 of file PressureBase.h.

Referenced by PressureBaseTempl< false >::PressureBaseTempl().

◆ usingTransientInterfaceMembers

template<bool is_ad>
PressureBaseTempl< is_ad >::usingTransientInterfaceMembers
protected

Definition at line 56 of file PressureBase.h.


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