https://mooseframework.inl.gov
DiffusionLHDGDirichletBC.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 
12 
14 
17 {
18  auto params = IntegratedBC::validParams();
19  params.addClassDescription("Weakly imposes Dirichlet boundary conditions for a "
20  "hybridized discretization of a diffusion equation");
21  params.addRequiredParam<MooseFunctorName>("functor",
22  "The Dirichlet value for the diffusing specie");
24  params.setDocString("variable", "The diffusing specie concentration");
25  return params;
26 }
27 
29  : IntegratedBC(parameters),
30  DiffusionLHDGAssemblyHelper(this, this, this, this, _fe_problem, _sys, _tid),
31  _dirichlet_val(getFunctor<Real>("functor")),
32  _cached_side(libMesh::invalid_uint)
33 {
34 }
35 
36 void
38 {
39  // This check must occur after FEProblemBase::init()
40  checkCoupling();
41 }
42 
43 void
45 {
46  // For notation, please read "A superconvergent LDG-hybridizable Galerkin method for second-order
47  // elliptic problems" by Cockburn
48 
52 
53  // qu, u
57  _u_sol,
59  _JxW,
60  *_qrule,
61  _normals,
64  _q_point,
65  _scalar_re);
66 
67  // Set the LMs on these Dirichlet boundary faces to 0
69 
73 }
74 
75 void
77 {
81 
84 
91 }
92 
93 void
95 {
96  _cached_elem = nullptr;
98 }
99 
100 void
102 {
104  {
105  computeJacobian();
108  }
109 }
const std::vector< dof_id_type > & _lm_u_dof_indices
const MooseArray< Number > & _u_sol
void scalarDirichletResidual(const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const Moose::Functor< Real > &dirichlet_value, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, const Elem *const current_elem, const unsigned int current_side, const MooseArray< Point > &q_point_face, DenseVector< Number > &scalar_re)
Weakly imposes a Dirichlet condition for the scalar field in the scalar field equation.
const unsigned int invalid_uint
const MooseArray< Point > & _normals
normals at quadrature points
Definition: IntegratedBC.h:85
const std::vector< dof_id_type > & _u_dof_indices
const Elem * _cached_elem
A data member used for determining when to compute the Jacobian.
unsigned int _cached_side
A cache variable to prevent multiple computations of Jacobians.
const MooseArray< std::vector< Real > > & _lm_phi_face
const Elem *const & _current_elem
current element
void resize(const unsigned int n)
void addResiduals(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals corresponding to the provided dof indices.
virtual void computeJacobian() override
Compute this object&#39;s contribution to the diagonal Jacobian entries.
static InputParameters validParams()
Definition: IntegratedBC.C:23
const MooseArray< libMesh::Gradient > & _qu_sol
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
DiffusionLHDGDirichletBC(const InputParameters &parameters)
const std::vector< dof_id_type > & _qu_dof_indices
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job...
const MooseArray< Point > & _q_point
active quadrature points
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided residual derivatives into the Jacobian for the provided dof indices.
void scalarDirichletJacobian(const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &scalar_vector_jac, DenseMatrix< Number > &scalar_scalar_jac)
Computes the Jacobian for a Dirichlet condition for the scalar field in the scalar field equation...
Weakly imposes Dirichlet boundary conditions for a hybridized discretization of diffusion.
static InputParameters validParams()
Implements all the methods for assembling a hybridized local discontinuous Galerkin (LDG-H)...
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes d-ivar-residual / d-jvar...
Base class for deriving any boundary condition of a integrated type.
Definition: IntegratedBC.h:18
void vectorDirichletResidual(const Moose::Functor< Real > &dirichlet_value, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, const Elem *const current_elem, const unsigned int current_side, const MooseArray< Point > &q_point_face, DenseVector< Number > &vector_re)
Weakly imposes a Dirichlet condition for the scalar field in the vector (gradient) equation...
Assembly & _assembly
Reference to this Kernel&#39;s assembly object.
const MooseVariableFE< Real > & _u_face_var
const QBase *const & _qrule
active quadrature rule
const unsigned int & _current_side
current side of the current element
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
const MooseVariableFE< Real > & _u_var
const MooseArray< Number > & _lm_u_sol
void createIdentityResidual(const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const MooseArray< std::vector< Real >> &phi, const MooseArray< Number > &sol, DenseVector< Number > &re)
Creates residuals corresponding to the weak form (v, {u}), or stated simply this routine can be used ...
void resize(const unsigned int new_m, const unsigned int new_n)
registerMooseObject("MooseApp", DiffusionLHDGDirichletBC)
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
const MooseVariableFE< RealVectorValue > & _grad_u_var
const Moose::Functor< Real > & _dirichlet_val
Functor computing the Dirichlet boundary value.
void createIdentityJacobian(const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const MooseArray< std::vector< Real >> &phi, DenseMatrix< Number > &ke)
As above, but for the Jacobians.
virtual void computeResidual() override
Compute this object&#39;s contribution to the residual.
const MooseArray< Real > & _JxW
transformed Jacobian weights
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.