www.mooseframework.org
InternalSideFluxBase.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 INTERNALSIDEFLUXBASE_H
9 #define INTERNALSIDEFLUXBASE_H
10 
11 #include "GeneralUserObject.h"
12 
13 // Forward Declarations
15 
16 template <>
17 InputParameters validParams<InternalSideFluxBase>();
18 
32 class InternalSideFluxBase : public GeneralUserObject
33 {
34 public:
35  InternalSideFluxBase(const InputParameters & parameters);
36 
37  virtual void execute();
38  virtual void initialize();
39  virtual void finalize();
40 
50  virtual const std::vector<Real> & getFlux(unsigned int iside,
51  dof_id_type ielem,
52  dof_id_type ineig,
53  const std::vector<Real> & uvec1,
54  const std::vector<Real> & uvec2,
55  const RealVectorValue & dwave,
56  THREAD_ID tid) const;
57 
68  virtual void calcFlux(unsigned int iside,
69  dof_id_type ielem,
70  dof_id_type ineig,
71  const std::vector<Real> & uvec1,
72  const std::vector<Real> & uvec2,
73  const RealVectorValue & dwave,
74  std::vector<Real> & flux) const = 0;
75 
85  virtual const DenseMatrix<Real> & getJacobian(Moose::DGResidualType type,
86  unsigned int iside,
87  dof_id_type ielem,
88  dof_id_type ineig,
89  const std::vector<Real> & uvec1,
90  const std::vector<Real> & uvec2,
91  const RealVectorValue & dwave,
92  THREAD_ID tid) const;
93 
105  virtual void calcJacobian(unsigned int iside,
106  dof_id_type ielem,
107  dof_id_type ineig,
108  const std::vector<Real> & uvec1,
109  const std::vector<Real> & uvec2,
110  const RealVectorValue & dwave,
111  DenseMatrix<Real> & jac1,
112  DenseMatrix<Real> & jac2) const = 0;
113 
114 protected:
115  mutable unsigned int _cached_elem_id;
116  mutable unsigned int _cached_neig_id;
117 
119  mutable std::vector<std::vector<Real>> _flux;
121  mutable std::vector<DenseMatrix<Real>> _jac1;
123  mutable std::vector<DenseMatrix<Real>> _jac2;
124 
125 private:
126  static Threads::spin_mutex _mutex;
127 };
128 
129 #endif // INTERNALSIDEFLUXBASE_H
InputParameters validParams< InternalSideFluxBase >()
InternalSideFluxBase(const InputParameters &parameters)
static Threads::spin_mutex _mutex
virtual const DenseMatrix< Real > & getJacobian(Moose::DGResidualType type, unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave, THREAD_ID tid) const
Get the Jacobian matrix.
std::vector< DenseMatrix< Real > > _jac1
Jacobian matrix contribution to the "left" cell.
std::vector< DenseMatrix< Real > > _jac2
Jacobian matrix contribution to the "right" cell.
virtual const std::vector< Real > & getFlux(unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave, THREAD_ID tid) const
Get the flux vector.
A base class for computing and caching internal side flux.
virtual void calcFlux(unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave, std::vector< Real > &flux) const =0
Solve the Riemann problem.
std::vector< std::vector< Real > > _flux
flux vector of this side
virtual void calcJacobian(unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave, DenseMatrix< Real > &jac1, DenseMatrix< Real > &jac2) const =0
Compute the Jacobian matrix.