https://mooseframework.inl.gov
NumericalFlux3EqnBase.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 "NumericalFlux3EqnBase.h"
11 
14 {
16  params.addClassDescription(
17  "Base class for implemented objects that compute the numerical flux of the 3-equation model");
18  return params;
19 }
20 
22  : ThreadedGeneralUserObject(parameters),
23 
24  _cached_flux_elem_id(libMesh::invalid_uint),
25  _cached_flux_side_id(libMesh::invalid_uint),
26  _cached_jacobian_elem_id(libMesh::invalid_uint),
27  _cached_jacobian_side_id(libMesh::invalid_uint),
28 
29  _last_region_index(0)
30 {
31 }
32 
33 void
35 {
40 }
41 
42 void
44 {
45 }
46 
47 void
49 {
50 }
51 
52 void
54 {
55 }
56 
57 const std::vector<Real> &
58 NumericalFlux3EqnBase::getFlux(const unsigned int iside,
59  const dof_id_type ielem,
60  bool res_side_is_left,
61  const std::vector<Real> & UL,
62  const std::vector<Real> & UR,
63  const Real & nLR_dot_d) const
64 {
65  if (_cached_flux_elem_id != ielem || _cached_flux_side_id != iside)
66  {
67  _cached_flux_elem_id = ielem;
68  _cached_flux_side_id = iside;
69 
70  calcFlux(UL, UR, nLR_dot_d, _FL, _FR);
71  }
72 
73  if (res_side_is_left)
74  return _FL;
75  else
76  return _FR;
77 }
78 
79 const DenseMatrix<Real> &
80 NumericalFlux3EqnBase::getJacobian(bool res_side_is_left,
81  bool jac_side_is_left,
82  const unsigned int iside,
83  const dof_id_type ielem,
84  const std::vector<Real> & UL,
85  const std::vector<Real> & UR,
86  const Real & nLR_dot_d) const
87 {
88  if (_cached_jacobian_elem_id != ielem || _cached_jacobian_side_id != iside)
89  {
92 
93  calcJacobian(UL, UR, nLR_dot_d, _dFL_dUL, _dFL_dUR, _dFR_dUL, _dFR_dUR);
94  }
95 
96  if (res_side_is_left)
97  {
98  if (jac_side_is_left)
99  return _dFL_dUL;
100  else
101  return _dFL_dUR;
102  }
103  else
104  {
105  if (jac_side_is_left)
106  return _dFR_dUL;
107  else
108  return _dFR_dUR;
109  }
110 }
std::vector< Real > _FR
flux vector for the "right" cell
const unsigned int invalid_uint
static InputParameters validParams()
unsigned int _cached_jacobian_elem_id
element ID of the cached Jacobian values
NumericalFlux3EqnBase(const InputParameters &parameters)
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
static InputParameters validParams()
virtual void threadJoin(const UserObject &) override
DenseMatrix< Real > _dFR_dUR
derivative of "right" flux w.r.t. "right" solution
virtual void calcFlux(const std::vector< Real > &UL, const std::vector< Real > &UR, const Real &nLR_dot_d, std::vector< Real > &FL, std::vector< Real > &FR) const =0
Calculates the flux vectors given "left" and "right" states.
DenseMatrix< Real > _dFL_dUL
derivative of "left" flux w.r.t. "left" solution
unsigned int _cached_jacobian_side_id
side ID of the cached Jacobian values
virtual void execute() override
virtual const std::vector< Real > & getFlux(const unsigned int iside, const dof_id_type ielem, bool res_side_is_left, const std::vector< Real > &UL, const std::vector< Real > &UR, const Real &nLR_dot_d) const
Gets the flux vector for an element/side combination.
virtual void calcJacobian(const std::vector< Real > &UL, const std::vector< Real > &UR, const Real &nLR_dot_d, DenseMatrix< Real > &dFL_dUL, DenseMatrix< Real > &dFL_dUR, DenseMatrix< Real > &dFR_dUL, DenseMatrix< Real > &dFR_dUR) const =0
Calculates the flux Jacobian matrices given "left" and "right" states.
unsigned int _cached_flux_elem_id
element ID of the cached flux values
DenseMatrix< Real > _dFL_dUR
derivative of "left" flux w.r.t. "right" solution
virtual const DenseMatrix< Real > & getJacobian(bool res_side_is_left, bool jac_side_is_left, const unsigned int iside, const dof_id_type ielem, const std::vector< Real > &UL, const std::vector< Real > &UR, const Real &nLR_dot_d) const
Gets the flux Jacobian matrix for an element/side combination.
virtual void initialize() override
void addClassDescription(const std::string &doc_string)
virtual void finalize() override
std::vector< Real > _FL
flux vector for the "left" cell
unsigned int _cached_flux_side_id
side ID of the cached flux values
DenseMatrix< Real > _dFR_dUL
derivative of "right" flux w.r.t. "left" solution
uint8_t dof_id_type