19 params.
addClassDescription(
"Base class for piecewise linear slope reconstruction to get the " 20 "slopes of element average variables.");
27 "reconstructed_slopes")),
31 "avg_bnd_var_values")),
36 "bnd_side_centroid")),
45 _q_point_face(_assembly.qPointsFace()),
46 _qrule_face(_assembly.qRuleFace()),
47 _JxW_face(_assembly.JxWFace()),
48 _normals_face(_assembly.normals()),
49 _side(_assembly.side()),
50 _side_elem(_assembly.sideElem()),
51 _side_volume(_assembly.sideElemVolume()),
52 _neighbor_elem(_assembly.neighbor()),
53 _side_geoinfo_cached(false)
75 std::vector<std::string> send_buffers(1);
76 std::vector<std::string> recv_buffers;
83 std::back_inserter(recv_buffers));
102 const std::vector<RealGradient> &
105 Threads::spin_mutex::scoped_lock lock(
_mutex);
106 std::map<dof_id_type, std::vector<RealGradient>>::const_iterator pos =
_rslope.find(elementid);
110 "Reconstructed slope is not cached for element id '", elementid,
"' in ", __FUNCTION__);
115 const std::vector<Real> &
118 Threads::spin_mutex::scoped_lock lock(
_mutex);
119 std::map<dof_id_type, std::vector<Real>>::const_iterator pos =
_avars.find(elementid);
122 mooseError(
"Average variable values are not cached for element id '",
130 const std::vector<Real> &
133 Threads::spin_mutex::scoped_lock lock(
_mutex);
134 std::map<std::pair<dof_id_type, unsigned int>, std::vector<Real>>::const_iterator pos =
135 _bnd_avars.find(std::pair<dof_id_type, unsigned int>(elementid, side));
138 mooseError(
"Average variable values are not cached for element id '",
151 Threads::spin_mutex::scoped_lock lock(
_mutex);
152 std::map<std::pair<dof_id_type, dof_id_type>, Point>::const_iterator pos =
153 _side_centroid.find(std::pair<dof_id_type, dof_id_type>(elementid, neighborid));
156 mooseError(
"Side centroid values are not cached for element id '",
158 "' and neighbor id '",
169 Threads::spin_mutex::scoped_lock lock(
_mutex);
170 std::map<std::pair<dof_id_type, unsigned int>, Point>::const_iterator pos =
174 mooseError(
"Boundary side centroid values are not cached for element id '",
187 Threads::spin_mutex::scoped_lock lock(
_mutex);
188 std::map<std::pair<dof_id_type, dof_id_type>, Point>::const_iterator pos =
189 _side_normal.find(std::pair<dof_id_type, dof_id_type>(elementid, neighborid));
192 mooseError(
"Side normal values are not cached for element id '",
194 "' and neighbor id '",
205 Threads::spin_mutex::scoped_lock lock(
_mutex);
206 std::map<std::pair<dof_id_type, unsigned int>, Point>::const_iterator pos =
207 _bnd_side_normal.find(std::pair<dof_id_type, unsigned int>(elementid, side));
210 mooseError(
"Boundary side normal values are not cached for element id '",
223 Threads::spin_mutex::scoped_lock lock(
_mutex);
224 std::map<std::pair<dof_id_type, dof_id_type>,
Real>::const_iterator pos =
225 _side_area.find(std::pair<dof_id_type, dof_id_type>(elementid, neighborid));
228 mooseError(
"Side area values are not cached for element id '",
230 "' and neighbor id '",
241 Threads::spin_mutex::scoped_lock lock(
_mutex);
242 std::map<std::pair<dof_id_type, unsigned int>,
Real>::const_iterator pos =
243 _bnd_side_area.find(std::pair<dof_id_type, unsigned int>(elementid, side));
246 mooseError(
"Boundary side area values are not cached for element id '",
265 std::ostringstream oss;
269 oss.write((
char *)&size,
sizeof(size));
278 serialized_buffer.assign(oss.str());
285 std::istringstream iss;
288 "Unexpected size of serialized_buffers: " << serialized_buffers.size());
290 for (
auto rank = decltype(
_app.
n_processors())(0); rank < serialized_buffers.size(); ++rank)
295 iss.str(serialized_buffers[rank]);
300 unsigned int size = 0;
301 iss.read((
char *)&size,
sizeof(size));
303 for (
unsigned int i = 0; i < size; i++)
308 std::vector<RealGradient>
value;
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 Parallel::Communicator & comm() const
void allgather_packed_range(Context *context, Iter range_begin, const Iter range_end, OutputIter out, std::size_t approx_buffer_size=1000000) const
virtual void initialize()
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...
static InputParameters validParams()
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 ...
void storeHelper(std::ostream &stream, P &data, void *context)
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
processor_id_type n_processors() const
virtual void computeElement()
virtual void deserialize(std::vector< std::string > &serialized_buffers)
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
virtual const std::vector< Real > & getElementAverageValue(dof_id_type elementid) const
accessor function call to get element average variable values
virtual const Real & getBoundarySideArea(dof_id_type elementid, unsigned int side) const
accessor function call to get cached boundary side area
virtual void meshChanged()
SlopeReconstructionBase(const InputParameters ¶meters)
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
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
std::set< dof_id_type > _interface_elem_ids
List of element IDs that are on the processor boundary and need to be send to other processors...
virtual const Point & getSideCentroid(dof_id_type elementid, dof_id_type neighborid) const
accessor function call to get cached internal side centroid
virtual void meshChanged()
void mooseError(Args &&... args) const
virtual void initialize()
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 ...
processor_id_type processor_id() const
bool _side_geoinfo_cached
flag to indicated if side geometry info is cached
void loadHelper(std::istream &stream, P &data, void *context)
void ErrorVector unsigned int
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 ...
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