[Dune] Problem mit GmshReader

conf86 at web.de conf86 at web.de
Tue May 26 13:37:14 CEST 2015


Hallo,

ich versuche gerade ein UG-Gitter aus einer gmsh-Datei zu erzeugen.
Ich habe es zunächst so versucht, wie es hier geschrieben steht: https://spline.de/static/talks/dune-project.pdf (Seite 25)

 L. 98 typedef Dune::UGGrid<2> GridType;
 L. 99 GridType grid;
 L.100 Dune::GmshReader<GridType>::read(grid, "TEST.geo");   

und bekomme diese Fehlermeldungen:

 TEST.cc: In function 'int main(int, char**)':
 TEST.cc:100:58: error: no matching function for call to 'Dune::GmshReader<Dune::UGGrid<2> >::read(GridType&, const char [11])'
       Dune::GmshReader<GridType>::read(grid, "TEST.geo");   
                                                          ^
 TEST.cc:100:58: note: candidates are:
 In file included from TEST.cc:18:0:
 /lib/include/dune/grid/io/file/gmshreader.hh:667:18: note: static Dune::GmshReader<GridType>::Grid* Dune::GmshReader<GridType>::read(const string&, bool, bool) [with GridType =  Dune::UGGrid<2>; Dune::GmshReader<GridType>::Grid = Dune::UGGrid<2>; std::string = std::basic_string<char>]
      static Grid* read (const std::string& fileName, bool verbose = true, bool insert_boundary_segments=true)
                  ^
 /lib/include/dune/grid/io/file/gmshreader.hh:667:18: note:   no known conversion for argument 1 from 'GridType {aka Dune::UGGrid<2>}' to 'const string& {aka const std::basic_string<char>&}'
 /lib/include/dune/grid/io/file/gmshreader.hh:680:18: note: static Dune::GmshReader<GridType>::Grid* Dune::GmshReader<GridType>::read(const string&, std::vector<int>&, std::vector<int>&, bool, bool) [with GridType = Dune::UGGrid<2>; Dune::GmshReader<GridType>::Grid = Dune::UGGrid<2>; std::string = std::basic_string<char>]
      static Grid* read (const std::string& fileName,
                  ^
 /lib/include/dune/grid/io/file/gmshreader.hh:680:18: note:   candidate expects 5 arguments, 2 provided
 /lib/include/dune/grid/io/file/gmshreader.hh:699:17: note: static void Dune::GmshReader<GridType>::read(Dune::GridFactory<GridType>&, const string&, bool, bool) [with GridType = Dune::UGGrid<2>; std::string = std::basic_string<char>]
      static void read (Dune::GridFactory<Grid>& factory, const std::string& fileName,
                 ^
 /lib/include/dune/grid/io/file/gmshreader.hh:699:17: note:   no known conversion for argument 1 from 'GridType {aka Dune::UGGrid<2>}' to 'Dune::GridFactory<Dune::UGGrid<2> >&'
 /lib/include/dune/grid/io/file/gmshreader.hh:708:17: note: static void Dune::GmshReader<GridType>::read(Dune::GridFactory<GridType>&, const string&, std::vector<int>&, std::vector<int>&, bool, bool) [with GridType = Dune::UGGrid<2>; std::string = std::basic_string<char>]
     static void read (Dune::GridFactory<Grid>& factory,
                 ^
 /lib/include/dune/grid/io/file/gmshreader.hh:708:17: note:   candidate expects 6 arguments, 2 provided


Ich habe es dann wie es oben in "candidates are" der Fehlermeldung stand auch so versucht:

 L. 98 typedef Dune::UGGrid<2> GridType;
 L. 99 GridType grid;
 L.100 Dune::GmshReader<GridType>::read("TEST.geo",true,true);   

da bekomme ich dann allerdings diese Fehlermeldungen:

 TEST-TEST.o: In function `main':
 /home/myname/TEST/src/TEST.cc:99: undefined reference to `Dune::UGGrid<2>::UGGrid()'
 TEST-TEST.o: In function `Dune::GmshReader<Dune::UGGrid<2> >::read(std::string const&, bool, bool)':
 /lib/include/dune/grid/io/file/gmshreader.hh:670: undefined reference to `Dune::GridFactory<Dune::UGGrid<2> >::GridFactory()'
 /lib/include/dune/grid/io/file/gmshreader.hh:676: undefined reference to `Dune::GridFactory<Dune::UGGrid<2> >::createGrid()'
 /lib/include/dune/grid/io/file/gmshreader.hh:676: undefined reference to `Dune::GridFactory<Dune::UGGrid<2> >::~GridFactory()'
 TEST-TEST.o: In function `main':
 /home/myname/TEST/src/TEST.cc:100: undefined reference to `Dune::UGGrid<2>::~UGGrid()'
 TEST-TEST.o: In function `Dune::GmshReader<Dune::UGGrid<2> >::read(std::string const&, bool, bool)':
 /lib/include/dune/grid/io/file/gmshreader.hh:676: undefined reference to `Dune::GridFactory<Dune::UGGrid<2> >::~GridFactory()'
 TEST-TEST.o: In function `main':
 /home/myname/TEST/src/TEST.cc:100: undefined reference to `Dune::UGGrid<2>::~UGGrid()'


bzw. so wie hier: http://www.uni-graz.at/~haasegu/Lectures/HPC-II/SS12/Talks/kucher_presentation_june_14.pdf (Seite 9)

 typedef Dune::UGGrid<2> GridType;
 GridType* grid = Dune::GmshReader<GridType>::read(std::string("TEST.geo"),true,true);

und die Fehlermeldungen:

 TEST-TEST.o: In function `Dune::GmshReader<Dune::UGGrid<2> >::read(std::string const&, bool, bool)':
 /lib/include/dune/grid/io/file/gmshreader.hh:670: undefined reference to `Dune::GridFactory<Dune::UGGrid<2> >::GridFactory()'
 /lib/include/dune/grid/io/file/gmshreader.hh:676: undefined reference to `Dune::GridFactory<Dune::UGGrid<2> >::createGrid()'
 /lib/include/dune/grid/io/file/gmshreader.hh:676: undefined reference to `Dune::GridFactory<Dune::UGGrid<2> >::~GridFactory()'


Wo könnte hier das Problem liegen? Oder stimmt der Code so nicht? 
Welche weiteren Angaben wären denn notwendig, dass man den eigentlichen Fehler finden könnte?
 
Vielen Dank im Voraus.


Viele Grüße




More information about the Dune mailing list