www.mooseframework.org
BoundaryFluxBase.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #ifndef BOUNDARYFLUXBASE_H
9 #define BOUNDARYFLUXBASE_H
10 
11 #include "GeneralUserObject.h"
12 
13 // Forward Declarations
14 class BoundaryFluxBase;
15 
16 template <>
17 InputParameters validParams<BoundaryFluxBase>();
18 
30 class BoundaryFluxBase : public GeneralUserObject
31 {
32 public:
33  BoundaryFluxBase(const InputParameters & parameters);
34 
35  virtual void execute();
36  virtual void initialize();
37  virtual void finalize();
38 
46  virtual const std::vector<Real> & getFlux(unsigned int iside,
47  dof_id_type ielem,
48  const std::vector<Real> & uvec1,
49  const RealVectorValue & dwave,
50  THREAD_ID tid) const;
51 
60  virtual void calcFlux(unsigned int iside,
61  dof_id_type ielem,
62  const std::vector<Real> & uvec1,
63  const RealVectorValue & dwave,
64  std::vector<Real> & flux) const = 0;
65 
73  virtual const DenseMatrix<Real> & getJacobian(unsigned int iside,
74  dof_id_type ielem,
75  const std::vector<Real> & uvec1,
76  const RealVectorValue & dwave,
77  THREAD_ID tid) const;
78 
87  virtual void calcJacobian(unsigned int iside,
88  dof_id_type ielem,
89  const std::vector<Real> & uvec1,
90  const RealVectorValue & dwave,
91  DenseMatrix<Real> & jac1) const = 0;
92 
93 protected:
94  mutable unsigned int _cached_side_id;
95  mutable dof_id_type _cached_elem_id;
96 
98  mutable std::vector<std::vector<Real>> _flux;
99 
101  mutable std::vector<DenseMatrix<Real>> _jac1;
102 
103 private:
104  static Threads::spin_mutex _mutex;
105 };
106 
107 #endif // BOUNDARYFLUXBASE_H
InputParameters validParams< BoundaryFluxBase >()
A base class for computing/caching fluxes at boundaries.
unsigned int _cached_side_id
virtual void execute()
virtual const DenseMatrix< Real > & getJacobian(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, THREAD_ID tid) const
Get the boundary Jacobian matrix.
static Threads::spin_mutex _mutex
virtual void initialize()
std::vector< DenseMatrix< Real > > _jac1
Threaded storage for jacobians.
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.
virtual const std::vector< Real > & getFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, THREAD_ID tid) const
Get the boundary flux vector.
BoundaryFluxBase(const InputParameters &parameters)
std::vector< std::vector< Real > > _flux
Threaded storage for fluxes.
dof_id_type _cached_elem_id
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 finalize()