https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ArrayDGKernel.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 "DGKernelBase.h"
13
14#include "MooseVariableScalar.h"
15
20class ArrayDGKernel : public DGKernelBase, public NeighborMooseVariableInterface<RealEigenVector>
21{
22public:
31
33
37 virtual const MooseVariableFEBase & variable() const override { return _var; }
38
42 virtual void computeOffDiagJacobian(unsigned int jvar) override;
43
48
53
58 const MooseVariableFEBase & jvar) override;
59
60protected:
65 virtual void computeQpResidual(Moose::DGResidualType type, RealEigenVector & residual) = 0;
66
71 virtual RealEigenVector computeQpJacobian(Moose::DGJacobianType);
72
77 const MooseVariableFEBase & jvar);
78
83
88
94
126 const std::vector<Eigen::Map<RealDIMValue>> & _array_normals;
128 const unsigned int _count;
129
130private:
132 RealEigenVector _work_vector;
133};
OutputTools< RealEigenVector >::VariablePhiGradient ArrayVariablePhiGradient
Definition MooseTypes.h:390
OutputTools< RealEigenVector >::VariableValue ArrayVariableValue
Definition MooseTypes.h:382
OutputTools< RealEigenVector >::VariablePhiValue ArrayVariablePhiValue
Definition MooseTypes.h:389
OutputTools< RealEigenVector >::VariableTestGradient ArrayVariableTestGradient
Definition MooseTypes.h:396
std::vector< std::vector< Eigen::Map< RealDIMValue > > > MappedArrayVariablePhiGradient
Definition MooseTypes.h:391
OutputTools< RealEigenVector >::VariableGradient ArrayVariableGradient
Definition MooseTypes.h:384
OutputTools< RealEigenVector >::VariableTestValue ArrayVariableTestValue
Definition MooseTypes.h:395
The DGKernel class is responsible for calculating the residuals for various physics on internal sides...
const MappedArrayVariablePhiGradient & _array_grad_test_neighbor
const ArrayVariableTestGradient & _grad_test_neighbor
Gradient of side shape function.
const std::vector< Eigen::Map< RealDIMValue > > & _array_normals
Normals in type of Eigen map.
virtual void computeQpResidual(Moose::DGResidualType type, RealEigenVector &residual)=0
This is the virtual that derived classes should override for computing the residual on neighboring el...
virtual const MooseVariableFEBase & variable() const override
The variable that this kernel operates on.
const ArrayVariablePhiValue & _phi_neighbor
Side shape function.
virtual void initQpResidual(Moose::DGResidualType)
Put necessary evaluations depending on qp but independent on test functions here.
const ArrayVariableValue & _u
Holds the current solution at the current quadrature point on the face.
const ArrayVariableGradient & _grad_u
Holds the current solution gradient at the current quadrature point on the face.
ArrayMooseVariable & _var
Variable this kernel operates on.
const MappedArrayVariablePhiGradient & _array_grad_phi
const ArrayVariableTestValue & _test
test functions
virtual void computeElemNeighResidual(Moose::DGResidualType type) override
Computes the residual for this element or the neighbor.
const ArrayVariableTestValue & _test_neighbor
Side test function.
virtual void computeElemNeighJacobian(Moose::DGJacobianType type) override
Computes the element/neighbor-element/neighbor Jacobian.
const ArrayVariablePhiValue & _phi
Shape functions.
virtual RealEigenVector computeQpJacobian(Moose::DGJacobianType)
This is the virtual that derived classes should override for computing the Jacobian on neighboring el...
const MappedArrayVariablePhiGradient & _array_grad_phi_neighbor
const ArrayVariablePhiGradient & _grad_phi_neighbor
Gradient of side shape function.
RealEigenVector _work_vector
Work vector for residual computation.
const ArrayVariablePhiGradient & _grad_phi
Gradient of shape function.
const ArrayVariableGradient & _grad_u_neighbor
Holds the current solution gradient at the current quadrature point.
const unsigned int _count
Number of components of the array variable.
virtual void initQpJacobian(Moose::DGJacobianType)
Put necessary evaluations depending on qp but independent on test and shape functions here.
const MappedArrayVariablePhiGradient & _array_grad_test
virtual void computeOffDiagJacobian(unsigned int jvar) override
Override this function to consider couplings of components of the array variable.
virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, const MooseVariableFEBase &jvar) override
Computes the element-element off-diagonal Jacobian.
const ArrayVariableValue & _u_neighbor
Holds the current solution at the current quadrature point.
const ArrayVariableTestGradient & _grad_test
Gradient of side shape function.
static InputParameters validParams()
Factory constructor initializes all internal references needed for residual computation.
virtual RealEigenMatrix computeQpOffDiagJacobian(Moose::DGJacobianType type, const MooseVariableFEBase &jvar)
This is the virtual that derived classes should override for computing the off-diag Jacobian.
virtual void initQpOffDiagJacobian(Moose::DGJacobianType, const MooseVariableFEBase &)
Put necessary evaluations depending on qp but independent on test and shape functions here for off-di...
Serves as a base class for DGKernel and ADDGKernel.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & type() const
Get the type of this class.
Definition MooseBase.h:93
This class provides an interface for common operations on field variables of both FE and FV types wit...
Enhances MooseVariableInterface interface provide values from neighbor elements.
DGResidualType
Definition MooseTypes.h:798
DGJacobianType
Definition MooseTypes.h:804