https://mooseframework.inl.gov
NumericalFlux1D.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
19 {
20 public:
22 
24 
25  virtual void execute() override;
26  virtual void initialize() override;
27  virtual void finalize() override;
28  virtual void threadJoin(const UserObject &) override;
29 
46  virtual const std::vector<ADReal> & getFlux(const unsigned int iside,
47  const dof_id_type ielem,
48  bool res_side_is_left,
49  const std::vector<ADReal> & UL_1d,
50  const std::vector<ADReal> & UR_1d,
51  Real nLR_dot_d) const;
52 
69  virtual const std::vector<ADReal> & getFlux3D(const unsigned int iside,
70  const dof_id_type ielem,
71  const std::vector<ADReal> & UL_3d,
72  const std::vector<ADReal> & UR_3d,
73  const RealVectorValue & nLR,
74  const RealVectorValue & t1,
75  const RealVectorValue & t2) const;
76 
90  virtual void calcFlux(const std::vector<ADReal> & UL_3d,
91  const std::vector<ADReal> & UR_3d,
92  const RealVectorValue & nLR,
93  const RealVectorValue & t1,
94  const RealVectorValue & t2,
95  std::vector<ADReal> & FL,
96  std::vector<ADReal> & FR) const = 0;
97 
106  unsigned int getLastRegionIndex() const { return _last_region_index; }
107 
116  virtual unsigned int getNumberOfRegions() const = 0;
117 
118 protected:
124  virtual std::vector<ADReal> convert1DInputTo3D(const std::vector<ADReal> & U_1d) const = 0;
125 
131  virtual std::vector<ADReal> convert3DFluxTo1D(const std::vector<ADReal> & F_3d) const = 0;
132 
140  virtual void transform3DFluxDirection(std::vector<ADReal> & F_3d, Real nLR_dot_d) const = 0;
141 
143  mutable unsigned int _cached_flux_elem_id;
145  mutable unsigned int _cached_flux_side_id;
146 
148  mutable std::vector<ADReal> _FL_3d;
150  mutable std::vector<ADReal> _FR_3d;
152  mutable std::vector<ADReal> _FL_1d;
154  mutable std::vector<ADReal> _FR_1d;
155 
157  mutable unsigned int _last_region_index;
158 };
virtual void initialize() override
static InputParameters validParams()
std::vector< ADReal > _FR_3d
flux vector for the "right" cell for 3D
Abstract base class for computing and caching internal or boundary fluxes for 1D conservation law sys...
std::vector< ADReal > _FL_3d
flux vector for the "left" cell for 3D
unsigned int _cached_flux_elem_id
element ID of the cached flux values
virtual std::vector< ADReal > convert1DInputTo3D(const std::vector< ADReal > &U_1d) const =0
Converts a 1D flux input vector to a 3D flux input vector.
virtual const std::vector< ADReal > & getFlux(const unsigned int iside, const dof_id_type ielem, bool res_side_is_left, const std::vector< ADReal > &UL_1d, const std::vector< ADReal > &UR_1d, Real nLR_dot_d) const
Gets the 1D flux vector for an element/side combination.
std::vector< ADReal > _FR_1d
flux vector for the "right" cell for 1D
unsigned int _last_region_index
Index describing the region last entered, which is useful for testing and debugging.
NumericalFlux1D(const InputParameters &parameters)
virtual void execute() override
virtual void finalize() override
virtual const std::vector< ADReal > & getFlux3D(const unsigned int iside, const dof_id_type ielem, const std::vector< ADReal > &UL_3d, const std::vector< ADReal > &UR_3d, const RealVectorValue &nLR, const RealVectorValue &t1, const RealVectorValue &t2) const
Gets the 3D flux vector for an element/side combination on the left side.
virtual void transform3DFluxDirection(std::vector< ADReal > &F_3d, Real nLR_dot_d) const =0
Applies direction transformation to a 3D flux vector.
virtual unsigned int getNumberOfRegions() const =0
Returns the total possible number of regions.
unsigned int getLastRegionIndex() const
Returns the index of the region last entered.
virtual std::vector< ADReal > convert3DFluxTo1D(const std::vector< ADReal > &F_3d) const =0
Converts a 3D flux vector to a 1D flux vector.
std::vector< ADReal > _FL_1d
flux vector for the "left" cell for 1D
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void calcFlux(const std::vector< ADReal > &UL_3d, const std::vector< ADReal > &UR_3d, const RealVectorValue &nLR, const RealVectorValue &t1, const RealVectorValue &t2, std::vector< ADReal > &FL, std::vector< ADReal > &FR) const =0
Calculates the 3D flux vectors given "left" and "right" states.
const InputParameters & parameters() const
unsigned int _cached_flux_side_id
side ID of the cached flux values
uint8_t dof_id_type
virtual void threadJoin(const UserObject &) override