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
17 
18 template <>
19 InputParameters validParams<SlopeReconstructionBase>();
20 
26 {
27 public:
28  SlopeReconstructionBase(const InputParameters & parameters);
29 
30  virtual void initialize();
31  virtual void finalize();
32 
33  virtual void computeElement();
34 
36  virtual const std::vector<RealGradient> & getElementSlope(dof_id_type elementid) const;
37 
39  virtual const std::vector<Real> & getElementAverageValue(dof_id_type elementid) const;
40 
42  virtual const std::vector<Real> & getBoundaryAverageValue(dof_id_type elementid,
43  unsigned int side) const;
44 
46  virtual const Point & getSideCentroid(dof_id_type elementid, dof_id_type neighborid) const;
47 
49  virtual const Point & getBoundarySideCentroid(dof_id_type elementid, unsigned int side) const;
50 
52  virtual const Point & getSideNormal(dof_id_type elementid, dof_id_type neighborid) const;
53 
55  virtual const Point & getBoundarySideNormal(dof_id_type elementid, unsigned int side) const;
56 
58  virtual const Real & getSideArea(dof_id_type elementid, dof_id_type neighborid) const;
59 
61  virtual const Real & getBoundarySideArea(dof_id_type elementid, unsigned int side) const;
62 
64  virtual void reconstructElementSlope() = 0;
65 
66  virtual void meshChanged();
67 
68 protected:
69  virtual void serialize(std::string & serialized_buffer);
70  virtual void deserialize(std::vector<std::string> & serialized_buffers);
71 
73  std::map<dof_id_type, std::vector<RealGradient>> & _rslope;
74 
76  std::map<dof_id_type, std::vector<Real>> & _avars;
77 
79  std::map<std::pair<dof_id_type, unsigned int>, std::vector<Real>> & _bnd_avars;
80 
82  std::map<std::pair<dof_id_type, dof_id_type>, Point> & _side_centroid;
83 
85  std::map<std::pair<dof_id_type, unsigned int>, Point> & _bnd_side_centroid;
86 
88  std::map<std::pair<dof_id_type, dof_id_type>, Real> & _side_area;
89 
91  std::map<std::pair<dof_id_type, unsigned int>, Real> & _bnd_side_area;
92 
94  std::map<std::pair<dof_id_type, dof_id_type>, Point> & _side_normal;
95 
97  std::map<std::pair<dof_id_type, unsigned int>, Point> & _bnd_side_normal;
98 
100  const MooseArray<Point> & _q_point_face;
101  const QBase * const & _qrule_face;
102  const MooseArray<Real> & _JxW_face;
103  const MooseArray<Point> & _normals_face;
104 
106  const unsigned int & _side;
107 
108  const Elem * const & _side_elem;
109  const Real & _side_volume;
110 
112  const Elem * const & _neighbor_elem;
113 
116 
117 private:
118  static Threads::spin_mutex _mutex;
119 };
ElementLoopUserObject
A base class that loops over elements and do things.
Definition: ElementLoopUserObject.h:58
SlopeReconstructionBase::getElementAverageValue
virtual const std::vector< Real > & getElementAverageValue(dof_id_type elementid) const
accessor function call to get element average variable values
Definition: SlopeReconstructionBase.C:117
SlopeReconstructionBase::_side_elem
const Elem *const & _side_elem
Definition: SlopeReconstructionBase.h:108
SlopeReconstructionBase::_side_normal
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
Definition: SlopeReconstructionBase.h:94
SlopeReconstructionBase::_bnd_side_normal
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
Definition: SlopeReconstructionBase.h:97
SlopeReconstructionBase::_side
const unsigned int & _side
current side of the current element
Definition: SlopeReconstructionBase.h:106
SlopeReconstructionBase::getBoundarySideArea
virtual const Real & getBoundarySideArea(dof_id_type elementid, unsigned int side) const
accessor function call to get cached boundary side area
Definition: SlopeReconstructionBase.C:240
SlopeReconstructionBase::finalize
virtual void finalize()
Definition: SlopeReconstructionBase.C:68
SlopeReconstructionBase::_mutex
static Threads::spin_mutex _mutex
Definition: SlopeReconstructionBase.h:118
SlopeReconstructionBase::getSideCentroid
virtual const Point & getSideCentroid(dof_id_type elementid, dof_id_type neighborid) const
accessor function call to get cached internal side centroid
Definition: SlopeReconstructionBase.C:150
SlopeReconstructionBase::meshChanged
virtual void meshChanged()
Definition: SlopeReconstructionBase.C:90
SlopeReconstructionBase::getElementSlope
virtual const std::vector< RealGradient > & getElementSlope(dof_id_type elementid) const
accessor function call to get element slope values
Definition: SlopeReconstructionBase.C:104
SlopeReconstructionBase::_side_geoinfo_cached
bool _side_geoinfo_cached
flag to indicated if side geometry info is cached
Definition: SlopeReconstructionBase.h:115
SlopeReconstructionBase::_neighbor_elem
const Elem *const & _neighbor_elem
the neighboring element
Definition: SlopeReconstructionBase.h:112
SlopeReconstructionBase::_rslope
std::map< dof_id_type, std::vector< RealGradient > > & _rslope
store the reconstructed slopes into this map indexed by element ID
Definition: SlopeReconstructionBase.h:73
SlopeReconstructionBase::_JxW_face
const MooseArray< Real > & _JxW_face
Definition: SlopeReconstructionBase.h:102
SlopeReconstructionBase::_qrule_face
const QBase *const & _qrule_face
Definition: SlopeReconstructionBase.h:101
SlopeReconstructionBase
Base class for piecewise linear slope reconstruction to get the slopes of element average variables.
Definition: SlopeReconstructionBase.h:25
SlopeReconstructionBase::_bnd_side_centroid
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
Definition: SlopeReconstructionBase.h:85
SlopeReconstructionBase::_side_area
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
Definition: SlopeReconstructionBase.h:88
SlopeReconstructionBase::_q_point_face
const MooseArray< Point > & _q_point_face
required data for face assembly
Definition: SlopeReconstructionBase.h:100
SlopeReconstructionBase::serialize
virtual void serialize(std::string &serialized_buffer)
Definition: SlopeReconstructionBase.C:264
SlopeReconstructionBase::_side_volume
const Real & _side_volume
Definition: SlopeReconstructionBase.h:109
SlopeReconstructionBase::SlopeReconstructionBase
SlopeReconstructionBase(const InputParameters &parameters)
Definition: SlopeReconstructionBase.C:25
SlopeReconstructionBase::getSideArea
virtual const Real & getSideArea(dof_id_type elementid, dof_id_type neighborid) const
accessor function call to get cached internal side area
Definition: SlopeReconstructionBase.C:222
SlopeReconstructionBase::_side_centroid
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
Definition: SlopeReconstructionBase.h:82
SlopeReconstructionBase::getSideNormal
virtual const Point & getSideNormal(dof_id_type elementid, dof_id_type neighborid) const
accessor function call to get cached internal side normal
Definition: SlopeReconstructionBase.C:186
SlopeReconstructionBase::getBoundarySideNormal
virtual const Point & getBoundarySideNormal(dof_id_type elementid, unsigned int side) const
accessor function call to get cached boundary side centroid
Definition: SlopeReconstructionBase.C:204
SlopeReconstructionBase::computeElement
virtual void computeElement()
Definition: SlopeReconstructionBase.C:258
SlopeReconstructionBase::getBoundaryAverageValue
virtual const std::vector< Real > & getBoundaryAverageValue(dof_id_type elementid, unsigned int side) const
accessor function call to get boundary average variable values
Definition: SlopeReconstructionBase.C:132
SlopeReconstructionBase::_bnd_side_area
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
Definition: SlopeReconstructionBase.h:91
SlopeReconstructionBase::_bnd_avars
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...
Definition: SlopeReconstructionBase.h:79
SlopeReconstructionBase::_avars
std::map< dof_id_type, std::vector< Real > > & _avars
store the average variable values into this map indexed by element ID
Definition: SlopeReconstructionBase.h:76
SlopeReconstructionBase::deserialize
virtual void deserialize(std::vector< std::string > &serialized_buffers)
Definition: SlopeReconstructionBase.C:283
SlopeReconstructionBase::initialize
virtual void initialize()
Definition: SlopeReconstructionBase.C:59
ElementLoopUserObject.h
SlopeReconstructionBase::getBoundarySideCentroid
virtual const Point & getBoundarySideCentroid(dof_id_type elementid, unsigned int side) const
accessor function call to get cached boundary side centroid
Definition: SlopeReconstructionBase.C:168
SlopeReconstructionBase::reconstructElementSlope
virtual void reconstructElementSlope()=0
compute the slope of the cell
BCUserObject.h
SlopeReconstructionBase::_normals_face
const MooseArray< Point > & _normals_face
Definition: SlopeReconstructionBase.h:103
validParams< SlopeReconstructionBase >
InputParameters validParams< SlopeReconstructionBase >()
Definition: SlopeReconstructionBase.C:17