Incorrect Ghost count for parallel conforming simplex grid?
I think I'm doing something wrong in my grid setup, but I cannot figure out what. I've distilled my problem down to this snippet
#include <config.h>
#include <iostream>
#include <dune/alugrid/grid.hh>
#include <dune/alugrid/dgf.hh>
#include <dune/alugrid/common/structuredgridfactory.hh>
template <class Grid>
void check()
{
using namespace Dune;
std::array<int, 2> num_el{16, 16};
auto grid = Dune::StructuredGridFactory<Grid>::createSimplexGrid({0, 0}, {1, 1}, num_el);
grid->loadBalance();
std::size_t count{0};
for(auto&& entity : elements(grid->leafGridView(), Partitions::all)) {
count += int(entity.partitionType() == GhostEntity);
}
count = grid->comm().sum(count);
if (grid->comm().rank() == 0)
std::cout << "Ghost count: " << count << std::endl;
}
int main(int argc, char** argv)
{
using namespace Dune;
Dune::MPIHelper::instance(argc, argv);
check<Dune::ALUGrid<2, 2, simplex, nonconforming, ALUGridMPIComm>>();
check<Dune::ALUGrid<2, 2, simplex, conforming, ALUGridMPIComm>>();
check<Dune::ALUGrid<2, 2, cube, nonconforming, ALUGridMPIComm>>();
}
This is supposed to output the sum total number of ghost entities across all ranks. I had assumed this number to be greater than 0 for all setups with more than one rank. For ALUGrid<2, 2, simplex, conforming, ALUGridMPIComm>
however I do get 0. Output for two ranks:
Ghost count: 52
Ghost count: 0
Ghost count: 32