From 11e30775b6d1b8a3e62fb631ad1d68bbe9efc9df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de>
Date: Thu, 13 Sep 2018 10:28:19 +0200
Subject: [PATCH] Read msh file directly instead of using ini factory in
 constistent_gmsh

---
 bin/analyzegrid/consistent_gmsh.cc | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/bin/analyzegrid/consistent_gmsh.cc b/bin/analyzegrid/consistent_gmsh.cc
index 00e7d889..cda4729a 100644
--- a/bin/analyzegrid/consistent_gmsh.cc
+++ b/bin/analyzegrid/consistent_gmsh.cc
@@ -1,10 +1,10 @@
 #include "config.h"
 
+#include <iostream>
+#include <iomanip>
 #include <dune/common/parallel/mpihelper.hh>
-#include <dune/common/parametertree.hh>
-#include "dune/common/parametertreeparser.hh"
 #include <dune/grid/uggrid.hh>
-#include <dune/testtools/gridconstruction.hh>
+#include <dune/grid/io/file/gmshreader.hh>
 
 #include <dune/consistent-edge-orientation/createconsistentgrid.hh>
 
@@ -12,15 +12,14 @@ int main(int argc, char** argv){
    try
    {
     if (argc != 3){
-      std::cout << "Need ini file and output filename." << std::endl;
+      std::cout << "Need input gmsh file and output filename." << std::endl;
       return 1;
     }
 
     // Initialize basic stuff...
     Dune::MPIHelper& mpihelper = Dune::MPIHelper::instance(argc, argv);
     using RangeType = double;
-    Dune::ParameterTree initree;
-    Dune::ParameterTreeParser::readINITree(argv[1], initree);
+    std::string infile = std::string(argv[1]);
 
     // From the ini file we can't extract if the grid is a 2D or a 3D grid. We
     // just try the 3D case. If the msh file is a 2D grid Dune will throw an
@@ -30,8 +29,7 @@ int main(int argc, char** argv){
       const int dim = 3;
       using Grid = Dune::UGGrid<dim>;
       using GV = Grid::LeafGridView;
-      IniGridFactory<Grid> factory(initree);
-      std::shared_ptr<Grid> grid = factory.getGrid();
+      auto grid = Dune::GmshReader<Grid>::read(infile);
       GV gv = grid->leafGridView();
 
       std::string filename = std::string(argv[2]);
@@ -42,8 +40,7 @@ int main(int argc, char** argv){
       const int dim = 2;
       using Grid = Dune::UGGrid<dim>;
       using GV = Grid::LeafGridView;
-      IniGridFactory<Grid> factory(initree);
-      std::shared_ptr<Grid> grid = factory.getGrid();
+      auto grid = Dune::GmshReader<Grid>::read(infile);
       GV gv = grid->leafGridView();
 
       std::string filename = std::string(argv[2]);
-- 
GitLab