https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SlopeReconstructionBase.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
12#include "BCUserObject.h"
14
16
22{
23public:
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
66protected:
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;
107 const Real & _side_volume;
108
110 const Elem * const & _neighbor_elem;
111
114
115private:
116 static Threads::spin_mutex _mutex;
117};
A base class that loops over elements and do things.
const InputParameters & parameters() const
Base class for piecewise linear slope reconstruction to get the slopes of element average variables.
const MooseArray< Point > & _normals_face
virtual void reconstructElementSlope()=0
compute the slope of the cell
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
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, dof_id_type >, Point > & _side_centroid
store the side centroid into this map indexed by pair of element ID and neighbor ID
static InputParameters validParams()
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
virtual const Real & getBoundarySideArea(dof_id_type elementid, unsigned int side) const
accessor function call to get cached boundary side area
std::map< dof_id_type, std::vector< Real > > & _avars
store the average variable values into this map indexed by element ID
std::map< dof_id_type, std::vector< RealGradient > > & _rslope
store the reconstructed slopes into this map indexed by element ID
virtual const Point & getSideCentroid(dof_id_type elementid, dof_id_type neighborid) const
accessor function call to get cached internal side centroid
virtual const std::vector< Real > & getElementAverageValue(dof_id_type elementid) const
accessor function call to get element average variable values
bool _side_geoinfo_cached
flag to indicated if side geometry info is cached
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 void deserialize(std::vector< std::string > &serialized_buffers)
virtual const Point & getBoundarySideCentroid(dof_id_type elementid, unsigned int side) const
accessor function call to get cached boundary side centroid
const MooseArray< Point > & _q_point_face
required data for face assembly
virtual const Point & getBoundarySideNormal(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
virtual const std::vector< RealGradient > & getElementSlope(dof_id_type elementid) const
accessor function call to get element slope values
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 serialize(std::string &serialized_buffer)
const unsigned int & _side
current side of the current element
const MooseArray< Real > & _JxW_face
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
const QBase *const & _qrule_face
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
static Threads::spin_mutex _mutex
const Elem *const & _neighbor_elem
the neighboring element
virtual const Point & getSideNormal(dof_id_type elementid, dof_id_type neighborid) const
accessor function call to get cached internal side normal