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.");
33 params.addRequiredCoupledVar(
"displacements",
34 "The string of displacements suitable for the problem statement");
41 _ndisp(this->coupledComponents(
"displacements")),
45 for (
unsigned int i = 0; i <
_ndisp; ++i)
46 _disp_var.push_back(this->coupled(
"displacements", i));
48 for (
unsigned int i = 0; i <
_ndisp; ++i)
53 i != this->
template getParam<unsigned int>(
"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.");
65 this->paramError(
"variable",
"The BC variable should be a displacement variable.");
74 auto boundary_ids = this->boundaryIDs();
75 std::set<SubdomainID> block_ids;
76 for (
auto bndry_id : boundary_ids)
78 auto bids = _mesh.getBoundaryConnectedBlocks(bndry_id);
79 block_ids.insert(bids.begin(), bids.end());
82 _coord_type = _fe_problem.getCoordSystem(*block_ids.begin());
83 for (
auto blk_id : block_ids)
85 if (_coord_type != _fe_problem.getCoordSystem(blk_id))
86 mooseError(
"The Pressure BC requires subdomains to have the same coordinate system.");
94 return computePressure() * (_normals[_qp](_component) * _test[_i][_qp]);
103 _use_displaced_mesh(this->template getParam<bool>(
"use_displaced_mesh")),
116 const Real phi_dxi = (*_phi_dxi)[local_j][_qp];
117 const Real phi_deta =
_phi_deta ? (*_phi_deta)[local_j][_qp] : 0;
125 dqdxi(2) * dqdeta(0) - dqdxi(0) * dqdeta(2),
126 dqdxi(0) * dqdeta(1) - dqdxi(1) * dqdeta(0));
127 const Real inv_length = 1 / (
b * _normals[_qp]);
130 const unsigned int j = coupled_component;
133 const int posneg = 1 - (
j + (2 - (i + 1) % 3)) % 3;
136 const unsigned int index = 2 - (
j + (i + 2) % 3) % 3;
138 const Real variation_b = posneg * (phi_deta * dqdxi(index) - phi_dxi * dqdeta(index));
143 rz_term = _normals[_qp](i) * _phi[_j][_qp] / _q_point[_qp](0);
146 return computePressure() * _test[_i][_qp] * (inv_length * variation_b + rz_term);
154 const std::map<unsigned int, unsigned int>::iterator j_it =
_node_map.find(_j);
155 if (_test[_i][_qp] == 0 || j_it ==
_node_map.end())
164 (2 / _q_point[_qp](0));
189 for (
unsigned int j = 0;
j <
_ndisp; ++
j)
202 if (
_fe[_tid] ==
nullptr)
204 const unsigned int dim = _sys.mesh().dimension() - 1;
205 QBase *
const & qrule = _assembly.writeableQRuleFace();
206 _fe[_tid] = FEBase::build(
dim, _var.feType());
207 _fe[_tid]->attach_quadrature_rule(qrule);
218 _fe[_tid]->reinit(_current_side_elem);
230 const unsigned int num_node_elem = _current_elem->n_nodes();
231 const Node *
const * elem_nodes = _current_elem->get_nodes();
232 const unsigned int num_node_face = _current_side_elem->n_nodes();
233 const Node *
const * face_nodes = _current_side_elem->get_nodes();
234 unsigned int num_found = 0;
235 for (
unsigned i = 0; i < num_node_elem; ++i)
237 for (
unsigned j = 0;
j < num_node_face; ++
j)
238 if (**(elem_nodes + i) == **(face_nodes +
j))
244 if (num_found == num_node_face)
Moose::GenericType< Real, is_ad > GenericReal
virtual GenericReal< is_ad > computeQpResidual() override final
typename std::conditional< is_ad, ADIntegratedBC, IntegratedBC >::type PressureBaseParent
Pressure applies a pressure on a given boundary in the direction defined by component.
const std::vector< std::vector< Real > > * _phi_dxi
void mooseError(Args &&... args)
const bool _use_displaced_mesh
virtual Real computeQpOffDiagJacobian(const unsigned int jvar_num) override final
Moose::CoordinateSystemType _coord_type
Coordinate system type.
Real computeStiffness(const unsigned int coupled_component)
std::vector< unsigned int > _disp_var
Variable numbers of coupled displacement variables.
virtual GenericReal< is_ad > computePressure() const=0
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
const std::vector< RealGradient > * _q_dxi
static InputParameters actionParams()
std::vector< std::unique_ptr< FEBase > > _fe
InputParameters validParams()
const unsigned int _component
displacement component to apply the bc to
virtual void precalculateQpJacobian() override final
static InputParameters validParams()
virtual void initialSetup() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::vector< RealGradient > * _q_deta
const unsigned int _ndisp
Number of displacement variables.
std::map< unsigned int, unsigned int > _node_map
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
virtual Real computeQpJacobian() override final
const std::vector< std::vector< Real > > * _phi_deta
PressureBaseTempl(const InputParameters ¶meters)
Real computeFaceStiffness(const unsigned int local_j, const unsigned int coupled_component)
PressureBase(const InputParameters ¶meters)
virtual void precalculateQpOffDiagJacobian(const MooseVariableFEBase &jvar) override final