https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PressureBase.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://www.mooseframework.org
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#pragma once
11
12#include "ADIntegratedBC.h"
13#include "IntegratedBC.h"
14#include "MooseTypes.h"
15
16#include "MooseTypes.h"
17#include "libmesh/quadrature_gauss.h"
18
19class Function;
20
25template <bool is_ad>
26using PressureBaseParent = typename std::conditional<is_ad, ADIntegratedBC, IntegratedBC>::type;
27
28template <bool is_ad>
30{
31public:
34
35 PressureBaseTempl(const InputParameters & parameters);
36
37 virtual void initialSetup() override;
38
39protected:
41
42 virtual GenericReal<is_ad> computeQpResidual() override final;
43
45 std::vector<unsigned int> _disp_var;
46
48 const unsigned int _ndisp;
49
51 const unsigned int _component;
52
54 Moose::CoordinateSystemType _coord_type;
55
57 using PressureBaseParent<is_ad>::_assembly;
58 using PressureBaseParent<is_ad>::_fe_problem;
59 using PressureBaseParent<is_ad>::_i;
60 using PressureBaseParent<is_ad>::_mesh;
61 using PressureBaseParent<is_ad>::_name;
62 using PressureBaseParent<is_ad>::_normals;
63 using PressureBaseParent<is_ad>::_q_point;
64 using PressureBaseParent<is_ad>::_qp;
65 using PressureBaseParent<is_ad>::_sys;
66 using PressureBaseParent<is_ad>::_test;
67 using PressureBaseParent<is_ad>::_var;
68};
69
70class PressureBase : public PressureBaseTempl<false>
71{
72public:
73 PressureBase(const InputParameters & parameters);
74
75protected:
76 virtual Real computeQpJacobian() override final;
77 virtual void precalculateQpJacobian() override final;
78 virtual Real computeQpOffDiagJacobian(const unsigned int jvar_num) override final;
79 virtual void precalculateQpOffDiagJacobian(const MooseVariableFEBase & jvar) override final;
80
81 Real computeStiffness(const unsigned int coupled_component);
82 Real computeFaceStiffness(const unsigned int local_j, const unsigned int coupled_component);
83
84 const std::vector<RealGradient> * _q_dxi;
85 const std::vector<RealGradient> * _q_deta;
86 const std::vector<std::vector<Real>> * _phi_dxi;
87 const std::vector<std::vector<Real>> * _phi_deta;
89
90 // One FE for each thread
91 std::vector<std::unique_ptr<FEBase>> _fe;
92
93 std::map<unsigned int, unsigned int> _node_map;
94};
95
97
98template <bool is_ad>
99using PressureParent = typename std::conditional<is_ad, ADPressureBase, PressureBase>::type;
Moose::GenericType< Real, is_ad > GenericReal
PressureBaseTempl< true > ADPressureBase
typename std::conditional< is_ad, ADIntegratedBC, IntegratedBC >::type PressureBaseParent
Pressure applies a pressure on a given boundary in the direction defined by component.
typename std::conditional< is_ad, ADPressureBase, PressureBase >::type PressureParent
virtual GenericReal< is_ad > computeQpResidual() override final
static InputParameters actionParams()
Moose::CoordinateSystemType _coord_type
Coordinate system type.
const unsigned int _ndisp
Number of displacement variables.
virtual GenericReal< is_ad > computePressure() const =0
virtual void initialSetup() override
std::vector< unsigned int > _disp_var
Variable numbers of coupled displacement variables.
static InputParameters validParams()
const unsigned int _component
displacement component to apply the bc to
std::vector< std::unique_ptr< FEBase > > _fe
const std::vector< std::vector< Real > > * _phi_deta
std::map< unsigned int, unsigned int > _node_map
const std::vector< RealGradient > * _q_deta
const bool _use_displaced_mesh
const std::vector< RealGradient > * _q_dxi
const std::vector< std::vector< Real > > * _phi_dxi