www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
TestBoundaryFlux Class Reference

Boundary flux used for testing. More...

#include <TestBoundaryFlux.h>

Inheritance diagram for TestBoundaryFlux:
[legend]

Public Member Functions

 TestBoundaryFlux (const InputParameters &parameters)
 
virtual void calcFlux (unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, std::vector< Real > &flux) const override
 Solve the Riemann problem on the boundary face. More...
 
virtual void calcJacobian (unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, DenseMatrix< Real > &jac1) const override
 Compute the Jacobian matrix on the boundary face. More...
 
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 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...
 

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

Boundary flux used for testing.

Definition at line 22 of file TestBoundaryFlux.h.

Constructor & Destructor Documentation

◆ TestBoundaryFlux()

TestBoundaryFlux::TestBoundaryFlux ( const InputParameters &  parameters)

Definition at line 23 of file TestBoundaryFlux.C.

24  : BoundaryFluxBase(parameters)
25 {
26 }

Member Function Documentation

◆ calcFlux()

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

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

Implements BoundaryFluxBase.

Definition at line 29 of file TestBoundaryFlux.C.

34 {
35  mooseAssert(solution.size() == 3, "Solution vector must have exactly 3 entries.");
36 
37  const Real & A = solution[0];
38  const Real & B = solution[1];
39  const Real & C = solution[2];
40 
41  flux.resize(2);
42  flux[0] = (A - B) * C * normal(0);
43  flux[1] = A * B * normal(0);
44 }

◆ calcJacobian()

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

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

Implements BoundaryFluxBase.

Definition at line 47 of file TestBoundaryFlux.C.

52 {
53  mooseError("Not implemented.");
54 }

◆ execute()

void BoundaryFluxBase::execute ( )
overridevirtualinherited

Definition at line 39 of file BoundaryFluxBase.C.

40 {
41 }

◆ finalize()

void BoundaryFluxBase::finalize ( )
overridevirtualinherited

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
virtualinherited

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.

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 }

Referenced by BoundaryFluxPostprocessor::computeQpIntegral(), and AEFVBC::computeQpResidual().

◆ getJacobian()

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

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.

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 }

Referenced by AEFVBC::computeQpJacobian().

◆ initialize()

void BoundaryFluxBase::initialize ( )
overridevirtualinherited

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 }

◆ threadJoin()

void BoundaryFluxBase::threadJoin ( const UserObject &  )
overridevirtualinherited

Definition at line 49 of file BoundaryFluxBase.C.

50 {
51 }

Member Data Documentation

◆ _cached_flux_elem_id

unsigned int BoundaryFluxBase::_cached_flux_elem_id
mutableprotectedinherited

element ID of the cached flux values

Definition at line 94 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::getFlux(), and BoundaryFluxBase::initialize().

◆ _cached_flux_side_id

unsigned int BoundaryFluxBase::_cached_flux_side_id
mutableprotectedinherited

side ID of the cached flux values

Definition at line 96 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::getFlux(), and BoundaryFluxBase::initialize().

◆ _cached_jacobian_elem_id

unsigned int BoundaryFluxBase::_cached_jacobian_elem_id
mutableprotectedinherited

element ID of the cached Jacobian values

Definition at line 99 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::getJacobian(), and BoundaryFluxBase::initialize().

◆ _cached_jacobian_side_id

unsigned int BoundaryFluxBase::_cached_jacobian_side_id
mutableprotectedinherited

side ID of the cached Jacobian values

Definition at line 101 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::getJacobian(), and BoundaryFluxBase::initialize().

◆ _flux

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

Cached flux.

Definition at line 104 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::getFlux().

◆ _jac1

DenseMatrix<Real> BoundaryFluxBase::_jac1
mutableprotectedinherited

Cached flux Jacobian.

Definition at line 107 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::getJacobian().


The documentation for this class was generated from the following files:
BoundaryFluxBase::_jac1
DenseMatrix< Real > _jac1
Cached flux Jacobian.
Definition: BoundaryFluxBase.h:107
BoundaryFluxBase::_cached_flux_side_id
unsigned int _cached_flux_side_id
side ID of the cached flux values
Definition: BoundaryFluxBase.h:96
BoundaryFluxBase::_cached_jacobian_side_id
unsigned int _cached_jacobian_side_id
side ID of the cached Jacobian values
Definition: BoundaryFluxBase.h:101
BoundaryFluxBase::_flux
std::vector< Real > _flux
Cached flux.
Definition: BoundaryFluxBase.h:104
BoundaryFluxBase::calcFlux
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.
BoundaryFluxBase::_cached_jacobian_elem_id
unsigned int _cached_jacobian_elem_id
element ID of the cached Jacobian values
Definition: BoundaryFluxBase.h:99
BoundaryFluxBase::BoundaryFluxBase
BoundaryFluxBase(const InputParameters &parameters)
Definition: BoundaryFluxBase.C:20
BoundaryFluxBase::calcJacobian
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.
BoundaryFluxBase::_cached_flux_elem_id
unsigned int _cached_flux_elem_id
element ID of the cached flux values
Definition: BoundaryFluxBase.h:94