https://mooseframework.inl.gov
ElementAndTraceScalarHDGAssemblyHelper.h
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 #pragma once
11 
12 #include "MooseArray.h"
13 #include "MooseFunctorForward.h"
14 #include "MooseTypes.h"
16 
17 #include <array>
18 #include <set>
19 #include <string>
20 #include <vector>
21 
22 template <typename>
23 class MooseVariableFE;
24 class Assembly;
25 class MooseObject;
27 class SystemBase;
28 class TransientInterface;
29 struct ADResidualsPacket;
30 
39 {
40 public:
42 
45  const TransientInterface * ti,
46  SystemBase & sys,
47  const Assembly & assembly,
48  THREAD_ID tid,
49  const std::set<SubdomainID> & blocks_ids,
50  const std::set<BoundaryID> & boundary_ids);
51 
53  void resizeResiduals();
54 
56  virtual void scalarVolume() = 0;
57 
59  virtual void scalarFace() = 0;
60 
62  virtual void lmFace() = 0;
63 
65  virtual void scalarDirichlet(const Moose::Functor<Real> & dirichlet_value) = 0;
66 
68  void lmDirichlet(const Moose::Functor<Real> & dirichlet_value);
69 
71  void lmPrescribedFlux(const Moose::Functor<Real> & flux_value);
72 
76  std::array<ADResidualsPacket, 2> taggingData() const;
77 
81  std::set<std::string> additionalROVariables();
82 
83  virtual ~ElementAndTraceScalarHDGAssemblyHelper() = default;
84 
85 protected:
88 
91 
94 
96  const std::vector<dof_id_type> & _u_dof_indices;
97 
99  const std::vector<dof_id_type> & _lm_u_dof_indices;
100 
103 
106 
109 
112 
115 
118 
121 
123  const Real & _side_area;
124 
126  const Elem * const & _current_elem;
127 
129  const unsigned int & _current_side;
130 
132  const Elem * const & _current_side_elem;
133 
136 
138  const libMesh::QBase * const & _qrule;
139 
142 
145 
147  const libMesh::QBase * const & _qrule_face;
148 
151 
154 
156  DenseVector<ADReal> _scalar_re;
157 
159  DenseVector<ADReal> _lm_re;
160 };
161 
162 inline void
164 {
165  _scalar_re.resize(_u_dof_indices.size());
166  _lm_re.resize(_lm_u_dof_indices.size());
167 }
const MooseVariableFE< Real > & _u_face_var
Facet trace variable.
const MooseArray< Point > & _normals
Outward unit normals on the current face.
const MooseArray< std::vector< Real > > & _lm_phi_face
Facet trace test functions evaluated on a face.
void lmPrescribedFlux(const Moose::Functor< Real > &flux_value)
Applies a prescribed flux in the facet equation.
Keeps track of stuff related to assembling.
Definition: Assembly.h:109
Class for stuff related to variables.
Definition: Adaptivity.h:33
virtual void scalarVolume()=0
Assembles the element-interior equation&#39;s volume contribution.
const MooseArray< std::vector< Real > > & _scalar_phi
Element-interior scalar test functions.
This is a wrapper that forwards calls to the implementation, which can be switched out at any time wi...
const MooseArray< Real > & _JxW_face
Face quadrature weights including the transformed Jacobian.
const MooseArray< Point > & _q_point
Physical element quadrature points.
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.
const MooseArray< ADReal > & _lm_u_sol
Facet trace values at face quadrature points.
Base class for a system (of equations)
Definition: SystemBase.h:85
const Elem *const & _current_side_elem
Current side element.
Interface for objects that needs transient capabilities.
virtual void scalarFace()=0
Assembles the element-interior equation&#39;s face contribution.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
ElementAndTraceScalarHDGAssemblyHelper(const MooseObject *moose_obj, MooseVariableDependencyInterface *mvdi, const TransientInterface *ti, SystemBase &sys, const Assembly &assembly, THREAD_ID tid, const std::set< SubdomainID > &blocks_ids, const std::set< BoundaryID > &boundary_ids)
virtual ~ElementAndTraceScalarHDGAssemblyHelper()=default
const MooseVariableFE< Real > & _u_var
Element-interior scalar variable.
Utility structure for packaging up all of the residual object&#39;s information needed to add into the sy...
This interface is designed currently for DomainUserObject where material properties on element...
const MooseArray< Point > & _q_point_face
Physical face quadrature points.
Method-neutral assembly data and operations for an element-and-trace scalar hybridized DG discretizat...
const MooseArray< ADReal > & _u_sol
Element-interior scalar values at quadrature points.
const libMesh::QBase *const & _qrule
Element quadrature rule.
virtual void lmFace()=0
Assembles the facet equation&#39;s interior-face contribution.
std::array< ADResidualsPacket, 2 > taggingData() const
const unsigned int & _current_side
Current element-side index.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
DenseVector< ADReal > _scalar_re
Residual for the element-interior scalar equation.
void lmDirichlet(const Moose::Functor< Real > &dirichlet_value)
Enforces a Dirichlet value in the facet equation.
const std::vector< dof_id_type > & _lm_u_dof_indices
Degree-of-freedom indices for the facet trace.
const TransientInterface & _ti
Transient state used to evaluate boundary functors.
const libMesh::QBase *const & _qrule_face
Face quadrature rule.
const MooseArray< std::vector< Real > > & _scalar_phi_face
Element-interior scalar test functions evaluated on a face.
const std::vector< dof_id_type > & _u_dof_indices
Degree-of-freedom indices for the element-interior scalar.
const MooseArray< Real > & _JxW
Element quadrature weights including the transformed Jacobian.
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi
Gradients of the element-interior scalar test functions.
unsigned int THREAD_ID
Definition: MooseTypes.h:237
virtual void scalarDirichlet(const Moose::Functor< Real > &dirichlet_value)=0
Assembles the element-interior equation on a Dirichlet boundary.
DenseVector< ADReal > _lm_re
Residual for the facet trace equation.