UniqueBorderPartitionTest.cpp 1.05 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <amdis/AMDiS.hpp>
#include <amdis/utility/UniqueBorderPartition.hpp>

#include <dune/grid/yaspgrid.hh>

#include "Tests.hpp"

using namespace AMDiS;

template <class GridView>
void test(GridView const& gv)
{
  using Grid = typename GridView::Grid;
  using DataHandle = UniqueBorderPartitionDataHandle<Grid>;

  using EntitySet = typename DataHandle::EntitySet;
  EntitySet borderEntities;

  DataHandle handle(gv.comm().rank(), borderEntities, gv.grid().globalIdSet());
  gv.communicate(handle,
    Dune::InterfaceType::InteriorBorder_InteriorBorder_Interface,
    Dune::CommunicationDirection::ForwardCommunication);

  msg("#borderEntities = {}", borderEntities.size());
}

int main(int argc, char** argv)
{
  Environment env(argc, argv);

31
32
33
  Dune::YaspGrid<2> grid1({1.0, 1.0}, {8,8}, 0, 0); // no overlap
  Dune::YaspGrid<2> grid2({1.0, 1.0}, {8,8}, 0, 1); // overlap = 1
  Dune::YaspGrid<3> grid3({1.0, 1.0, 1.0}, {8,8,8}, 0, 1); // overlap = 1
34
35
36
37
38
39
40

  test(grid1.leafGridView());
  test(grid2.leafGridView());
  test(grid3.leafGridView());

  return report_errors();
}