www.mooseframework.org
InternalSideFluxBase.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "InternalSideFluxBase.h"
11 
14 {
16  params.addClassDescription("A base class for computing and caching internal side flux.");
17  return params;
18 }
19 
21  : ThreadedGeneralUserObject(parameters),
22  _cached_flux_elem_id(libMesh::invalid_uint),
23  _cached_flux_neig_id(libMesh::invalid_uint),
24  _cached_jacobian_elem_id(libMesh::invalid_uint),
25  _cached_jacobian_neig_id(libMesh::invalid_uint)
26 {
27 }
28 
29 void
31 {
36 }
37 
38 void
40 {
41 }
42 
43 void
45 {
46 }
47 
48 void
50 {
51 }
52 
53 const std::vector<Real> &
54 InternalSideFluxBase::getFlux(unsigned int iside,
55  dof_id_type ielem,
56  dof_id_type ineig,
57  const std::vector<Real> & uvec1,
58  const std::vector<Real> & uvec2,
59  const RealVectorValue & dwave) const
60 {
61  if (_cached_flux_elem_id != ielem || _cached_flux_neig_id != ineig)
62  {
63  _cached_flux_elem_id = ielem;
64  _cached_flux_neig_id = ineig;
65 
66  calcFlux(iside, ielem, ineig, uvec1, uvec2, dwave, _flux);
67  }
68  return _flux;
69 }
70 
71 const DenseMatrix<Real> &
73  unsigned int iside,
74  dof_id_type ielem,
75  dof_id_type ineig,
76  const std::vector<Real> & uvec1,
77  const std::vector<Real> & uvec2,
78  const RealVectorValue & dwave) const
79 {
80  if (_cached_jacobian_elem_id != ielem || _cached_jacobian_neig_id != ineig)
81  {
84 
85  calcJacobian(iside, ielem, ineig, uvec1, uvec2, dwave, _jac1, _jac2);
86  }
87 
88  if (type == Moose::Element)
89  return _jac1;
90  else
91  return _jac2;
92 }
InternalSideFluxBase(const InputParameters &parameters)
unsigned int _cached_flux_elem_id
element ID of the cached flux values
const unsigned int invalid_uint
static InputParameters validParams()
virtual void calcJacobian(unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave, DenseMatrix< Real > &jac1, DenseMatrix< Real > &jac2) const =0
Compute the Jacobian matrix.
unsigned int _cached_jacobian_neig_id
neighbor element ID of the cached Jacobian values
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
DGResidualType
virtual void initialize() override
virtual void threadJoin(const UserObject &) override
virtual void calcFlux(unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave, std::vector< Real > &flux) const =0
Solve the Riemann problem.
virtual const DenseMatrix< Real > & getJacobian(Moose::DGResidualType type, unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave) const
Get the Jacobian matrix.
DenseMatrix< Real > _jac2
Jacobian matrix contribution to the "right" cell.
std::vector< Real > _flux
flux vector of this side
const std::string & type() const
virtual void execute() override
unsigned int _cached_jacobian_elem_id
element ID of the cached Jacobian values
virtual const std::vector< Real > & getFlux(unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave) const
Get the flux vector.
virtual void finalize() override
void addClassDescription(const std::string &doc_string)
DenseMatrix< Real > _jac1
Jacobian matrix contribution to the "left" cell.
unsigned int _cached_flux_neig_id
neighbor element ID of the cached flux values
static InputParameters validParams()
uint8_t dof_id_type