Skip to content
Snippets Groups Projects
Commit 11e30775 authored by René Heß's avatar René Heß
Browse files

Read msh file directly instead of using ini factory in constistent_gmsh

parent 911e94fa
No related branches found
No related tags found
No related merge requests found
#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]);
......
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