https://mooseframework.inl.gov
IPHDGKernel.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 "IPHDGAssemblyHelper.h"
11 #include "IPHDGKernel.h"
12 
13 using namespace libMesh;
14 
17 {
18  auto params = HDGKernel::validParams();
19  return params;
20 }
21 
22 IPHDGKernel::IPHDGKernel(const InputParameters & params) : HDGKernel(params), _cached_elem(nullptr)
23 {
24 }
25 
26 void
28 {
29  auto & iphdg_helper = iphdgHelper();
30  iphdg_helper.resizeResiduals();
31  iphdg_helper.scalarVolume();
32 }
33 
34 void
36 {
37  auto & iphdg_helper = iphdgHelper();
38  iphdg_helper.resizeResiduals();
39  iphdg_helper.scalarFace();
40  iphdg_helper.lmFace();
41 }
42 
43 void
45 {
46  compute();
47  for (const auto & residual_packet : iphdgHelper().taggingData())
48  addResiduals(_assembly, residual_packet);
49 }
50 
51 void
53 {
54  compute();
55  for (const auto & residual_packet : iphdgHelper().taggingData())
56  addJacobian(_assembly, residual_packet);
57 }
58 
59 void
61 {
62  compute();
63  for (const auto & residual_packet : iphdgHelper().taggingData())
64  addResidualsAndJacobian(_assembly, residual_packet);
65 }
66 
67 void
69 {
70  computeOnSide();
71  for (const auto & residual_packet : iphdgHelper().taggingData())
72  addResiduals(_assembly, residual_packet);
73 }
74 
75 void
77 {
78  computeOnSide();
79  for (const auto & residual_packet : iphdgHelper().taggingData())
80  addJacobian(_assembly, residual_packet);
81 }
82 
83 void
85 {
86  computeOnSide();
87  for (const auto & residual_packet : iphdgHelper().taggingData())
88  addResidualsAndJacobian(_assembly, residual_packet);
89 }
90 
91 void
93 {
94  _cached_elem = nullptr;
95 }
96 
97 void
99 {
101  {
102  computeJacobian();
104  }
105 }
106 
107 std::set<std::string>
109 {
111 }
112 
113 const std::unordered_set<unsigned int> &
115 {
117 }
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const
Retrieve the set of material properties that this object depends on.
void computeOnSide()
compute the AD residuals on the element sides
Definition: IPHDGKernel.C:35
A kernel for hybridized finite element formulations.
Definition: HDGKernel.h:17
const Elem * _cached_elem
A data member used for determining when to compute the Jacobian.
Definition: IPHDGKernel.h:58
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...
virtual void computeResidual() override
Compute this Kernel&#39;s contribution to the residual.
Definition: IPHDGKernel.C:44
IPHDGKernel(const InputParameters &params)
Definition: IPHDGKernel.C:22
void compute()
compute the AD residuals on the element interior
Definition: IPHDGKernel.C:27
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const override
Retrieve the set of material properties that this object depends on.
Definition: IPHDGKernel.C:114
virtual void computeOffDiagJacobian(unsigned int jvar) override
Forwards to computeJacobian() the first time this is called for a given element.
Definition: IPHDGKernel.C:98
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 computeResidualAndJacobian() override
Compute the residual and Jacobian together.
Definition: IPHDGKernel.C:60
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
Definition: IPHDGKernel.C:16
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
virtual void computeJacobianOnSide() override
Definition: IPHDGKernel.C:76
virtual IPHDGAssemblyHelper & iphdgHelper()=0
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.
Assembly & _assembly
Reference to this Kernel&#39;s assembly object.
std::set< std::string > additionalROVariables()
virtual std::set< std::string > additionalROVariables() override
Definition: IPHDGKernel.C:108
const Elem *const & _current_elem
Current element.
Definition: KernelBase.h:37
virtual void computeResidualAndJacobianOnSide() override
Definition: IPHDGKernel.C:84
virtual void computeJacobian() override
Compute this object&#39;s entire element interior Jacobian, both on- and off-diagonal.
Definition: IPHDGKernel.C:52
static InputParameters validParams()
Definition: HDGKernel.C:14
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job...
Definition: IPHDGKernel.C:92
virtual void computeResidualOnSide() override
Definition: IPHDGKernel.C:68