https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
DiffusionLHDGAssemblyHelper Class Reference

Implements all the methods for assembling a hybridized local discontinuous Galerkin (LDG-H), which is a type of HDG method, discretization of the diffusion equation. More...

#include <DiffusionLHDGAssemblyHelper.h>

Inheritance diagram for DiffusionLHDGAssemblyHelper:
[legend]

Public Member Functions

 DiffusionLHDGAssemblyHelper (const MooseObject *const moose_obj, MaterialPropertyInterface *const mpi, MooseVariableDependencyInterface *const mvdi, const TransientInterface *const ti, const FEProblemBase &fe_problem, SystemBase &sys, const THREAD_ID tid)
 
void checkCoupling ()
 
template<>
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
template<>
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 

Static Public Member Functions

static InputParameters validParams ()
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 Helper to look up a functor name through the input parameter keys.
 

Protected Member Functions

void vectorVolumeResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Real > &JxW, const libMesh::QBase &qrule, DenseVector< Number > &vector_re)
 Computes a local residual vector for the weak form: (q, v) + (u, div(v)) where q is the vector field representing the gradient of u, v are its associated test functions, and u is the diffused scalar field.
 
void vectorVolumeJacobian (const MooseArray< Real > &JxW, const libMesh::QBase &qrule, DenseMatrix< Number > &vector_vector_jac, DenseMatrix< Number > &vector_scalar_jac)
 Computes a local Jacobian matrix for the weak form: (q, v) + (u, div(v)) where q is the vector field representing the gradient, v are its associated test functions, and u is the scalar field.
 
void scalarVolumeResidual (const MooseArray< Gradient > &vector_field, const Moose::Functor< Real > &source, const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const Elem *const current_elem, const MooseArray< Point > &q_point, DenseVector< Number > &scalar_re)
 Computes a local residual vector for the weak form: (Dq, grad(w)) - (f, w) where D is the diffusivity, w are the test functions associated with the scalar field, and f is a forcing function.
 
void scalarVolumeJacobian (const MooseArray< Real > &JxW, const libMesh::QBase &qrule, DenseMatrix< Number > &scalar_vector_jac)
 Computes a local Jacobian matrix for the weak form: (Dq, grad(w)) - (f, w) where D is the diffusivity, w are the test functions associated with the scalar field, and f is a forcing function.
 
void vectorFaceResidual (const MooseArray< Number > &lm_sol, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &vector_re)
 Computes a local residual vector for the weak form: -<\hat{u}, n*v> where \hat{u} is the trace of the scalar field, n is the normal vector, and v are the test functions associated with the gradient field.
 
void vectorFaceJacobian (const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &vector_lm_jac)
 Computes a local Jacobian matrix for the weak form: -<\hat{u}, n*v> where \hat{u} is the trace of the scalar field, n is the normal vector, and v are the test functions associated with the gradient field.
 
void scalarFaceResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Number > &lm_sol, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &scalar_re)
 Computes a local residual vector for the weak form: -<Dq*n, w> + <\tau * (u - \hat{u}) * n * n, w>
 
void scalarFaceJacobian (const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &scalar_vector_jac, DenseMatrix< Number > &scalar_scalar_jac, DenseMatrix< Number > &scalar_lm_jac)
 Computes a local Jacobian matrix for the weak form: -<Dq*n, w> + <\tau * (u - \hat{u}) * n * n, w>
 
void lmFaceResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Number > &lm_sol, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &lm_re)
 Computes a local residual vector for the weak form: -<Dq*n, \mu> + <\tau * (u - \hat{u}) * n * n, \mu>
 
void lmFaceJacobian (const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &lm_vec_jac, DenseMatrix< Number > &lm_scalar_jac, DenseMatrix< Number > &lm_lm_jac)
 Computes a local Jacobian matrix for the weak form: -<Dq*n, \mu> + <\tau * (u - \hat{u}) * n * n, \mu>
 
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.
 
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.
 
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.
 
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, \hat{u}), or stated simply this routine can be used to drive Lagrange multiplier values on the boundary to zero.
 
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.
 
std::string deduceFunctorName (const std::string &name) const
 Small helper to look up a functor name through the input parameter keys.
 
template<typename T >
const Moose::Functor< T > & getFunctor (const std::string &name)
 Retrieves a functor from the subproblem.
 
template<typename T >
const Moose::Functor< T > & getFunctor (const std::string &name, THREAD_ID tid)
 Retrieves a functor from the subproblem.
 
template<typename T >
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem)
 Retrieves a functor from the passed-in subproblem.
 
template<typename T >
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 Retrieves a functor from the passed-in subproblem.
 
bool isFunctor (const std::string &name) const
 Checks the subproblem for the given functor.
 
bool isFunctor (const std::string &name, const SubProblem &subproblem) const
 Checks the passed-in subproblem for the given functor.
 
Moose::ElemArg makeElemArg (const Elem *elem, bool correct_skewnewss=false) const
 Helper method to create an elemental argument for a functor that includes whether to perform skewness corrections.
 
template<typename T >
void checkFunctorSupportsSideIntegration (const std::string &name, bool qp_integration)
 Throws error if the functor does not support the requested side integration.
 
template<typename T >
const Moose::Functor< T > & getFunctorByName (const std::string &name)
 Retrieves a functor from the subproblem.
 

Protected Attributes

const MooseVariableFE< Real > & _u_var
 
const MooseVariableFE< RealVectorValue > & _grad_u_var
 
const MooseVariableFE< Real > & _u_face_var
 
const std::vector< dof_id_type > & _qu_dof_indices
 
const std::vector< dof_id_type > & _u_dof_indices
 
const std::vector< dof_id_type > & _lm_u_dof_indices
 
const MooseArray< libMesh::Gradient > & _qu_sol
 
const MooseArray< Number > & _u_sol
 
const MooseArray< Number > & _lm_u_sol
 
const MooseArray< std::vector< RealVectorValue > > & _vector_phi
 
const MooseArray< std::vector< Real > > & _scalar_phi
 
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi
 
const MooseArray< std::vector< Real > > & _div_vector_phi
 
const MooseArray< std::vector< RealVectorValue > > & _vector_phi_face
 
const MooseArray< std::vector< Real > > & _scalar_phi_face
 
const MooseArray< std::vector< Real > > & _lm_phi_face
 
const MaterialProperty< Real > & _diff
 The diffusivity.
 
const TransientInterface_ti
 Reference to transient interface.
 
const Real _tau
 Our stabilization coefficient.
 
const Elem * _cached_elem
 A data member used for determining when to compute the Jacobian.
 
DenseVector< Number > _vector_re
 
