www.mooseframework.org
BoundaryFluxBase.h
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 #pragma once
11 
13 
26 {
27 public:
29 
31 
32  virtual void execute() override {}
33  virtual void initialize() override;
34  virtual void finalize() override {}
35  virtual void threadJoin(const UserObject &) override {}
36 
44  virtual const std::vector<Real> & getFlux(unsigned int iside,
45  dof_id_type ielem,
46  const std::vector<Real> & uvec1,
47  const RealVectorValue & dwave) const;
48 
57  virtual void calcFlux(unsigned int iside,
58  dof_id_type ielem,
59  const std::vector<Real> & uvec1,
60  const RealVectorValue & dwave,
61  std::vector<Real> & flux) const = 0;
62 
70  virtual const DenseMatrix<Real> & getJacobian(unsigned int iside,
71  dof_id_type ielem,
72  const std::vector<Real> & uvec1,
73  const RealVectorValue & dwave) const;
74 
83  virtual void calcJacobian(unsigned int iside,
84  dof_id_type ielem,
85  const std::vector<Real> & uvec1,
86  const RealVectorValue & dwave,
87  DenseMatrix<Real> & jac1) const = 0;
88 
89 protected:
91  mutable unsigned int _cached_flux_elem_id;
93  mutable unsigned int _cached_flux_side_id;
94 
96  mutable unsigned int _cached_jacobian_elem_id;
98  mutable unsigned int _cached_jacobian_side_id;
99 
101  mutable std::vector<Real> _flux;
102 
105 };
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()
DenseMatrix< Real > _jac1
Cached flux Jacobian.
virtual void threadJoin(const UserObject &) override
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
A base class for computing/caching fluxes at boundaries.
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 execute() override
virtual void finalize() override
virtual void initialize() override
unsigned int _cached_jacobian_elem_id
element ID of the cached Jacobian values
const InputParameters & parameters() const
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