www.mooseframework.org
BoundaryFluxBase.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 "BoundaryFluxBase.h"
11 
14 {
16  return params;
17 }
18 
20  : ThreadedGeneralUserObject(parameters),
21  _cached_flux_elem_id(libMesh::invalid_uint),
22  _cached_flux_side_id(libMesh::invalid_uint),
23  _cached_jacobian_elem_id(libMesh::invalid_uint),
24  _cached_jacobian_side_id(libMesh::invalid_uint)
25 {
26 }
27 
28 void
30 {
35 }
36 
37 const std::vector<Real> &
38 BoundaryFluxBase::getFlux(unsigned int iside,
39  dof_id_type ielem,
40  const std::vector<Real> & uvec1,
41  const RealVectorValue & dwave) const
42 {
43  if (_cached_flux_elem_id != ielem || _cached_flux_side_id != iside)
44  {
45  _cached_flux_elem_id = ielem;
46  _cached_flux_side_id = iside;
47 
48  calcFlux(iside, ielem, uvec1, dwave, _flux);
49  }
50  return _flux;
51 }
52 
53 const DenseMatrix<Real> &
54 BoundaryFluxBase::getJacobian(unsigned int iside,
55  dof_id_type ielem,
56  const std::vector<Real> & uvec1,
57  const RealVectorValue & dwave) const
58 {
59  if (_cached_jacobian_elem_id != ielem || _cached_jacobian_side_id != iside)
60  {
63 
64  calcJacobian(iside, ielem, uvec1, dwave, _jac1);
65  }
66  return _jac1;
67 }
virtual const std::vector< Real > & getFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave) const
Get the boundary flux vector.
static InputParameters validParams()
const unsigned int invalid_uint
static InputParameters validParams()
DenseMatrix< Real > _jac1
Cached flux Jacobian.
unsigned int _cached_flux_side_id
side ID of the cached flux values
std::vector< Real > _flux
Cached flux.
virtual const DenseMatrix< Real > & getJacobian(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave) const
Get the boundary Jacobian matrix.
unsigned int _cached_jacobian_side_id
side ID of the cached Jacobian values
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
virtual void calcFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, std::vector< Real > &flux) const =0
Solve the Riemann problem on the boundary face.
virtual void initialize() override
unsigned int _cached_jacobian_elem_id
element ID of the cached Jacobian values
unsigned int _cached_flux_elem_id
element ID of the cached flux values
BoundaryFluxBase(const InputParameters &parameters)
virtual void calcJacobian(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, DenseMatrix< Real > &jac1) const =0
Compute the Jacobian matrix on the boundary face.
uint8_t dof_id_type