DenseVector< Number > _scalar_re
 
DenseVector< Number > _lm_re
 
DenseMatrix< Number > _vector_vector_jac
 
DenseMatrix< Number > _vector_scalar_jac
 
DenseMatrix< Number > _scalar_vector_jac
 
DenseMatrix< Number > _scalar_scalar_jac
 
DenseMatrix< Number > _scalar_lm_jac
 
DenseMatrix< Number > _lm_scalar_jac
 
DenseMatrix< Number > _lm_lm_jac
 
DenseMatrix< Number > _vector_lm_jac
 
DenseMatrix< Number > _lm_vector_jac
 

Private Member Functions

virtual bool isADObject () const override
 Whether this interface is for an AD object.
 
template<typename T >
const Moose::Functor< T > & getFunctorByName (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 Retrieves a functor from the passed-in subproblem.
 
template<typename T >
const Moose::Functor< T > * defaultFunctor (const std::string &name)
 Helper function to parse default functor values.
 
template<>
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
template<>
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 

Private Attributes

const MooseObject_moose_obj
 A reference to our associated MooseObject for error reporting.
 
const FEProblemBase_dhah_fe_problem
 A reference to the finite element problem used for coupling checks.
 
const SystemBase_dhah_sys
 A reference to the nonlinear system used for coupling checks.
 
const InputParameters_fi_params
 Parameters of the object with this interface.
 
const std::string _fi_name
 The name of the object that this interface belongs to.
 
SubProblem *const _fi_subproblem
 Pointer to subproblem if the subproblem pointer parameter was set.
 
const THREAD_ID _fi_tid
 Current threaded it.
 
std::vector< std::unique_ptr< Moose::Functor< Real > > > _default_real_functors
 Storage vector for Moose::Functor<Real> default objects.
 
std::vector< std::unique_ptr< Moose::Functor< ADReal > > > _default_ad_real_functors
 Storage vector for Moose::Functor<ADReal> default objects.
 

Detailed Description

Implements all the methods for assembling a hybridized local discontinuous Galerkin (LDG-H), which is a type of HDG method, discretization of the diffusion equation.

These routines may be called by both HDG kernels and integrated boundary conditions. The implementation here is based (but not exactly based) on "A superconvergent LDG-hybridizable Galerkin method for second-order elliptic problems" by Cockburn

Definition at line 40 of file DiffusionLHDGAssemblyHelper.h.

Constructor & Destructor Documentation

◆ DiffusionLHDGAssemblyHelper()

DiffusionLHDGAssemblyHelper::DiffusionLHDGAssemblyHelper ( const MooseObject *const  moose_obj,
MaterialPropertyInterface *const  mpi,
MooseVariableDependencyInterface *const  mvdi,
const TransientInterface *const  ti,
const FEProblemBase fe_problem,
SystemBase sys,
const THREAD_ID  tid 
)

Definition at line 37 of file DiffusionLHDGAssemblyHelper.C.

45 : ADFunctorInterface(moose_obj),
46 _u_var(sys.getFieldVariable<Real>(tid, moose_obj->getParam<NonlinearVariableName>("variable"))),
48 tid, moose_obj->getParam<NonlinearVariableName>("gradient_variable"))),
50 tid, moose_obj->getParam<NonlinearVariableName>("face_variable"))),
55 _u_sol(_u_var.sln()),
64 _diff(mpi->getMaterialProperty<Real>("diffusivity")),
65 _ti(*ti),
66 _tau(moose_obj->getParam<Real>("tau")),
67 _cached_elem(nullptr),
68 _moose_obj(*moose_obj),
69 _dhah_fe_problem(fe_problem),
70 _dhah_sys(sys)
71{
74}
An interface for accessing Moose::Functors for systems that care about automatic differentiation,...
const std::vector< dof_id_type > & _qu_dof_indices
const MooseArray< std::vector< Real > > & _scalar_phi
const SystemBase & _dhah_sys
A reference to the nonlinear system used for coupling checks.
const MooseVariableFE< Real > & _u_var
const FEProblemBase & _dhah_fe_problem
A reference to the finite element problem used for coupling checks.
const MooseArray< std::vector< RealVectorValue > > & _vector_phi_face
const MooseArray< Number > & _u_sol
const std::vector< dof_id_type > & _lm_u_dof_indices
const MooseArray< libMesh::Gradient > & _qu_sol
const MooseArray< std::vector< Real > > & _lm_phi_face
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi
const MooseArray< std::vector< Real > > & _div_vector_phi
const Elem * _cached_elem
A data member used for determining when to compute the Jacobian.
const MooseArray< Number > & _lm_u_sol
const MaterialProperty< Real > & _diff
The diffusivity.
const MooseObject & _moose_obj
A reference to our associated MooseObject for error reporting.
const TransientInterface & _ti
Reference to transient interface.
const std::vector< dof_id_type > & _u_dof_indices
const MooseArray< std::vector< RealVectorValue > > & _vector_phi
const Real _tau
Our stabilization coefficient.
const MooseVariableFE< Real > & _u_face_var
const MooseArray< std::vector< Real > > & _scalar_phi_face
const MooseVariableFE< RealVectorValue > & _grad_u_var
const MaterialProperty< T > & getMaterialProperty(const std::string &name, const unsigned int state=0)
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition MooseBase.h:406
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
Class for stuff related to variables.
const FieldVariablePhiValue & phi() const override
Return the variable's elemental shape functions.
const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
const FieldVariablePhiValue & phiFace() const override final
Return the variable's shape functions on an element face.
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
const FieldVariablePhiGradient & gradPhi() const override final
Return the gradients of the variable's elemental shape functions.
const FieldVariableValue & sln() const override
element solutions
MooseVariableFE< T > & getFieldVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition SystemBase.C:112
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ checkCoupling()

void DiffusionLHDGAssemblyHelper::checkCoupling ( )

Definition at line 77 of file DiffusionLHDGAssemblyHelper.C.

78{
79 // This check must occur after FEProblemBase::init()
81 return;
83 {
84 const auto * const cm = _dhah_fe_problem.couplingMatrix(_dhah_sys.number());
85 for (const auto i : make_range(cm->size()))
86 for (const auto j : make_range(cm->size()))
87 if ((*cm)(i, j) != true)
88 goto error;
89
90 return;
91 }
92
93error:
95 "This class encodes the full Jacobian regardless of user input file specification, "
96 "so please request full coupling for system ",
98 " in your Preconditioning block for consistency");
99}
for(PetscInt i=0;i< nvars;++i)
const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override
The coupling matrix defining what blocks exist in the preconditioning matrix.
Moose::CouplingType coupling() const
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition MooseBase.h:271
unsigned int number() const
Gets the number of this system.
virtual const std::string & name() const
@ COUPLING_FULL
Definition MooseTypes.h:787
@ COUPLING_CUSTOM
Definition MooseTypes.h:788
if(subdm)
IntRange< T > make_range(T beg, T end)

