https://mooseframework.inl.gov
Loading...
Searching...
No Matches
InternalSideFluxBase.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
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
29void
37
38void
42
43void
47
48void
52
53const std::vector<Real> &
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 {
65
66 calcFlux(iside, ielem, ineig, uvec1, uvec2, dwave, _flux);
67 }
68 return _flux;
69}
70
71const 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{
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}
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
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.
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.
virtual void initialize() override
virtual void execute() 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.
unsigned int _cached_flux_neig_id
neighbor element ID of the cached flux values
virtual void finalize() override
unsigned int _cached_jacobian_elem_id
element ID of the cached Jacobian values
unsigned int _cached_jacobian_neig_id
neighbor 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.
unsigned int _cached_flux_elem_id
element ID of the cached flux values
static InputParameters validParams()
DenseMatrix< Real > _jac1
Jacobian matrix contribution to the "left" cell.
InternalSideFluxBase(const InputParameters &parameters)
std::vector< Real > _flux
flux vector of this side
DenseMatrix< Real > _jac2
Jacobian matrix contribution to the "right" cell.
const std::string & type() const
DGResidualType
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
const unsigned int invalid_uint