https://mooseframework.inl.gov
ElementAndTraceScalarHDGKernel.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 #include "TaggingInterface.h"
13 
16 {
17  return HDGKernel::validParams();
18 }
19 
21  : HDGKernel(parameters), _cached_elem(nullptr)
22 {
23 }
24 
25 void
27 {
28  helper.resizeResiduals();
29  helper.scalarVolume();
30 }
31 
32 void
34 {
35  helper.resizeResiduals();
36  helper.scalarFace();
37  helper.lmFace();
38 }
39 
40 void
42 {
43  auto & helper = hdgHelper();
44  compute(helper);
45  for (const auto & residual_packet : helper.taggingData())
46  addResiduals(_assembly, residual_packet);
47 }
48 
49 void
51 {
52  auto & helper = hdgHelper();
53  compute(helper);
54  for (const auto & residual_packet : helper.taggingData())
55  addJacobian(_assembly, residual_packet);
56 }
57 
58 void
60 {
61  auto & helper = hdgHelper();
62  compute(helper);
63  for (const auto & residual_packet : helper.taggingData())
64  addResidualsAndJacobian(_assembly, residual_packet);
65 }
66 
67 void
69 {
70  auto & helper = hdgHelper();
71  computeOnSide(helper);
72  for (const auto & residual_packet : helper.taggingData())
73  addResiduals(_assembly, residual_packet);
74 }
75 
76 void
78 {
79  auto & helper = hdgHelper();
80  computeOnSide(helper);
81  for (const auto & residual_packet : helper.taggingData())
82  addJacobian(_assembly, residual_packet);
83 }
84 
85 void
87 {
88  auto & helper = hdgHelper();
89  computeOnSide(helper);
90  for (const auto & residual_packet : helper.taggingData())
91  addResidualsAndJacobian(_assembly, residual_packet);
92 }
93 
94 void
96 {
97  _cached_elem = nullptr;
98 }
99 
100 void
102 {
104  {
105  computeJacobian();
107  }
108 }
109 
110 std::set<std::string>
112 {
113  return hdgHelper().additionalROVariables();
114 }
115 
116 const std::unordered_set<unsigned int> &
118 {
120 }
121 
122 bool
124 {
126 }
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const
Retrieve the set of material properties that this object depends on.
Base kernel for hybridized finite element formulations.
Definition: HDGKernel.h:17
virtual ElementAndTraceScalarHDGAssemblyHelper & hdgHelper()=0
Returns the helper used for common element-and-trace scalar HDG assembly.
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 computeOffDiagJacobian(unsigned int jvar) override
Computes d-residual / d-jvar... storing the result in Ke.
virtual void computeResidualAndJacobian() override
Compute the residual and Jacobian together.
virtual bool getMaterialPropertyCalled() const
Returns true if getMaterialProperty() has been called, false otherwise.
const Elem * _cached_elem
Used to assemble the complete AD Jacobian only once per element.
virtual void scalarVolume()=0
Assembles the element-interior equation&#39;s volume contribution.
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 bool getMaterialPropertyCalled() const override
Returns true if getMaterialProperty() has been called, false otherwise.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void resizeResiduals()
Resizes the element-interior and facet residual vectors for the current element.
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 scalarFace()=0
Assembles the element-interior equation&#39;s face contribution.
virtual void computeResidual() override
Compute this Kernel&#39;s contribution to the residual.
void computeOnSide(ElementAndTraceScalarHDGAssemblyHelper &helper)
Assembles the face residual data.
virtual void computeJacobian() override
Compute this Kernel&#39;s contribution to the diagonal Jacobian entries.
Assembly & _assembly
Reference to this Kernel&#39;s assembly object.
Method-neutral assembly data and operations for an element-and-trace scalar hybridized DG discretizat...
virtual void lmFace()=0
Assembles the facet equation&#39;s interior-face contribution.
virtual std::set< std::string > additionalROVariables() override
void compute(ElementAndTraceScalarHDGAssemblyHelper &helper)
Assembles the element-interior residual data.
const Elem *const & _current_elem
Current element.
Definition: KernelBase.h:37
virtual void computeResidualAndJacobianOnSide() override
static InputParameters validParams()
Definition: HDGKernel.C:14
ElementAndTraceScalarHDGKernel(const InputParameters &parameters)
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const override
Retrieve the set of material properties that this object depends on.
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job...