https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 
const unsigned int _ndisp
 Number of displacement variables.
 
const unsigned int _component
 displacement component to apply the bc to
 
Moose::CoordinateSystemType _coord_type
 Coordinate system type.
 
 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")),
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.
bool isParamSetByUser(const std::string &name) const
const unsigned int _ndisp
Number of displacement variables.
std::vector< unsigned int > _disp_var
Variable numbers of coupled displacement variables.
const unsigned int _component
displacement component to apply the bc to

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 99 of file PressureBase.C.

100{
101 return computePressure() * (_normals[_qp](_component) * _test[_i][_qp]);
102}
virtual GenericReal< is_ad > computePressure() const =0

◆ 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 if (block_ids.size())
83 _coord_type = _fe_problem.getCoordSystem(*block_ids.begin());
84 else
85 {
87 "No connected blocks were found, the coordinate system type is obtained from the mesh.");
88 _coord_type = _fe_problem.mesh().getUniqueCoordSystem();
89 }
90 for (auto blk_id : block_ids)
91 {
92 if (_coord_type != _fe_problem.getCoordSystem(blk_id))
93 mooseError("The Pressure BC requires subdomains to have the same coordinate system.");
94 }
95}
void mooseInfo(Args &&... args)
void mooseError(Args &&... args)
Moose::CoordinateSystemType _coord_type
Coordinate system type.

◆ 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)

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.

◆ _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.

◆ 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: