www.mooseframework.org
SlopeReconstructionBase.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 
12 #include "BCUserObject.h"
13 #include "ElementLoopUserObject.h"
14 
15 // Forward Declarations
16 
22 {
23 public:
25 
27 
28  virtual void initialize();
29  virtual void finalize();
30 
31  virtual void computeElement();
32 
34  virtual const std::vector<RealGradient> & getElementSlope(dof_id_type elementid) const;
35 
37  virtual const std::vector<Real> & getElementAverageValue(dof_id_type elementid) const;
38 
40  virtual const std::vector<Real> & getBoundaryAverageValue(dof_id_type elementid,
41  unsigned int side) const;
42 
44  virtual const Point & getSideCentroid(dof_id_type elementid, dof_id_type neighborid) const;
45 
47  virtual const Point & getBoundarySideCentroid(dof_id_type elementid, unsigned int side) const;
48 
50  virtual const Point & getSideNormal(dof_id_type elementid, dof_id_type neighborid) const;
51 
53  virtual const Point & getBoundarySideNormal(dof_id_type elementid, unsigned int side) const;
54 
56  virtual const Real & getSideArea(dof_id_type elementid, dof_id_type neighborid) const;
57 
59  virtual const Real & getBoundarySideArea(dof_id_type elementid, unsigned int side) const;
60 
62  virtual void reconstructElementSlope() = 0;
63 
64  virtual void meshChanged();
65 
66 protected:
67  virtual void serialize(std::string & serialized_buffer);
68  virtual void deserialize(std::vector<std::string> & serialized_buffers);
69 
71  std::map<dof_id_type, std::vector<RealGradient>> & _rslope;
72 
74  std::map<dof_id_type, std::vector<Real>> & _avars;
75 
77  std::map<std::pair<dof_id_type, unsigned int>, std::vector<Real>> & _bnd_avars;
78 
80  std::map<std::pair<dof_id_type, dof_id_type>, Point> & _side_centroid;
81 
83  std::map<std::pair<dof_id_type, unsigned int>, Point> & _bnd_side_centroid;
84 
86  std::map<std::pair<dof_id_type, dof_id_type>, Real> & _side_area;
87 
89  std::map<std::pair<dof_id_type, unsigned int>, Real> & _bnd_side_area;
90 
92  std::map<std::pair<dof_id_type, dof_id_type>, Point> & _side_normal;
93 
95  std::map<std::pair<dof_id_type, unsigned int>, Point> & _bnd_side_normal;
96 
99  const QBase * const & _qrule_face;
102 
104  const unsigned int & _side;
105 
106  const Elem * const & _side_elem;
108 
110  const Elem * const & _neighbor_elem;
111 
114 
115 private:
116  static Threads::spin_mutex _mutex;
117 };
std::map< dof_id_type, std::vector< Real > > & _avars
store the average variable values into this map indexed by element ID
virtual void serialize(std::string &serialized_buffer)
A base class that loops over elements and do things.
virtual const std::vector< Real > & getBoundaryAverageValue(dof_id_type elementid, unsigned int side) const
accessor function call to get boundary average variable values
virtual void reconstructElementSlope()=0
compute the slope of the cell
const Elem *const & _neighbor_elem
the neighboring element
static InputParameters validParams()
std::map< std::pair< dof_id_type, unsigned int >, std::vector< Real > > & _bnd_avars
store the boundary average variable values into this map indexed by pair of element ID and local side...
std::map< std::pair< dof_id_type, unsigned int >, Point > & _bnd_side_normal
store the boundary side normal into this map indexed by pair of element ID and local side ID ...
virtual const std::vector< RealGradient > & getElementSlope(dof_id_type elementid) const
accessor function call to get element slope values
std::map< std::pair< dof_id_type, dof_id_type >, Point > & _side_centroid
store the side centroid into this map indexed by pair of element ID and neighbor ID ...
static Threads::spin_mutex _mutex
const MooseArray< Point > & _q_point_face
required data for face assembly
virtual void deserialize(std::vector< std::string > &serialized_buffers)
virtual const std::vector< Real > & getElementAverageValue(dof_id_type elementid) const
accessor function call to get element average variable values
Base class for piecewise linear slope reconstruction to get the slopes of element average variables...
const QBase *const & _qrule_face
virtual const Real & getBoundarySideArea(dof_id_type elementid, unsigned int side) const
accessor function call to get cached boundary side area
SlopeReconstructionBase(const InputParameters &parameters)
const MooseArray< Real > & _JxW_face
std::map< std::pair< dof_id_type, dof_id_type >, Real > & _side_area
store the side area into this map indexed by pair of element ID and neighbor ID
const MooseArray< Point > & _normals_face
virtual const Point & getSideNormal(dof_id_type elementid, dof_id_type neighborid) const
accessor function call to get cached internal side normal
virtual const Point & getBoundarySideCentroid(dof_id_type elementid, unsigned int side) const
accessor function call to get cached boundary side centroid
virtual const Real & getSideArea(dof_id_type elementid, dof_id_type neighborid) const
accessor function call to get cached internal side area
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual const Point & getBoundarySideNormal(dof_id_type elementid, unsigned int side) const
accessor function call to get cached boundary side centroid
virtual const Point & getSideCentroid(dof_id_type elementid, dof_id_type neighborid) const
accessor function call to get cached internal side centroid
const unsigned int & _side
current side of the current element
const InputParameters & parameters() const
std::map< std::pair< dof_id_type, unsigned int >, Point > & _bnd_side_centroid
store the boundary side centroid into this map indexed by pair of element ID and local side ID ...
bool _side_geoinfo_cached
flag to indicated if side geometry info is cached
std::map< std::pair< dof_id_type, unsigned int >, Real > & _bnd_side_area
store the boundary side area into this map indexed by pair of element ID and local side ID ...
uint8_t dof_id_type
std::map< std::pair< dof_id_type, dof_id_type >, Point > & _side_normal
store the side normal into this map indexed by pair of element ID and neighbor ID ...
std::map< dof_id_type, std::vector< RealGradient > > & _rslope
store the reconstructed slopes into this map indexed by element ID