Referenced by DiffusionLHDGDirichletBC::initialSetup(), DiffusionLHDGPrescribedGradientBC::initialSetup(), and DiffusionLHDGKernel::initialSetup().

◆ checkFunctorSupportsSideIntegration()

template<typename T >
void FunctorInterface::checkFunctorSupportsSideIntegration ( const std::string &  name,
bool  qp_integration 
)
protectedinherited

Throws error if the functor does not support the requested side integration.

Parameters
[in]nameName of functor or functor parameter
[in]qp_integrationTrue if performing qp integration, false if face info

Definition at line 261 of file FunctorInterface.h.

262{
263 const std::string functor_name = deduceFunctorName(name);
264 const auto & functor = getFunctor<T>(name);
265 if (qp_integration)
266 {
267 if (!functor.supportsElemSideQpArg())
268 mooseError("Quadrature point integration was requested, but the functor '",
269 functor_name,
270 "' does not support this.");
271 }
272 else
273 {
274 if (!functor.supportsFaceArg())
275 mooseError("Face info integration was requested, but the functor '",
276 functor_name,
277 "' does not support this.");
278 }
279}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
static std::string deduceFunctorName(const std::string &name, const InputParameters &params)
Helper to look up a functor name through the input parameter keys.

◆ createIdentityJacobian()

void DiffusionLHDGAssemblyHelper::createIdentityJacobian ( const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
const MooseArray< std::vector< Real > > &  phi,
DenseMatrix< Number > &  ke 
)
protected

As above, but for the Jacobians.

Definition at line 418 of file DiffusionLHDGAssemblyHelper.C.

422{
423 for (const auto qp : make_range(qrule.n_points()))
424 for (const auto i : index_range(phi))
425 {
426 const auto qpi_term = JxW[qp] * phi[i][qp];
427 for (const auto j : index_range(phi))
428 ke(i, j) -= phi[j][qp] * qpi_term;
429 }
430}
auto index_range(const T &sizable)

Referenced by DiffusionLHDGDirichletBC::computeJacobian().

◆ createIdentityResidual()

void DiffusionLHDGAssemblyHelper::createIdentityResidual ( const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
const MooseArray< std::vector< Real > > &  phi,
const MooseArray< Number > &  sol,
DenseVector< Number > &  re 
)
protected

Creates residuals corresponding to the weak form (v, \hat{u}), or stated simply this routine can be used to drive Lagrange multiplier values on the boundary to zero.

This should be used on boundaries where there are Dirichlet conditions for the primal variables such that there is no need for the Lagrange multiplier variables

Definition at line 403 of file DiffusionLHDGAssemblyHelper.C.

408{
409 for (const auto qp : make_range(qrule.n_points()))
410 {
411 const auto qp_term = JxW[qp] * sol[qp];
412 for (const auto i : index_range(phi))
413 re(i) -= phi[i][qp] * qp_term;
414 }
415}

Referenced by DiffusionLHDGDirichletBC::computeResidual().

◆ deduceFunctorName() [1/2]

std::string FunctorInterface::deduceFunctorName ( const std::string &  name) const
protectedinherited

Small helper to look up a functor name through the input parameter keys.

Definition at line 71 of file FunctorInterface.C.

72{
73 return deduceFunctorName(name, _fi_params);
74}
const InputParameters & _fi_params
Parameters of the object with this interface.

◆ deduceFunctorName() [2/2]

std::string FunctorInterface::deduceFunctorName ( const std::string &  name,
const InputParameters params 
)
staticinherited

Helper to look up a functor name through the input parameter keys.

Parameters
nameThe input parameter name that we are trying to deduce the functor name for
paramsThe input parameters object that we will be checking for parameters named name
Returns
The functor name

Definition at line 39 of file FunctorInterface.C.

40{
41 if (params.isParamValid(name))
42 {
43 if (params.have_parameter<MooseFunctorName>(name))
44 return params.get<MooseFunctorName>(name);
45 // variables, functor material properties, functions, and post-processors are also functors
46 else if (params.have_parameter<MaterialPropertyName>(name))
47 return params.get<MaterialPropertyName>(name);
48 else if (params.have_parameter<VariableName>(name))
49 return params.get<VariableName>(name);
50 else if (params.have_parameter<std::vector<VariableName>>(name))
51 {
52 const auto & var_names = params.get<std::vector<VariableName>>(name);
53 if (var_names.size() != 1)
54 mooseError("We only support a single variable name for retrieving a functor");
55 return var_names[0];
56 }
57 else if (params.have_parameter<NonlinearVariableName>(name))
58 return params.get<NonlinearVariableName>(name);
59 else if (params.have_parameter<FunctionName>(name))
60 return params.get<FunctionName>(name);
61 else if (params.have_parameter<PostprocessorName>(name))
62 return params.get<PostprocessorName>(name);
63 else
64 mooseError("Invalid parameter type for retrieving a functor");
65 }
66 else
67 return name;
68}
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another,...
std::string name(const ElemQuality q)

Referenced by FunctorInterface::checkFunctorSupportsSideIntegration(), FunctorInterface::deduceFunctorName(), FunctorInterface::getFunctor(), and FunctorInterface::isFunctor().

◆ defaultFunctor() [1/5]

template<typename T >
const Moose::Functor< T > * FunctorInterface::defaultFunctor ( const std::string &  name)
privateinherited

Helper function to parse default functor values.

This is implemented as a specialization for supported types and returns NULL in all other cases.

Definition at line 254 of file FunctorInterface.h.

255{
256 return nullptr;
257}

◆ defaultFunctor() [2/5]

template<>
const Moose::Functor< Real > * FunctorInterface::defaultFunctor ( const std::string &  name)
privateinherited

◆ defaultFunctor() [3/5]

template<>
const Moose::Functor< ADReal > * FunctorInterface::defaultFunctor ( const std::string &  name)
privateinherited

◆ defaultFunctor() [4/5]

template<>
const Moose::Functor< Real > * FunctorInterface::defaultFunctor ( const std::string &  name)
inherited

Definition at line 78 of file FunctorInterface.C.

