[Dune] problem with updating dune

Arya Fallahi arya.fallahi at gmail.com
Mon Feb 5 20:06:53 CET 2018


Dear Dune

I am currently trying to update my dune version to the latest release. But,
I am stocked with a problem whose solution I can not figure out.

I just installed dune-common, dune-grid, dune-geometry, and dune-alugrid.
Then I defined a new project. Everything works fine as long as I do not
change anything. But, when I just add some new lines copy and pasted from
the Dune Guide. I get error messages.

The source file looks as follows:

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <iostream>
#include <dune/common/parallel/mpihelper.hh> // An initializer of MPI
#include <dune/common/exceptions.hh> // We use exceptions

#include <dune/grid/uggrid.hh> /*************************/

int main(int argc, char** argv)
{
  const int dim = 2; /*************************/
  typedef Dune::UGGrid<dim> Grid; /*************************/
  const int DIM = Grid::dimension; /*************************/


  try{
    // Maybe initialize MPI
    Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
    std::cout << "Hello World! This is salam." << std::endl;
    if(Dune::MPIHelper::isFake)
      std::cout<< "This is a sequential program." << std::endl;
    else
      std::cout<<"I am rank "<<helper.rank()<<" of "<<helper.size()
        <<" processes!"<<std::endl;
    return 0;
  }
  catch (Dune::Exception &e){
    std::cerr << "Dune reported error: " << e << std::endl;
  }
  catch (...){
    std::cerr << "Unknown exception thrown!" << std::endl;
  }
}

The lines with stars in front are the ones I add to the initial file.
However when I compile this file I get the following error message:

/afs/desy.de/user/a/afallahi/workspace/salam/src/salam.cc: In function ‘int
main(int, char**)’:
/afs/desy.de/user/a/afallahi/workspace/salam/src/salam.cc:17:17: error:
‘UGGrid’ in namespace ‘Dune’ does not name a template type
   typedef Dune::UGGrid<dim> Grid;
                 ^~~~~~
/afs/desy.de/user/a/afallahi/workspace/salam/src/salam.cc:18:19: error:
‘Grid’ has not been declared
   const int DIM = Grid::dimension;
                   ^~~~
gmake[2]: *** [src/CMakeFiles/salam.dir/salam.cc.o] Error 1
gmake[1]: *** [src/CMakeFiles/salam.dir/all] Error 2
gmake: *** [all] Error 2

The CMAKELists files are not touched and stay the same as the ones created
by duneproject.

Can you guess what I am doing wrong?

Best regards,
Arya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20180205/ee3eae0e/attachment.htm>


More information about the Dune mailing list