diff --git a/dune/xt/grid/gridprovider/factory.hh b/dune/xt/grid/gridprovider/factory.hh index 7d1aecf6bf6b40a74f3e9a76dee49b7eb93eaaad..5107bf18d4c31e62007bde5dcf35fcfedc185ecf 100644 --- a/dune/xt/grid/gridprovider/factory.hh +++ b/dune/xt/grid/gridprovider/factory.hh @@ -90,6 +90,10 @@ public: const Common::Configuration config = Common::Configuration(), MPIHelper::MPICommunicator mpi_comm = MPIHelper::getCommunicator()) { + if (is_alugrid<GridType>::value && mpi_comm != MPIHelper::getCommunicator()) { + DUNE_THROW(InvalidStateException, + "Alugrid either ignores, or outright fails with non-world comes when used here"); + } if (CubeType::static_id() == type) return call_create<CubeType>(config, mpi_comm); else if (DgfType::static_id() == type) @@ -161,6 +165,11 @@ public: const Common::Configuration config = Common::Configuration(), MPIHelper::MPICommunicator mpi_comm = MPIHelper::getCommunicator()) { + if (is_alugrid<GridType>::value && mpi_comm != MPIHelper::getCommunicator()) { + DUNE_THROW(InvalidStateException, + "Alugrid either ignores, or outright fails with non-world comes when used here"); + } + if (CubeType::static_id() == type) return call_create<CubeType>(config, mpi_comm); else if (available().empty()) diff --git a/dune/xt/grid/test/mpi_grid.tpl b/dune/xt/grid/test/mpi_grid.tpl index 53980c31b1bac67f5ce4018774dfd8dbe7096b48..59301ba8d509483357e08b8a21298195b305822a 100644 --- a/dune/xt/grid/test/mpi_grid.tpl +++ b/dune/xt/grid/test/mpi_grid.tpl @@ -27,7 +27,7 @@ GTEST_TEST(GridProvider_{{name}}, layers) MPI_Comm split_comm; MPI_Comm_split(MPI_COMM_WORLD, world_rank, world_rank, &split_comm); - {% if "cube" in type or "UGGrid" in type %} + {% if "ALU" in type or "UGGrid" in type %} // uggrid + alu cube grids cannot handle non-default comms EXPECT_THROW(ProviderFactory::create(config, split_comm), Dune::InvalidStateException); return; diff --git a/python/dune/xt/grid/grids.bindings.hh b/python/dune/xt/grid/grids.bindings.hh index 022f5eb268a989a366ed0cff2b97851e8e89e662..474cbf73d20041b30861c75549b05fa1419f8d1a 100644 --- a/python/dune/xt/grid/grids.bindings.hh +++ b/python/dune/xt/grid/grids.bindings.hh @@ -109,7 +109,7 @@ struct grid_name<ALUGrid<dim, dim, cube, conforming, Comm>> // not optimal -template<int dim, int dimworld, ALU3dGridElementType elType, class Comm> +template <int dim, int dimworld, ALU3dGridElementType elType, class Comm> struct grid_name<ALU3dGrid<dim, dimworld, elType, Comm>> { static std::string value()