Commit 78b57faf authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'fix/gmshreader-alu' into 'master'

Fix makeGridFromFile for ALUGrid

Closes #729

See merge request !1709
parents 55e2ac09 a35bc7c4
......@@ -24,6 +24,8 @@
#ifndef DUMUX_IO_GRID_MANAGER_ALU_HH
#define DUMUX_IO_GRID_MANAGER_ALU_HH
#include <dune/common/version.hh>
// ALUGrid specific includes
#if HAVE_DUNE_ALUGRID
#include <dune/alugrid/grid.hh>
......@@ -158,7 +160,11 @@ public:
{
std::vector<int> boundaryMarkersInsertionIndex, boundaryMarkers, faceMarkers, elementMarkers;
auto gridFactory = std::make_unique<Dune::GridFactory<Grid>>();
// Older versions of Dune(-Alugrid) require that the Gmsh file is read only on process 0
#if DUNE_VERSION_LT(DUNE_GRID, 2, 7)
if (Dune::MPIHelper::getCollectiveCommunication().rank() == 0)
#endif
Dune::GmshReader<Grid>::read(*gridFactory, fileName, boundaryMarkersInsertionIndex, elementMarkers, verbose, boundarySegments);
ParentType::gridPtr() = std::shared_ptr<Grid>(gridFactory->createGrid());
......@@ -186,7 +192,11 @@ public:
else
{
auto gridFactory = std::make_unique<Dune::GridFactory<Grid>>();
// Older versions of Dune(-Alugrid) require that the Gmsh file is read only on process 0
#if DUNE_VERSION_LT(DUNE_GRID, 2, 7)
if (Dune::MPIHelper::getCollectiveCommunication().rank() == 0)
#endif
Dune::GmshReader<Grid>::read(*gridFactory, fileName, verbose, boundarySegments);
ParentType::gridPtr() = std::shared_ptr<Grid>(gridFactory->createGrid());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment