https://mooseframework.inl.gov
IPHDGBC.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 
10 #include "IPHDGBC.h"
11 #include "IPHDGAssemblyHelper.h"
12 
15 {
17 }
18 
19 IPHDGBC::IPHDGBC(const InputParameters & parameters)
20  : ADIntegratedBC(parameters), _cached_elem(nullptr), _cached_side(libMesh::invalid_uint)
21 {
22 }
23 
24 void
26 {
27  compute();
28  for (const auto & residual_packet : iphdgHelper().taggingData())
29  addResiduals(_assembly, residual_packet);
30 }
31 
32 void
34 {
35  compute();
36  for (const auto & residual_packet : iphdgHelper().taggingData())
37  addJacobian(_assembly, residual_packet);
38 }
39 
40 void
42 {
43  compute();
44  for (const auto & residual_packet : iphdgHelper().taggingData())
45  addResidualsAndJacobian(_assembly, residual_packet);
46 }
47 
48 void
50 {
51  _cached_elem = nullptr;
53 }
54 
55 void
57 {
59  {
63  }
64 }
65 
66 const std::unordered_set<unsigned int> &
68 {
70 }
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const
Retrieve the set of material properties that this object depends on.
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const override
Retrieve the set of material properties that this object depends on.
Definition: IPHDGBC.C:67
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job...
Definition: IPHDGBC.C:49
const Elem * _cached_elem
A data member used for determining when to compute the Jacobian.
Definition: IPHDGBC.h:45
void addResidualsAndJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals and derivatives for the Jacobian, corresponding to the provided d...
IPHDGBC(const InputParameters &parameters)
Definition: IPHDGBC.C:19
const unsigned int invalid_uint
virtual void computeResidualAndJacobian() override
Compute this object&#39;s contribution to the residual and Jacobian simultaneously.
Definition: IPHDGBC.C:41
const Elem *const & _current_elem
current element
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.
static InputParameters validParams()
Definition: IPHDGBC.C:14
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...
static InputParameters validParams()
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.
virtual void compute()=0
compute the AD residuals
virtual IPHDGAssemblyHelper & iphdgHelper()=0
Base class for deriving any boundary condition of a integrated type.
virtual void computeJacobian() override
Compute this object&#39;s contribution to the diagonal Jacobian entries.
Definition: IPHDGBC.C:33
unsigned int _cached_side
A cache variable to prevent multiple computations of Jacobians.
Definition: IPHDGBC.h:48
Assembly & _assembly
Reference to this Kernel&#39;s assembly object.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes this object&#39;s contribution to off-diagonal blocks of the system Jacobian matrix...
Definition: IPHDGBC.C:56
const unsigned int & _current_side
current side of the current element
virtual void computeResidual() override
Compute this object&#39;s contribution to the residual.
Definition: IPHDGBC.C:25