[Dune] problem using ug and the gmshreader

Franz Rammerstorfer franz.rammerstorfer at tugraz.at
Tue May 4 14:09:27 CEST 2010


Hi all,
I would like to read *.msh files and create a ug grid.

This small main file

int main(int argc, char **argv)
{
       const int dim=3;
       const std::string filename(argv[1]);
       typedef Dune::UGGrid<dim> GT;
       GT grid;
       Dune::GmshReader<GT>::read(grid, filename);
       return 0;
}

produces following compilation error:

Scanning dependencies of target dunecouple
[100%] Building CXX object 
test_programs/CMakeFiles/dunecouple.dir/main_dunecouple.C.o
Linking CXX executable ../dunecouple
CMakeFiles/dunecouple.dir/main_dunecouple.C.o: In function 
`Dune::GmshReaderParser<Dune::UGGrid<3>, 
3>::pass2HandleElement(_IO_FILE*, int, std::map<int, unsigned int, 
std::less<int>, std::allocator<std::pair<int const, unsigned int> > >&, 
std::vector<Dune::FieldVector<double, 3>, 
std::allocator<Dune::FieldVector<double, 3> > > const&, int)':
main_dunecouple.C:(.text._ZN4Dune16GmshReaderParserINS_6UGGridILi3EEELi3EE18pass2HandleElementEP8_IO_FILEiRSt3mapIijSt4lessIiESaISt4pairIKijEEERKSt6vectorINS_11FieldVectorIdLi3EEESaISH_EEi[Dune::GmshReaderParser<Dune::UGGrid<3>, 
3>::pass2HandleElement(_IO_FILE*, int, std::map<int, unsigned int, 
std::less<int>, std::allocator<std::pair<int const, unsigned int> > >&, 
std::vector<Dune::FieldVector<double, 3>, 
std::allocator<Dune::FieldVector<double, 3> > > const&, int)]+0x109d): 
undefined reference to `Dune::GridFactory<Dune::UGGrid<3> 
 >::insertBoundarySegment(std::vector<unsigned int, 
std::allocator<unsigned int> > const&, 
Dune::shared_ptr<Dune::BoundarySegment<3, 3> >)'
collect2: ld returned 1 exit status
make[3]: *** [dunecouple] Error 1
make[2]: *** [test_programs/CMakeFiles/dunecouple.dir/all] Error 2
make[1]: *** [test_programs/CMakeFiles/dunecouple.dir/rule] Error 2
make: *** [dunecouple] Error 2


How to deal with this problem?

regards,
Franz Rammerstorfer





More information about the Dune mailing list