27 #ifndef EWOMS_VERTEX_BORDER_LIST_FROM_GRID_HH
28 #define EWOMS_VERTEX_BORDER_LIST_FROM_GRID_HH
33 #include <opm/common/Unused.hpp>
35 #include <dune/grid/common/datahandleif.hh>
36 #include <dune/grid/common/gridenums.hh>
37 #include <dune/istl/bcrsmatrix.hh>
38 #include <dune/istl/scalarproducts.hh>
39 #include <dune/istl/operators.hh>
40 #include <dune/common/version.hh>
55 template <
class Gr
idView,
class VertexMapper>
57 :
public Dune::CommDataHandleIF<VertexBorderListFromGrid<GridView, VertexMapper>,
60 static const int dimWorld = GridView::dimensionworld;
64 : gridView_(gridView), map_(map)
66 gridView.communicate(*
this,
67 Dune::InteriorBorder_InteriorBorder_Interface,
68 Dune::ForwardCommunication);
70 auto vIt = gridView.template begin<dimWorld>();
71 const auto& vEndIt = gridView.template end<dimWorld >();
72 for (; vIt != vEndIt; ++vIt) {
73 if (vIt->partitionType() != Dune::InteriorEntity
74 && vIt->partitionType() != Dune::BorderEntity)
76 Index vIdx =
static_cast<Index
>(map_.index(*vIt));
77 blackList_.addIndex(vIdx);
83 bool contains(
int dim,
int codim)
const
84 {
return dim == codim; }
86 bool fixedsize(
int dim OPM_UNUSED,
int codim OPM_UNUSED)
const
89 template <
class EntityType>
90 size_t size(
const EntityType& e OPM_UNUSED)
const
93 template <
class MessageBufferImp,
class EntityType>
94 void gather(MessageBufferImp& buff,
const EntityType& e)
const
96 buff.write(static_cast<int>(gridView_.comm().rank()));
97 buff.write(static_cast<int>(map_.index(e)));
100 template <
class MessageBufferImp,
class EntityType>
101 void scatter(MessageBufferImp& buff,
const EntityType& e,
size_t n OPM_UNUSED)
105 bIdx.
localIdx =
static_cast<Index
>(map_.index(e));
109 bIdx.
peerRank =
static_cast<ProcessRank
>(tmp);
114 bIdx.
peerIdx =
static_cast<Index
>(tmp);
118 borderList_.push_back(bIdx);
122 const BorderList& borderList()
const
123 {
return borderList_; }
127 {
return blackList_; }
130 const GridView gridView_;
131 const VertexMapper& map_;
132 BorderList borderList_;
Expresses which degrees of freedom are blacklisted for the parallel linear solvers and which domestic...
Index peerIdx
Index of the entity for the peer process.
Definition: overlaptypes.hh:107
Index localIdx
Index of the entity for the local process.
Definition: overlaptypes.hh:104
Expresses which degrees of freedom are blacklisted for the parallel linear solvers and which domestic...
Definition: blacklist.hh:47
ProcessRank peerRank
Rank of the peer process.
Definition: overlaptypes.hh:110
This files provides several data structures for storing tuples of indices of remote and/or local proc...
BorderDistance borderDistance
Distance to the process border for the peer (in hops)
Definition: overlaptypes.hh:113
Uses communication on the grid to find the initial seed list of indices.
Definition: vertexborderlistfromgrid.hh:56
A single index intersecting with the process boundary.
Definition: overlaptypes.hh:101