27 #ifndef EWOMS_VERTEX_BORDER_LIST_FROM_GRID_HH 28 #define EWOMS_VERTEX_BORDER_LIST_FROM_GRID_HH 33 #include <dune/grid/common/datahandleif.hh> 34 #include <dune/grid/common/gridenums.hh> 35 #include <dune/common/version.hh> 48 template <
class Gr
idView,
class VertexMapper>
50 :
public Dune::CommDataHandleIF<VertexBorderListFromGrid<GridView, VertexMapper>,
53 static const int dimWorld = GridView::dimensionworld;
57 : gridView_(gridView), map_(map)
59 gridView.communicate(*
this,
60 Dune::InteriorBorder_InteriorBorder_Interface,
61 Dune::ForwardCommunication);
63 auto vIt = gridView.template begin<dimWorld>();
64 const auto& vEndIt = gridView.template end<dimWorld >();
65 for (; vIt != vEndIt; ++vIt) {
66 if (vIt->partitionType() != Dune::InteriorEntity
67 && vIt->partitionType() != Dune::BorderEntity)
69 Index vIdx =
static_cast<Index>(map_.index(*vIt));
70 blackList_.addIndex(vIdx);
76 bool contains(
int dim,
int codim)
const 77 {
return dim == codim; }
79 bool fixedSize(
int,
int)
const 82 template <
class EntityType>
83 size_t size(
const EntityType&)
const 86 template <
class MessageBufferImp,
class EntityType>
87 void gather(MessageBufferImp& buff,
const EntityType& e)
const 89 buff.write(static_cast<int>(gridView_.comm().rank()));
90 buff.write(static_cast<int>(map_.index(e)));
93 template <
class MessageBufferImp,
class EntityType>
94 void scatter(MessageBufferImp& buff,
const EntityType& e,
size_t)
111 borderList_.push_back(bIdx);
116 {
return borderList_; }
120 {
return blackList_; }
123 const GridView gridView_;
124 const VertexMapper& map_;
A single index intersecting with the process boundary.
Definition: overlaptypes.hh:101
Expresses which degrees of freedom are blacklisted for the parallel linear solvers and which domestic...
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
Definition: blackoilbioeffectsmodules.hh:45
Index peerIdx
Index of the entity for the peer process.
Definition: overlaptypes.hh:107
This files provides several data structures for storing tuples of indices of remote and/or local proc...
unsigned ProcessRank
The type of the rank of a process.
Definition: overlaptypes.hh:49
Expresses which degrees of freedom are blacklisted for the parallel linear solvers and which domestic...
Definition: blacklist.hh:48
Index localIdx
Index of the entity for the local process.
Definition: overlaptypes.hh:104
Uses communication on the grid to find the initial seed list of indices.
Definition: vertexborderlistfromgrid.hh:49
BorderDistance borderDistance
Distance to the process border for the peer (in hops)
Definition: overlaptypes.hh:113
ProcessRank peerRank
Rank of the peer process.
Definition: overlaptypes.hh:110
std::list< BorderIndex > BorderList
This class managages a list of indices which are on the border of a process' partition of the grid...
Definition: overlaptypes.hh:120
int Index
The type of an index of a degree of freedom.
Definition: overlaptypes.hh:44