Commit b570b50f authored by Lukas Riedel's avatar Lukas Riedel 📝

reading Gmsh only for rank 0 because GridFactory<UGGrid> should only be used on rank 0

parent 3817890e
......@@ -100,7 +100,6 @@ int main(int argc, char** argv)
}
}
else if (gtype == "rectangular"){
/*
if(adaptivity){
auto grid = Dune::Dorie::build_grid_cube<Dune::UGGrid<2>>(inifile,helper);
switch(FEorder){
......@@ -114,7 +113,6 @@ int main(int argc, char** argv)
}
}
else{ // no adaptivity
*/
auto grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<2>>(inifile,helper);
switch(FEorder){
case 1:{
......@@ -125,7 +123,7 @@ int main(int argc, char** argv)
default:
DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!");
}
//}
}
}
else
DUNE_THROW(Dune::NotImplemented,"Grid Type not supported!");
......
......@@ -54,7 +54,6 @@ std::shared_ptr<GridType> build_grid_gmsh (const Dune::ParameterTree& inifile, c
const int verbose = inifile.get<int>("output.verbose");
const int level = inifile.get<int>("grid.initialLevel");
const std::string meshfilename = inifile.get<std::string>("grid.gridFile");
typedef std::vector<int> GmshIndexMap;
if(verbose>0 && helper.rank()==0){
std::cout << "GRID SETUP:" << std::endl;
......@@ -64,11 +63,13 @@ std::shared_ptr<GridType> build_grid_gmsh (const Dune::ParameterTree& inifile, c
}
auto grid = std::make_shared<GridType>();
GmshIndexMap boundary_index_map;
GmshIndexMap element_index_map;
Dune::GridFactory<GridType> factory(grid.get());
Dune::GmshReader<GridType>::read(factory,meshfilename,boundary_index_map,element_index_map,verbose>2?true:false,false);
factory.createGrid();
Dune::GridFactory<GridType> factory;
if(helper.rank() == 0){
std::vector<int> boundary_index_map;
std::vector<int> element_index_map;
Dune::GmshReader<GridType>::read(factory,meshfilename,boundary_index_map,element_index_map,verbose>2?true:false,false);
}
grid.get() = factory.createGrid();
grid->globalRefine(level);
grid->loadBalance();
......
Markdown is supported
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