79{
80 std::istringstream ss(name);
81 Real real_value;
82
83 // check if the string parsed cleanly into a Real number
84 if (ss >> real_value && ss.eof())
85 {
86 _default_real_functors.emplace_back(std::make_unique<Moose::Functor<Real>>(
87 std::make_unique<Moose::ConstantFunctor<Real>>(real_value)));
88 auto & default_property = _default_real_functors.back();
89 return default_property.get();
90 }
91
92 return nullptr;
93}
std::vector< std::unique_ptr< Moose::Functor< Real > > > _default_real_functors
Storage vector for Moose::Functor<Real> default objects.
Class template for creating constant functors.
This is a wrapper that forwards calls to the implementation, which can be switched out at any time wi...

◆ defaultFunctor() [5/5]

template<>
const Moose::Functor< ADReal > * FunctorInterface::defaultFunctor ( const std::string &  name)
inherited

Definition at line 97 of file FunctorInterface.C.

98{
99 std::istringstream ss(name);
100 Real real_value;
101
102 // check if the string parsed cleanly into a Real number
103 if (ss >> real_value && ss.eof())
104 {
105 _default_ad_real_functors.emplace_back(std::make_unique<Moose::Functor<ADReal>>(
106 std::make_unique<Moose::ConstantFunctor<ADReal>>(real_value)));
107 auto & default_property = _default_ad_real_functors.back();
108 return default_property.get();
109 }
110
111 return nullptr;
112}
std::vector< std::unique_ptr< Moose::Functor< ADReal > > > _default_ad_real_functors
Storage vector for Moose::Functor<ADReal> default objects.

◆ getFunctor() [1/4]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctor ( const std::string &  name)
protectedinherited

Retrieves a functor from the subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the functor parameter name, \emph not the actual name of the functor created in the input file
Returns
The functor

Definition at line 217 of file FunctorInterface.h.

218{
219 mooseAssert(_fi_subproblem, "This must be non-null");
220 return getFunctor<T>(name, *_fi_subproblem, _fi_tid);
221}
const THREAD_ID _fi_tid
Current threaded it.
SubProblem *const _fi_subproblem
Pointer to subproblem if the subproblem pointer parameter was set.

Referenced by GenericFunctorGradientMaterialTempl< is_ad >::GenericFunctorGradientMaterialTempl(), GenericFunctorMaterialTempl< is_ad >::GenericFunctorMaterialTempl(), GenericVectorFunctorMaterialTempl< is_ad >::GenericVectorFunctorMaterialTempl(), MaterialFunctorConverterTempl< T >::MaterialFunctorConverterTempl(), and ParsedFunctorMaterialTempl< is_ad >::ParsedFunctorMaterialTempl().

◆ getFunctor() [2/4]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctor ( const std::string &  name,
SubProblem subproblem 
)
protectedinherited

Retrieves a functor from the passed-in subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the functor parameter name, \emph not the actual name of the functor created in the input file
subproblemThe subproblem to query for the functor
Returns
The functor

Definition at line 202 of file FunctorInterface.h.

203{
204 return getFunctor<T>(name, subproblem, _fi_tid);
205}

◆ getFunctor() [3/4]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctor ( const std::string &  name,
SubProblem subproblem,
THREAD_ID  tid 
)
protectedinherited

Retrieves a functor from the passed-in subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the functor parameter name, \emph not the actual name of the functor created in the input file
subproblemThe subproblem to query for the functor
tidThe thread ID used to retrieve the functor from the subproblem
Returns
The functor

Definition at line 193 of file FunctorInterface.h.

194{
195 // Check if the supplied parameter is a valid input parameter key
196 std::string functor_name = deduceFunctorName(name);
197 return getFunctorByName<T>(functor_name, subproblem, tid);
198}

◆ getFunctor() [4/4]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctor ( const std::string &  name,
THREAD_ID  tid 
)
protectedinherited

Retrieves a functor from the subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the functor parameter name, \emph not the actual name of the functor created in the input file
tidThe thread ID used to retrieve the functor from this interface's subproblem
Returns
The functor

Definition at line 209 of file FunctorInterface.h.

210{
211 mooseAssert(_fi_subproblem, "This must be non-null");
212 return getFunctor<T>(name, *_fi_subproblem, tid);
213}

◆ getFunctorByName() [1/2]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctorByName ( const std::string &  name)
protectedinherited

Retrieves a functor from the subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe name of the functor to retrieve. This should match the actual name of the functor created in the input file
Returns
The functor

Definition at line 225 of file FunctorInterface.h.

226{
227 mooseAssert(_fi_subproblem, "This must be non-null");
228 return getFunctorByName<T>(name, *_fi_subproblem, _fi_tid);
229}

◆ getFunctorByName() [2/2]

template<typename T >
const Moose::Functor< T > & FunctorInterface::getFunctorByName ( const std::string &  name,
SubProblem subproblem,
THREAD_ID  tid 
)
privateinherited

Retrieves a functor from the passed-in subproblem.

This method also leverages the ability to create default functors if the user passed an integer or real in the input file

Parameters
nameThe actual name of the functor to retrieve instead of the parameter name
subproblemThe subproblem to query for the functor
tidThe thread ID used to retrieve the functor from the subproblem
Returns
The functor

Definition at line 233 of file FunctorInterface.h.

236{
237 // Check if it's just a constant
238 const auto * const default_functor = defaultFunctor<T>(name);
239 if (default_functor)
240 return *default_functor;
241
242 return subproblem.getFunctor<T>(name, tid, _fi_name, isADObject());
243}
virtual bool isADObject() const =0
Whether this interface is for an AD object.
const std::string _fi_name
The name of the object that this interface belongs to.
const Moose::Functor< T > & getFunctor(const std::string &name, const THREAD_ID tid, const std::string &requestor_name, bool requestor_is_ad)

◆ isADObject()

virtual bool ADFunctorInterface::isADObject ( ) const
inlineoverrideprivatevirtualinherited

Whether this interface is for an AD object.

Implements FunctorInterface.

Definition at line 34 of file ADFunctorInterface.h.

34{ return true; }

◆ isFunctor() [1/2]

bool FunctorInterface::isFunctor ( const std::string &  name) const
protectedinherited

Checks the subproblem for the given functor.

This will not query default functors potentially stored in this object, e.g. this method will return false if the user passed an int or real to the functor param in the input file

Parameters
nameThe name of the functor to check. This should match the functor parameter name, \emph not the actual name of the functor created in the input file
Returns
Whether the subproblem has the specified functor

Definition at line 124 of file FunctorInterface.C.

125{
126 mooseAssert(_fi_subproblem, "This must be non-null");
127 return isFunctor(name, *_fi_subproblem);
128}
bool isFunctor(const std::string &name) const
Checks the subproblem for the given functor.

Referenced by FunctorInterface::isFunctor().

◆ isFunctor() [2/2]

bool FunctorInterface::isFunctor ( const std::string &  name,
const SubProblem subproblem 
) const
protectedinherited

Checks the passed-in subproblem for the given functor.

This will not query default functors potentially stored in this object, e.g. this method will return false if the user passed an int or real to the functor param in the input file

Parameters
nameThe name of the functor to check. This should match the functor parameter name, \emph not the actual name of the functor created in the input file
subproblemThe subproblem to query for the functor
Returns
Whether the subproblem has the specified functor

Definition at line 115 of file FunctorInterface.C.

116{
117 // Check if the supplied parameter is a valid input parameter key
118 std::string functor_name = deduceFunctorName(name);
119
120 return subproblem.hasFunctor(functor_name, _fi_tid);
121}
bool hasFunctor(const std::string &name, const THREAD_ID tid) const
checks whether we have a functor corresponding to name on the thread id tid

◆ lmFaceJacobian()

void DiffusionLHDGAssemblyHelper::lmFaceJacobian ( const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseMatrix< Number > &  lm_vec_jac,
DenseMatrix< Number > &  lm_scalar_jac,
DenseMatrix< Number > &  lm_lm_jac 
)
protected

Computes a local Jacobian matrix for the weak form: -<Dq*n, \mu> + <\tau * (u - \hat{u}) * n * n, \mu>

Definition at line 301 of file DiffusionLHDGAssemblyHelper.C.

307{
308 for (const auto qp : make_range(qrule_face.n_points()))
309 {
310 const auto vector_qp_term = JxW_face[qp] * _diff[qp] * normals[qp];
311 const auto stab_qp_term = JxW_face[qp] * _tau * normals[qp] * normals[qp];
312
313 for (const auto i : make_range(lm_vec_jac.m()))
314 {
315 const auto vector_qpi_term = vector_qp_term * _lm_phi_face[i][qp];
316 for (const auto j : make_range(lm_vec_jac.n()))
317 lm_vec_jac(i, j) -= vector_qpi_term * _vector_phi_face[j][qp];
318
319 const auto lm_qpi_term = stab_qp_term * _lm_phi_face[i][qp];
320 for (const auto j : make_range(lm_scalar_jac.n()))
321 lm_scalar_jac(i, j) += lm_qpi_term * _scalar_phi_face[j][qp];
322 for (const auto j : make_range(lm_lm_jac.n()))
323 lm_lm_jac(i, j) -= lm_qpi_term * _lm_phi_face[j][qp];
324 }
325 }
326}

Referenced by DiffusionLHDGPrescribedGradientBC::computeJacobian(), and DiffusionLHDGKernel::computeJacobianOnSide().

◆ lmFaceResidual()

void DiffusionLHDGAssemblyHelper::lmFaceResidual ( const MooseArray< Gradient > &  vector_sol,
const MooseArray< Number > &  scalar_sol,
const MooseArray< Number > &  lm_sol,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseVector< Number > &  lm_re 
)
protected

Computes a local residual vector for the weak form: -<Dq*n, \mu> + <\tau * (u - \hat{u}) * n * n, \mu>

Definition at line 277 of file DiffusionLHDGAssemblyHelper.C.

284{
285 for (const auto qp : make_range(qrule_face.n_points()))
286 {
287 // vector
288 const auto vector_qp_term = JxW_face[qp] * _diff[qp] * (vector_sol[qp] * normals[qp]);
289 // stabilization term
290 const auto stab_qp_term = JxW_face[qp] * _tau * (normals[qp] * normals[qp]);
291 // scalar from stabilization term
292 const auto scalar_qp_term = stab_qp_term * scalar_sol[qp];
293 // lm from stabilization term
294 const auto lm_qp_term = stab_qp_term * lm_sol[qp];
295 for (const auto i : index_range(lm_re))
296 lm_re(i) += _lm_phi_face[i][qp] * (scalar_qp_term - vector_qp_term - lm_qp_term);
297 }
298}

Referenced by DiffusionLHDGPrescribedGradientBC::computeResidual(), and DiffusionLHDGKernel::computeResidualOnSide().

◆ makeElemArg()

Moose::ElemArg FunctorInterface::makeElemArg ( const Elem *  elem,
bool  correct_skewnewss = false 
) const
protectedinherited

◆ scalarDirichletJacobian()

void DiffusionLHDGAssemblyHelper::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 
)
protected

Computes the Jacobian for a Dirichlet condition for the scalar field in the scalar field equation.

Definition at line 379 of file DiffusionLHDGAssemblyHelper.C.

384{
385 for (const auto qp : make_range(qrule_face.n_points()))
386 {
387 const auto vector_qp_term = JxW_face[qp] * _diff[qp] * normals[qp];
388 const auto scalar_qp_term = JxW_face[qp] * _tau * normals[qp] * normals[qp];
389 for (const auto i : index_range(_u_dof_indices))
390 {
391 const auto vector_qpi_term = vector_qp_term * _scalar_phi_face[i][qp];
392 for (const auto j : index_range(_qu_dof_indices))
393 scalar_vector_jac(i, j) -= vector_qpi_term * _vector_phi_face[j][qp];
394
395 const auto scalar_qpi_term = scalar_qp_term * _scalar_phi_face[i][qp];
396 for (const auto j : index_range(_u_dof_indices))
397 scalar_scalar_jac(i, j) += scalar_qpi_term * _scalar_phi_face[j][qp];
398 }
399 }
400}

Referenced by DiffusionLHDGDirichletBC::computeJacobian().

◆ scalarDirichletResidual()

void DiffusionLHDGAssemblyHelper::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 
)
protected

Weakly imposes a Dirichlet condition for the scalar field in the scalar field equation.

Definition at line 352 of file DiffusionLHDGAssemblyHelper.C.

362{
363 for (const auto qp : make_range(qrule_face.n_points()))
364 {
365 const auto scalar_value = dirichlet_value(
366 Moose::ElemSideQpArg{current_elem, current_side, qp, &qrule_face, q_point_face[qp]},
368 const auto vector_qp_term = JxW_face[qp] * _diff[qp] * (vector_sol[qp] * normals[qp]);
369 const auto stab_qp_term = JxW_face[qp] * _tau * normals[qp] * normals[qp];
370 const auto scalar_qp_term = stab_qp_term * scalar_sol[qp];
371 const auto lm_qp_term = stab_qp_term * scalar_value;
372
373 for (const auto i : index_range(_u_dof_indices))
374 scalar_re(i) += (scalar_qp_term - vector_qp_term - lm_qp_term) * _scalar_phi_face[i][qp];
375 }
376}
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
Argument for requesting functor evaluation at quadrature point locations on an element side.

Referenced by DiffusionLHDGDirichletBC::computeResidual().

◆ scalarFaceJacobian()

void DiffusionLHDGAssemblyHelper::scalarFaceJacobian ( const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseMatrix< Number > &  scalar_vector_jac,
DenseMatrix< Number > &  scalar_scalar_jac,
DenseMatrix< Number > &  scalar_lm_jac 
)
protected

Computes a local Jacobian matrix for the weak form: -<Dq*n, w> + <\tau * (u - \hat{u}) * n * n, w>

Definition at line 249 of file DiffusionLHDGAssemblyHelper.C.

255{
256 for (const auto qp : make_range(qrule_face.n_points()))
257 {
258 const auto vector_qp_term = JxW_face[qp] * _diff[qp] * normals[qp];
259 const auto stab_qp_term = JxW_face[qp] * _tau * normals[qp] * normals[qp];
260
261 for (const auto i : make_range(scalar_vector_jac.m()))
262 {
263 const auto vector_qpi_term = vector_qp_term * _scalar_phi_face[i][qp];
264 for (const auto j : make_range(scalar_vector_jac.n()))
265 scalar_vector_jac(i, j) -= vector_qpi_term * _vector_phi_face[j][qp];
266
267 const auto scalar_qpi_term = stab_qp_term * _scalar_phi_face[i][qp];
268 for (const auto j : make_range(scalar_scalar_jac.n()))
269 scalar_scalar_jac(i, j) += scalar_qpi_term * _scalar_phi_face[j][qp];
270 for (const auto j : make_range(scalar_lm_jac.n()))
271 scalar_lm_jac(i, j) -= scalar_qpi_term * _lm_phi_face[j][qp];
272 }
273 }
274}

Referenced by DiffusionLHDGPrescribedGradientBC::computeJacobian(), and DiffusionLHDGKernel::computeJacobianOnSide().

◆ scalarFaceResidual()

void DiffusionLHDGAssemblyHelper::scalarFaceResidual ( const MooseArray< Gradient > &  vector_sol,
const MooseArray< Number > &  scalar_sol,
const MooseArray< Number > &  lm_sol,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseVector< Number > &  scalar_re 
)
protected

Computes a local residual vector for the weak form: -<Dq*n, w> + <\tau * (u - \hat{u}) * n * n, w>

Definition at line 225 of file DiffusionLHDGAssemblyHelper.C.

232{
233 for (const auto qp : make_range(qrule_face.n_points()))
234 {
235 // vector
236 const auto vector_qp_term = JxW_face[qp] * _diff[qp] * (vector_sol[qp] * normals[qp]);
237 // stabilization term
238 const auto stab_qp_term = JxW_face[qp] * _tau * (normals[qp] * normals[qp]);
239 // scalar from stabilization term
240 const auto scalar_qp_term = stab_qp_term * scalar_sol[qp];
241 // lm from stabilization term
242 const auto lm_qp_term = stab_qp_term * lm_sol[qp];
243 for (const auto i : index_range(scalar_re))
244 scalar_re(i) += _scalar_phi_face[i][qp] * (scalar_qp_term - vector_qp_term - lm_qp_term);
245 }
246}

Referenced by DiffusionLHDGPrescribedGradientBC::computeResidual(), and DiffusionLHDGKernel::computeResidualOnSide().

◆ scalarVolumeJacobian()

void DiffusionLHDGAssemblyHelper::scalarVolumeJacobian ( const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
DenseMatrix< Number > &  scalar_vector_jac 
)
protected

Computes a local Jacobian matrix for the weak form: (Dq, grad(w)) - (f, w) where D is the diffusivity, w are the test functions associated with the scalar field, and f is a forcing function.

Definition at line 172 of file DiffusionLHDGAssemblyHelper.C.

175{
176 for (const auto qp : make_range(qrule.n_points()))
177 {
178 const auto qp_term = JxW[qp] * _diff[qp];
179 for (const auto i : make_range(scalar_vector_jac.m()))
180 {
181 const auto qpi_term = qp_term * _grad_scalar_phi[i][qp];
182 // Scalar equation dependence on vector dofs
183 for (const auto j : make_range(scalar_vector_jac.n()))
184 scalar_vector_jac(i, j) += qpi_term * _vector_phi[j][qp];
185 }
186 }
187}

Referenced by DiffusionLHDGKernel::computeJacobian().

◆ scalarVolumeResidual()

void DiffusionLHDGAssemblyHelper::scalarVolumeResidual ( const MooseArray< Gradient > &  vector_field,
const Moose::Functor< Real > &  source,
const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
const Elem *const  current_elem,
const MooseArray< Point > &  q_point,
DenseVector< Number > &  scalar_re 
)
protected

Computes a local residual vector for the weak form: (Dq, grad(w)) - (f, w) where D is the diffusivity, w are the test functions associated with the scalar field, and f is a forcing function.

Definition at line 145 of file DiffusionLHDGAssemblyHelper.C.

152{
153 for (const auto qp : make_range(qrule.n_points()))
154 {
155 const auto vector_qp_term = JxW[qp] * _diff[qp] * vector_field[qp];
156 // Evaluate source
157 const auto f =
158 source(Moose::ElemQpArg{current_elem, qp, &qrule, q_point[qp]}, _ti.determineState());
159 const auto source_qp_term = JxW[qp] * f;
160
161 for (const auto i : index_range(scalar_re))
162 {
163 scalar_re(i) += _grad_scalar_phi[i][qp] * vector_qp_term;
164
165 // Scalar equation RHS
166 scalar_re(i) -= _scalar_phi[i][qp] * source_qp_term;
167 }
168 }
169}
Argument for requesting functor evaluation at a quadrature point location in an element.

Referenced by DiffusionLHDGKernel::computeResidual().

◆ validParams()

InputParameters DiffusionLHDGAssemblyHelper::validParams ( )
static

Definition at line 22 of file DiffusionLHDGAssemblyHelper.C.

23{
24 auto params = emptyInputParameters();
25 params.addRequiredParam<NonlinearVariableName>(
26 "gradient_variable", "The gradient of the diffusing specie concentration");
27 params.addRequiredParam<NonlinearVariableName>(
28 "face_variable", "The concentration of the diffusing specie on faces");
29 params.addRequiredParam<MaterialPropertyName>("diffusivity", "The diffusivity");
30 params.addParam<Real>("tau",
31 1,
32 "The stabilization coefficient required for discontinuous Galerkin "
33 "schemes. This may be set to 0 for a mixed method with Raviart-Thomas.");
34 return params;
35}
InputParameters emptyInputParameters()

Referenced by DiffusionLHDGDirichletBC::validParams(), DiffusionLHDGPrescribedGradientBC::validParams(), and DiffusionLHDGKernel::validParams().

◆ vectorDirichletResidual()

void DiffusionLHDGAssemblyHelper::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 
)
protected

Weakly imposes a Dirichlet condition for the scalar field in the vector (gradient) equation.

Definition at line 329 of file DiffusionLHDGAssemblyHelper.C.

337{
338 for (const auto qp : make_range(qrule_face.n_points()))
339 {
340 const auto scalar_value = dirichlet_value(
341 Moose::ElemSideQpArg{current_elem, current_side, qp, &qrule_face, q_point_face[qp]},
343 const auto qp_term = JxW_face[qp] * normals[qp] * scalar_value;
344
345 // External boundary -> Dirichlet faces -> Vector equation RHS
346 for (const auto i : index_range(_qu_dof_indices))
347 vector_re(i) -= qp_term * _vector_phi_face[i][qp];
348 }
349}

Referenced by DiffusionLHDGDirichletBC::computeResidual().

◆ vectorFaceJacobian()

void DiffusionLHDGAssemblyHelper::vectorFaceJacobian ( const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseMatrix< Number > &  vector_lm_jac 
)
protected

Computes a local Jacobian matrix for the weak form: -<\hat{u}, n*v> where \hat{u} is the trace of the scalar field, n is the normal vector, and v are the test functions associated with the gradient field.

Definition at line 206 of file DiffusionLHDGAssemblyHelper.C.

210{
211 for (const auto qp : make_range(qrule_face.n_points()))
212 {
213 const auto qp_term = JxW_face[qp] * normals[qp];
214 // Vector equation dependence on LM dofs
215 for (const auto i : make_range(vector_lm_jac.m()))
216 {
217 const auto qpi_term = qp_term * _vector_phi_face[i][qp];
218 for (const auto j : make_range(vector_lm_jac.n()))
219 vector_lm_jac(i, j) -= qpi_term * _lm_phi_face[j][qp];
220 }
221 }
222}

Referenced by DiffusionLHDGPrescribedGradientBC::computeJacobian(), and DiffusionLHDGKernel::computeJacobianOnSide().

◆ vectorFaceResidual()

void DiffusionLHDGAssemblyHelper::vectorFaceResidual ( const MooseArray< Number > &  lm_sol,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseVector< Number > &  vector_re 
)
protected

Computes a local residual vector for the weak form: -<\hat{u}, n*v> where \hat{u} is the trace of the scalar field, n is the normal vector, and v are the test functions associated with the gradient field.

Definition at line 190 of file DiffusionLHDGAssemblyHelper.C.

195{
196 // Vector equation dependence on LM dofs
197 for (const auto qp : make_range(qrule_face.n_points()))
198 {
199 const auto qp_term = JxW_face[qp] * lm_sol[qp] * normals[qp];
200 for (const auto i : index_range(vector_re))
201 vector_re(i) -= _vector_phi_face[i][qp] * qp_term;
202 }
203}

Referenced by DiffusionLHDGPrescribedGradientBC::computeResidual(), and DiffusionLHDGKernel::computeResidualOnSide().

◆ vectorVolumeJacobian()

void DiffusionLHDGAssemblyHelper::vectorVolumeJacobian ( const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
DenseMatrix< Number > &  vector_vector_jac,
DenseMatrix< Number > &  vector_scalar_jac 
)
protected

Computes a local Jacobian matrix for the weak form: (q, v) + (u, div(v)) where q is the vector field representing the gradient, v are its associated test functions, and u is the scalar field.

Definition at line 124 of file DiffusionLHDGAssemblyHelper.C.

128{
129 for (const auto qp : make_range(qrule.n_points()))
130 for (const auto i : make_range(vector_vector_jac.m()))
131 {
132 // Vector equation dependence on vector dofs
133 const auto vector_qpi_term = JxW[qp] * _vector_phi[i][qp];
134 for (const auto j : make_range(vector_vector_jac.n()))
135 vector_vector_jac(i, j) += vector_qpi_term * _vector_phi[j][qp];
136
137 // Vector equation dependence on scalar dofs
138 const auto scalar_qpi_term = JxW[qp] * _div_vector_phi[i][qp];
139 for (const auto j : make_range(vector_scalar_jac.n()))
140 vector_scalar_jac(i, j) += scalar_qpi_term * _scalar_phi[j][qp];
141 }
142}

Referenced by DiffusionLHDGKernel::computeJacobian().

◆ vectorVolumeResidual()

void DiffusionLHDGAssemblyHelper::vectorVolumeResidual ( const MooseArray< Gradient > &  vector_sol,
const MooseArray< Number > &  scalar_sol,
const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
DenseVector< Number > &  vector_re 
)
protected

Computes a local residual vector for the weak form: (q, v) + (u, div(v)) where q is the vector field representing the gradient of u, v are its associated test functions, and u is the diffused scalar field.

Definition at line 102 of file DiffusionLHDGAssemblyHelper.C.

107{
108 for (const auto qp : make_range(qrule.n_points()))
109 {
110 const auto vector_qp_term = JxW[qp] * vector_sol[qp];
111 const auto scalar_qp_term = JxW[qp] * scalar_sol[qp];
112 for (const auto i : index_range(vector_re))
113 {
114 // Vector equation dependence on vector dofs
115 vector_re(i) += _vector_phi[i][qp] * vector_qp_term;
116
117 // Vector equation dependence on scalar dofs
118 vector_re(i) += _div_vector_phi[i][qp] * scalar_qp_term;
119 }
120 }
121}

Referenced by DiffusionLHDGKernel::computeResidual().

Member Data Documentation

◆ _cached_elem

const Elem* DiffusionLHDGAssemblyHelper::_cached_elem
protected

◆ _default_ad_real_functors

std::vector<std::unique_ptr<Moose::Functor<ADReal> > > FunctorInterface::_default_ad_real_functors
privateinherited

Storage vector for Moose::Functor<ADReal> default objects.

Definition at line 188 of file FunctorInterface.h.

Referenced by FunctorInterface::defaultFunctor().

◆ _default_real_functors

std::vector<std::unique_ptr<Moose::Functor<Real> > > FunctorInterface::_default_real_functors
privateinherited

Storage vector for Moose::Functor<Real> default objects.

Definition at line 185 of file FunctorInterface.h.

Referenced by FunctorInterface::defaultFunctor().

◆ _dhah_fe_problem

const FEProblemBase& DiffusionLHDGAssemblyHelper::_dhah_fe_problem
private

A reference to the finite element problem used for coupling checks.

Definition at line 281 of file DiffusionLHDGAssemblyHelper.h.

Referenced by checkCoupling().

◆ _dhah_sys

const SystemBase& DiffusionLHDGAssemblyHelper::_dhah_sys
private

A reference to the nonlinear system used for coupling checks.

Definition at line 284 of file DiffusionLHDGAssemblyHelper.h.

Referenced by checkCoupling().

◆ _diff

const MaterialProperty<Real>& DiffusionLHDGAssemblyHelper::_diff
protected

◆ _div_vector_phi

const MooseArray<std::vector<Real> >& DiffusionLHDGAssemblyHelper::_div_vector_phi
protected

Definition at line 249 of file DiffusionLHDGAssemblyHelper.h.

Referenced by vectorVolumeJacobian(), and vectorVolumeResidual().

◆ _fi_name

const std::string FunctorInterface::_fi_name
privateinherited

The name of the object that this interface belongs to.

Definition at line 176 of file FunctorInterface.h.

Referenced by FunctorInterface::getFunctorByName().

◆ _fi_params

const InputParameters& FunctorInterface::_fi_params
privateinherited

Parameters of the object with this interface.

Definition at line 173 of file FunctorInterface.h.

Referenced by FunctorInterface::deduceFunctorName().

◆ _fi_subproblem

SubProblem* const FunctorInterface::_fi_subproblem
privateinherited

Pointer to subproblem if the subproblem pointer parameter was set.

Definition at line 179 of file FunctorInterface.h.

Referenced by FunctorInterface::getFunctor(), FunctorInterface::getFunctor(), FunctorInterface::getFunctorByName(), and FunctorInterface::isFunctor().

◆ _fi_tid

const THREAD_ID FunctorInterface::_fi_tid
privateinherited

◆ _grad_scalar_phi

const MooseArray<std::vector<RealVectorValue> >& DiffusionLHDGAssemblyHelper::_grad_scalar_phi
protected

Definition at line 248 of file DiffusionLHDGAssemblyHelper.h.

Referenced by scalarVolumeJacobian(), and scalarVolumeResidual().

◆ _grad_u_var

const MooseVariableFE<RealVectorValue>& DiffusionLHDGAssemblyHelper::_grad_u_var
protected

◆ _lm_lm_jac

DenseMatrix<Number> DiffusionLHDGAssemblyHelper::_lm_lm_jac
protected

◆ _lm_phi_face

const MooseArray<std::vector<Real> >& DiffusionLHDGAssemblyHelper::_lm_phi_face
protected

◆ _lm_re

DenseVector<Number> DiffusionLHDGAssemblyHelper::_lm_re
protected

◆ _lm_scalar_jac

DenseMatrix<Number> DiffusionLHDGAssemblyHelper::_lm_scalar_jac
protected

◆ _lm_u_dof_indices

const std::vector<dof_id_type>& DiffusionLHDGAssemblyHelper::_lm_u_dof_indices
protected

◆ _lm_u_sol

const MooseArray<Number>& DiffusionLHDGAssemblyHelper::_lm_u_sol
protected

◆ _lm_vector_jac

DenseMatrix<Number> DiffusionLHDGAssemblyHelper::_lm_vector_jac
protected

◆ _moose_obj

const MooseObject& DiffusionLHDGAssemblyHelper::_moose_obj
private

A reference to our associated MooseObject for error reporting.

Definition at line 278 of file DiffusionLHDGAssemblyHelper.h.

Referenced by checkCoupling().

◆ _qu_dof_indices

const std::vector<dof_id_type>& DiffusionLHDGAssemblyHelper::_qu_dof_indices
protected

◆ _qu_sol

const MooseArray<libMesh::Gradient>& DiffusionLHDGAssemblyHelper::_qu_sol
protected

◆ _scalar_lm_jac

DenseMatrix<Number> DiffusionLHDGAssemblyHelper::_scalar_lm_jac
protected

◆ _scalar_phi

const MooseArray<std::vector<Real> >& DiffusionLHDGAssemblyHelper::_scalar_phi
protected

Definition at line 247 of file DiffusionLHDGAssemblyHelper.h.

Referenced by scalarVolumeResidual(), and vectorVolumeJacobian().

◆ _scalar_phi_face

const MooseArray<std::vector<Real> >& DiffusionLHDGAssemblyHelper::_scalar_phi_face
protected

◆ _scalar_re

DenseVector<Number> DiffusionLHDGAssemblyHelper::_scalar_re
protected

◆ _scalar_scalar_jac

DenseMatrix<Number> DiffusionLHDGAssemblyHelper::_scalar_scalar_jac
protected

◆ _scalar_vector_jac

DenseMatrix<Number> DiffusionLHDGAssemblyHelper::_scalar_vector_jac
protected

◆ _tau

const Real DiffusionLHDGAssemblyHelper::_tau
protected

◆ _ti

const TransientInterface& DiffusionLHDGAssemblyHelper::_ti
protected

Reference to transient interface.

Definition at line 260 of file DiffusionLHDGAssemblyHelper.h.

Referenced by scalarDirichletResidual(), scalarVolumeResidual(), and vectorDirichletResidual().

◆ _u_dof_indices

const std::vector<dof_id_type>& DiffusionLHDGAssemblyHelper::_u_dof_indices
protected

◆ _u_face_var

const MooseVariableFE<Real>& DiffusionLHDGAssemblyHelper::_u_face_var
protected

◆ _u_sol

const MooseArray<Number>& DiffusionLHDGAssemblyHelper::_u_sol
protected

◆ _u_var

const MooseVariableFE<Real>& DiffusionLHDGAssemblyHelper::_u_var
protected

◆ _vector_lm_jac

DenseMatrix<Number> DiffusionLHDGAssemblyHelper::_vector_lm_jac
protected

◆ _vector_phi

const MooseArray<std::vector<RealVectorValue> >& DiffusionLHDGAssemblyHelper::_vector_phi
protected

◆ _vector_phi_face

const MooseArray<std::vector<RealVectorValue> >& DiffusionLHDGAssemblyHelper::_vector_phi_face
protected

◆ _vector_re

DenseVector<Number> DiffusionLHDGAssemblyHelper::_vector_re
protected

◆ _vector_scalar_jac

DenseMatrix<Number> DiffusionLHDGAssemblyHelper::_vector_scalar_jac
protected

◆ _vector_vector_jac

DenseMatrix<Number> DiffusionLHDGAssemblyHelper::_vector_vector_jac
protected

The documentation for this class was generated from the following files: