24#ifndef BLOCK_COMMUNICATION_NEIGHBORHOOD_H
25#define BLOCK_COMMUNICATION_NEIGHBORHOOD_H
41template<
typename T>
class SuperCommunicationTagCoordinator;
47template<
typename T,
unsigned D>
56 std::vector<std::type_index> _fieldsRequested;
58 std::map<int, std::vector<std::type_index>> _fieldsCommonWith;
60 std::map<int, std::vector<CellID>> _cellsInboundFrom;
61 std::map<int, std::vector<CellID>> _cellsOutboundTo;
62 std::map<int, std::vector<CellID>> _cellsRequestedFrom;
64#ifdef PARALLEL_MODE_MPI
65 MPI_Comm _neighborhoodComm;
67 std::map<int, std::unique_ptr<MpiSendRequest>> _fieldRequests;
68 std::map<int, std::unique_ptr<MpiSendRequest>> _cellsRequests;
76#ifdef PARALLEL_MODE_MPI
82 template <
typename FIELD>
84 if (std::find(_fieldsRequested.begin(), _fieldsRequested.end(),
typeid(FIELD)) == _fieldsRequested.end()) {
85 _fieldsRequested.emplace_back(
typeid(FIELD));
86 _fieldsAvailable.
resize(_fieldsRequested.size());
105 template <
typename BLOCK>
110#ifdef PARALLEL_MODE_MPI
117 template <
typename F>
119 for (
const auto& [iC, _] : _cellsRequestedFrom) {
Configurable overlap communication neighborhood of a block.
void requestOverlap(int width)
Request all cells in overlap of size width for communication.
const std::vector< CellID > & getCellsRequestedFrom(int iC) const
void requestField()
Request field and provides local availability.
const std::vector< CellID > & getCellsOutboundTo(int iC) const
BlockCommunicationNeighborhood(CuboidGeometry< T, D > &cuboidGeometry, LoadBalancer< T > &loadBalancer, int iC, int padding, MPI_Comm comm)
const std::vector< std::type_index > & getFieldsCommonWith(int iC) const
const std::vector< CellID > & getCellsInboundFrom(int iC) const
void setFieldsAvailability(int iC, BLOCK &block)
Update outbound availabilities for locally available neighbor block.
void receive(SuperCommunicationTagCoordinator< T > &)
void clearRequestedCells()
Remove all requested cells.
void requestCell(LatticeR< D > latticeR)
Request individual cell for communication.
void send(SuperCommunicationTagCoordinator< T > &)
void forNeighbors(F f) const
Calls f(iC) for every neighboring cuboid ID iC.
void setFieldAvailability(std::type_index field, bool available)
Update local availability of previously requested field.
Base class for all LoadBalancer.
Communication-free negotation of unique tags for inter-cuboid communication.
Plain column for SISD CPU targets (default)
void resize(std::size_t count)
Top level namespace for all of OpenLB.
std::conditional_t< D==2, CuboidGeometry2D< T >, CuboidGeometry3D< T > > CuboidGeometry
std::conditional_t< D==2, BlockIndicatorF2D< T >, BlockIndicatorF3D< T > > BlockIndicatorF