12 #include "libmesh/parallel.h" 13 #include "libmesh/parallel_algebra.h" 25 "Base class for slope limiting to limit the slopes of cell average variables.");
27 params.
addParam<
bool>(
"include_bc",
true,
"Indicate whether to include bc, default = true");
36 _include_bc(getParam<bool>(
"include_bc")),
37 _q_point_face(_assembly.qPointsFace()),
38 _qrule_face(_assembly.qRuleFace()),
39 _JxW_face(_assembly.JxWFace()),
40 _normals_face(_assembly.normals()),
41 _side(_assembly.side()),
42 _side_elem(_assembly.sideElem()),
43 _side_volume(_assembly.sideElemVolume()),
44 _neighbor_elem(_assembly.neighbor())
56 const std::vector<RealGradient> &
59 Threads::spin_mutex::scoped_lock lock(
_mutex);
60 std::map<dof_id_type, std::vector<RealGradient>>::const_iterator pos =
_lslope.find(elementid);
63 mooseError(
"Limited slope is not cached for element id '", elementid,
"' in ", __FUNCTION__);
79 std::ostringstream oss;
83 oss.write((
char *)&size,
sizeof(size));
92 serialized_buffer.assign(oss.str());
99 std::istringstream iss;
102 "Unexpected size of serialized_buffers: " << serialized_buffers.size());
104 for (
auto rank = decltype(
_app.
n_processors())(0); rank < serialized_buffers.size(); ++rank)
109 iss.str(serialized_buffers[rank]);
114 unsigned int size = 0;
115 iss.read((
char *)&size,
sizeof(size));
117 for (
unsigned int i = 0; i < size; i++)
122 std::vector<RealGradient>
value;
138 std::vector<std::string> send_buffers(1);
139 std::vector<std::string> recv_buffers;
144 send_buffers.begin(),
146 std::back_inserter(recv_buffers));
virtual const std::vector< RealGradient > & getElementSlope(dof_id_type elementid) const
accessor function call
virtual void serialize(std::string &serialized_buffer)
A base class that loops over elements and do things.
static InputParameters validParams()
std::map< dof_id_type, std::vector< RealGradient > > & _lslope
store the updated slopes into this map indexed by element ID
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()
static InputParameters validParams()
virtual void computeElement()
void storeHelper(std::ostream &stream, P &data, void *context)
processor_id_type n_processors() const
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
static Threads::spin_mutex _mutex
SlopeLimitingBase(const InputParameters ¶meters)
virtual void deserialize(std::vector< std::string > &serialized_buffers)
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 void initialize()
virtual std::vector< RealGradient > limitElementSlope() const =0
compute the slope of the cell
void mooseError(Args &&... args) const
const Elem * _current_elem
processor_id_type processor_id() const
void loadHelper(std::istream &stream, P &data, void *context)