Skip to content
Snippets Groups Projects
Commit 6cd93720 authored by Timo Koch's avatar Timo Koch
Browse files

[gridcreator] Fix gmsh grids for parallel alugrid runs

Dune-alugrid needs the gmsh reader to only fill the grid factory on rank 0.
See mergerequest !14 https://gitlab.dune-project.org/core/dune-grid/merge_requests/14.
This is different e.g. for UG that needs the grid on all processes.
parent 3f36a3ef
No related branches found
No related tags found
1 merge request!183[gridcreator] Fix gmsh grids for parallel alugrid runs
......@@ -254,11 +254,27 @@ protected:
if(domainMarkers)
{
enableGmshDomainMarkers_ = true;
gridPtr() = std::shared_ptr<Grid>(Dune::GmshReader<Grid>::read(fileName, boundaryMarkers_, elementMarkers_, verbose, boundarySegments));
if (Dune::MPIHelper::getCollectiveCommunication().rank() == 0)
{
gridPtr() = std::shared_ptr<Grid>(Dune::GmshReader<Grid>::read(fileName, boundaryMarkers_, elementMarkers_, verbose, boundarySegments));
}
else
{
Dune::GridFactory<Grid> factory;
gridPtr() = std::shared_ptr<Grid>(factory.createGrid());
}
}
else
{
gridPtr() = std::shared_ptr<Grid>(Dune::GmshReader<Grid>::read(fileName, verbose, boundarySegments));
if (Dune::MPIHelper::getCollectiveCommunication().rank() == 0)
{
gridPtr() = std::shared_ptr<Grid>(Dune::GmshReader<Grid>::read(fileName, verbose, boundarySegments));
}
else
{
Dune::GridFactory<Grid> factory;
gridPtr() = std::shared_ptr<Grid>(factory.createGrid());
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment