www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
BoundaryFluxBase Class Referenceabstract

A base class for computing/caching fluxes at boundaries. More...

#include <BoundaryFluxBase.h>

Inheritance diagram for BoundaryFluxBase:
[legend]

Public Member Functions

 BoundaryFluxBase (const InputParameters &parameters)
 
virtual void execute () override
 
virtual void initialize () override
 
virtual void finalize () override
 
virtual void threadJoin (const UserObject &) override
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Protected Attributes

unsigned int _cached_flux_elem_id
 element ID of the cached flux values More...
 
unsigned int _cached_flux_side_id
 side ID of the cached flux values More...
 
unsigned int _cached_jacobian_elem_id
 element ID of the cached Jacobian values More...
 
unsigned int _cached_jacobian_side_id
 side ID of the cached Jacobian values More...
 
std::vector< Real > _flux
 Cached flux. More...
 
DenseMatrix< Real > _jac1
 Cached flux Jacobian. More...
 

Detailed Description

A base class for computing/caching fluxes at boundaries.

Notes:

  1. When systems of equations are being solved, the fluxes are treated as vectors. To avoid recomputing the flux at the boundary, we compute it just once and then when it is needed, we just return the cached value.
  2. Derived classes need to override calcFlux and calcJacobian.

Definition at line 31 of file BoundaryFluxBase.h.

Constructor & Destructor Documentation

◆ BoundaryFluxBase()

BoundaryFluxBase::BoundaryFluxBase ( const InputParameters &  parameters)

Definition at line 20 of file BoundaryFluxBase.C.

21  : ThreadedGeneralUserObject(parameters),
22  _cached_flux_elem_id(libMesh::invalid_uint),
23  _cached_flux_side_id(libMesh::invalid_uint),
24  _cached_jacobian_elem_id(libMesh::invalid_uint),
25  _cached_jacobian_side_id(libMesh::invalid_uint)
26 {
27 }
unsigned int _cached_flux_side_id
side ID of the cached flux values
unsigned int _cached_jacobian_side_id
side ID of the cached Jacobian values
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

Member Function Documentation

◆ calcFlux()

virtual void BoundaryFluxBase::calcFlux ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave,
std::vector< Real > &  flux 
) const
pure virtual

Solve the Riemann problem on the boundary face.

Parameters
[in]isidelocal index of current side
[in]ielemglobal index of the current element
[in]uvec1vector of variables on the host side
[in]dwavevector of unit normal
[out]fluxflux vector for conservation equations

Implemented in AEFVFreeOutflowBoundaryFlux.

Referenced by getFlux().

◆ calcJacobian()

virtual void BoundaryFluxBase::calcJacobian ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave,
DenseMatrix< Real > &  jac1 
) const
pure virtual

Compute the Jacobian matrix on the boundary face.

Parameters
[in]isidelocal index of current side
[in]ielemglobal index of the current element
[in]uvec1vector of variables on the host side
[in]dwavevector of unit normal
[out]jac1Jacobian matrix contribution

Implemented in AEFVFreeOutflowBoundaryFlux.

Referenced by getJacobian().

◆ execute()

void BoundaryFluxBase::execute ( )
overridevirtual

Definition at line 39 of file BoundaryFluxBase.C.

40 {
41 }

◆ finalize()

void BoundaryFluxBase::finalize ( )
overridevirtual

Definition at line 44 of file BoundaryFluxBase.C.

45 {
46 }

◆ getFlux()

const std::vector< Real > & BoundaryFluxBase::getFlux ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave 
) const
virtual

Get the boundary flux vector.

Parameters
[in]isidelocal index of current side
[in]ielemglobal index of the current element
[in]uvec1vector of variables on the host side
[in]dwavevector of unit normal

Definition at line 54 of file BoundaryFluxBase.C.

Referenced by AEFVBC::computeQpResidual().

58 {
59  if (_cached_flux_elem_id != ielem || _cached_flux_side_id != iside)
60  {
61  _cached_flux_elem_id = ielem;
62  _cached_flux_side_id = iside;
63 
64  calcFlux(iside, ielem, uvec1, dwave, _flux);
65  }
66  return _flux;
67 }
unsigned int _cached_flux_side_id
side ID of the cached flux values
std::vector< Real > _flux
Cached flux.
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.
unsigned int _cached_flux_elem_id
element ID of the cached flux values

◆ getJacobian()

const DenseMatrix< Real > & BoundaryFluxBase::getJacobian ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave 
) const
virtual

Get the boundary Jacobian matrix.

Parameters
[in]isidelocal index of current side
[in]ielemglobal index of the current element
[in]uvec1vector of variables on the host side
[in]dwavevector of unit normal

Definition at line 70 of file BoundaryFluxBase.C.

Referenced by AEFVBC::computeQpJacobian().

74 {
75  if (_cached_jacobian_elem_id != ielem || _cached_jacobian_side_id != iside)
76  {
79 
80  calcJacobian(iside, ielem, uvec1, dwave, _jac1);
81  }
82  return _jac1;
83 }
DenseMatrix< Real > _jac1
Cached flux Jacobian.
unsigned int _cached_jacobian_side_id
side ID of the cached Jacobian values
unsigned int _cached_jacobian_elem_id
element ID of the cached Jacobian values
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.

◆ initialize()

void BoundaryFluxBase::initialize ( )
overridevirtual

Definition at line 30 of file BoundaryFluxBase.C.

31 {
32  _cached_flux_elem_id = libMesh::invalid_uint;
33  _cached_flux_side_id = libMesh::invalid_uint;
34  _cached_jacobian_elem_id = libMesh::invalid_uint;
35  _cached_jacobian_side_id = libMesh::invalid_uint;
36 }
unsigned int _cached_flux_side_id
side ID of the cached flux values
unsigned int _cached_jacobian_side_id
side ID of the cached Jacobian values
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

◆ threadJoin()

void BoundaryFluxBase::threadJoin ( const UserObject &  )
overridevirtual

Definition at line 49 of file BoundaryFluxBase.C.

50 {
51 }

Member Data Documentation

◆ _cached_flux_elem_id

unsigned int BoundaryFluxBase::_cached_flux_elem_id
mutableprotected

element ID of the cached flux values

Definition at line 95 of file BoundaryFluxBase.h.

Referenced by getFlux(), and initialize().

◆ _cached_flux_side_id

unsigned int BoundaryFluxBase::_cached_flux_side_id
mutableprotected

side ID of the cached flux values

Definition at line 97 of file BoundaryFluxBase.h.

Referenced by getFlux(), and initialize().

◆ _cached_jacobian_elem_id

unsigned int BoundaryFluxBase::_cached_jacobian_elem_id
mutableprotected

element ID of the cached Jacobian values

Definition at line 100 of file BoundaryFluxBase.h.

Referenced by getJacobian(), and initialize().

◆ _cached_jacobian_side_id

unsigned int BoundaryFluxBase::_cached_jacobian_side_id
mutableprotected

side ID of the cached Jacobian values

Definition at line 102 of file BoundaryFluxBase.h.

Referenced by getJacobian(), and initialize().

◆ _flux

std::vector<Real> BoundaryFluxBase::_flux
mutableprotected

Cached flux.

Definition at line 105 of file BoundaryFluxBase.h.

Referenced by getFlux().

◆ _jac1

DenseMatrix<Real> BoundaryFluxBase::_jac1
mutableprotected

Cached flux Jacobian.

Definition at line 108 of file BoundaryFluxBase.h.

Referenced by getJacobian().


The documentation for this class was generated from the following files: