[Dune] dgf parser

Andreas Dedner dedner at mathematik.uni-freiburg.de
Thu Jul 6 08:34:30 CEST 2006


Hi,
there seems to be some confusion of how to use the DGF parser.
As given in the documentation, there are two possible approaches -
there is a mistake in the second part:

   1. By including the file gridtype.hh from the
      dune/grid/utility/macrogridparser directory ...
   2. By directly including one of the files macrogrid*.hh
      ******** here it shouldd be dgf*.hh
      from the
      dune/grid/io/file/dgfparser directory:
      in this case only the required header files for the desired grid
      and the macrogrid parser are included but no typedef is made.

The first can be used to easily switch grids using a script file, e.g.
  gridtype=ALBERTAGRID
  dimw=2
  make GRIDTYPE=${gridtype} DUNE_PROBLEM_DIM=${dimw}
I use this for testing my numerics on different grids/space dimensions.

The second possibility is to include for example
  dgfyasp.hh
and then to use
  GridPtr<YaspGrid<2,2> > grid("name",MPI_COMM_WORLD);
It should be possible to write
  #include "dgfyasp.hh"
  #include "dgfalberta.hh"
  GridPtr<YaspGrid<2,2> > gridY2("name2",MPI_COMM_WORLD);
  GridPtr<AlbertaGrid<2,2> > gridA2("name2",MPI_COMM_WORLD);
  GridPtr<AlbertaGrid<3,3> > gridA3("name3",MPI_COMM_WORLD);
Note that no typedefs are made only the dune grid header files
are included and the dgfparser headers.





More information about the Dune mailing list