diff --git a/tests/models/test_quadrature.cpp b/tests/models/test_quadrature.cpp index 9e885752f..3795600a8 100644 --- a/tests/models/test_quadrature.cpp +++ b/tests/models/test_quadrature.cpp @@ -34,6 +34,13 @@ #if HAVE_DUNE_ALUGRID #include +#if HAVE_MPI +template +using AluGrid = Dune::ALUGrid; +#else +template +using AluGrid = Dune::ALUGrid; +#endif //HAVE_MPI #endif #include @@ -107,7 +114,7 @@ void writeTetrahedronSubControlVolumes([[maybe_unused]] const Grid& grid) #if HAVE_DUNE_ALUGRID using GridView = typename Grid::LeafGridView; - using Grid2 = Dune::ALUGrid; + using Grid2 = AluGrid; using GridView2 = typename Grid2::LeafGridView; using GridFactory2 = Dune::GridFactory; @@ -156,9 +163,9 @@ void writeTetrahedronSubControlVolumes([[maybe_unused]] const Grid& grid) } } - const auto &grid2 = *gf2.createGrid(); + const auto grid2 = gf2.createGrid(); using VtkWriter = Dune::VTKWriter; - VtkWriter writer(grid2.leafView(), Dune::VTK::conforming); + VtkWriter writer(grid2->leafView(), Dune::VTK::conforming); writer.write("tetrahedron-scvs", Dune::VTK::ascii); #endif // HAVE_DUNE_ALUGRID } @@ -166,7 +173,7 @@ void writeTetrahedronSubControlVolumes([[maybe_unused]] const Grid& grid) void testTetrahedron() { #if HAVE_DUNE_ALUGRID - using Grid = Dune::ALUGrid; + using Grid = AluGrid; using GridFactory = Dune::GridFactory; GridFactory gf; Scalar corners[][3] = { { 0, 0, 0 }, { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }; @@ -180,10 +187,10 @@ void testTetrahedron() std::vector v = { 0, 1, 2, 3 }; // in Dune >= 2.6 topologyIds seem to be opaque integers. WTF!? gf.insertElement(Dune::GeometryType(/*topologyId=*/0, dim), v); - const auto& grid = *gf.createGrid(); + const auto grid = gf.createGrid(); // write the sub-control volumes to a VTK file. - writeTetrahedronSubControlVolumes(grid); + writeTetrahedronSubControlVolumes(*grid); #endif // HAVE_DUNE_ALUGRID } @@ -192,8 +199,7 @@ void writeCubeSubControlVolumes([[maybe_unused]] const Grid& grid) { #if HAVE_DUNE_ALUGRID using GridView = typename Grid::LeafGridView; - - using Grid2 = Dune::ALUGrid; + using Grid2 = AluGrid; using GridView2 = typename Grid2::LeafGridView; using GridFactory2 = Dune::GridFactory; using Stencil = Opm::VcfvStencil; @@ -242,9 +248,9 @@ void writeCubeSubControlVolumes([[maybe_unused]] const Grid& grid) } } - const auto &grid2 = *gf2.createGrid(); + const auto grid2 = gf2.createGrid(); using VtkWriter = Dune::VTKWriter; - VtkWriter writer(grid2.leafView(), Dune::VTK::conforming); + VtkWriter writer(grid2->leafView(), Dune::VTK::conforming); writer.write("cube-scvs", Dune::VTK::ascii); #endif // HAVE_DUNE_ALUGRID } @@ -252,7 +258,7 @@ void writeCubeSubControlVolumes([[maybe_unused]] const Grid& grid) void testCube() { #if HAVE_DUNE_ALUGRID - using Grid = Dune::ALUGrid; + using Grid = AluGrid; using GridFactory = Dune::GridFactory; GridFactory gf; Scalar corners[][3] = { { 0, 0, 0 }, @@ -273,10 +279,10 @@ void testCube() std::vector v = { 0, 1, 2, 3, 4, 5, 6, 7 }; // in Dune >= 2.6 topologyIds seem to be opaque integers. WTF!? gf.insertElement(Dune::GeometryType((1 << dim) - 1, dim), v); - const auto& grid = *gf.createGrid(); + const auto grid = gf.createGrid(); // write the sub-control volumes to a VTK file. - writeCubeSubControlVolumes(grid); + writeCubeSubControlVolumes(*grid); #endif // HAVE_DUNE_ALUGRID }