[Dune] Some confusion with GridType specification

Andreas Dedner dedner at mathematik.uni-freiburg.de
Tue Jun 8 16:10:00 CEST 2010


Hallo,

the was a problem with the backward compatibility introduced by moving
the grid selection to config.h - that should be fixed in
revision 6764.

Note: the define for the grid has to be placed before including config.h 
- otherwise no grid will be selected!

The correct code would now be:
//=========================================================================
// Use this block, if you want operate with the GridSelector.
#define ALUGRID_SIMPLEX
#define GRIDDIM 3
#include<config.h>
#include<dune/grid/utility/gridtype.hh> // only for debuging
//=========================================================================

Btw: if only a fixed grid is to be used the defines are not required:
//=========================================================================
#include<config.h>
#include<dune/grid/io/file/dgfparser/dgfalu.hh>
typedef Dune::AluSimplexGrid<3,3> GridType;
//=========================================================================

Best
Andreas

On 06/08/2010 03:34 PM, Benedikt Oswald wrote:
> Dear Dune, we are using the svn version as follows:
>
>
> pcp029897:hades oswald$ svn info ../dune-common/
> Path: ../dune-common
> URL: https://svn.dune-project.org/svn/dune-common/trunk
> Repository Root: https://svn.dune-project.org/svn/dune-common
> Repository UUID: 419231ca-4411-0410-aba2-fc6cf8c4f609
> Revision: 6042
> Node Kind: directory
> Schedule: normal
> Last Changed Author: sander
> Last Changed Rev: 6042
> Last Changed Date: 2010-06-08 14:29:43 +0200 (Tue, 08 Jun 2010)
>
> pcp029897:hades oswald$ svn info ../dune-grid
> Path: ../dune-grid
> URL: https://svn.dune-project.org/svn/dune-grid/trunk
> Repository Root: https://svn.dune-project.org/svn/dune-grid
> Repository UUID: f82f27de-4411-0410-b156-930a902cda50
> Revision: 6763
> Node Kind: directory
> Schedule: normal
> Last Changed Author: joe
> Last Changed Rev: 6763
> Last Changed Date: 2010-06-08 13:11:49 +0200 (Tue, 08 Jun 2010)
>
> pcp029897:hades oswald$ svn info ../dune-istl/
> Path: ../dune-istl
> URL: https://svn.dune-project.org/svn/dune-istl/trunk
> Repository Root: https://svn.dune-project.org/svn/dune-istl
> Repository UUID: 8c7282f0-4411-0410-8e4f-cdd3e049afb8
> Revision: 1221
> Node Kind: directory
> Schedule: normal
> Last Changed Author: mblatt
> Last Changed Rev: 1221
> Last Changed Date: 2010-05-28 12:00:29 +0200 (Fri, 28 May 2010)
>
> pcp029897:hades oswald$ svn info ../dune-grid-howto
> Path: ../dune-grid-howto
> URL: https://svn.dune-project.org/svn/dune-grid-howto/trunk
> Repository Root: https://svn.dune-project.org/svn/dune-grid-howto
> Repository UUID: 971b7fa1-7d12-0410-b1b7-9c127676b1f7
> Revision: 318
> Node Kind: directory
> Schedule: normal
> Last Changed Author: joe
> Last Changed Rev: 318
> Last Changed Date: 2010-06-07 11:37:57 +0200 (Mon, 07 Jun 2010)
>
>
> when we try to define the grid type by this sequence of code:
>
>
>
>
>
> //=========================================================================
> // Use this block, if you want operate with the dgf parser.
> #define ALUGRID_SIMPLEX
> #define GRIDDIM 3
> #include<dune/grid/utility/gridtype.hh>
> #include<dune/grid/io/file/dgfparser/dgfgridtype.hh>
> #include<dune/grid/io/file/dgfparser/dgfparser.hh>
> //=========================================================================
>
>
> we get the following error message:
> ============================
>
> mpicxx -DHAVE_CONFIG_H -I. -I..  -I/Users/oswald/svnwork/dune-trunk/dune-common -I/Users/oswald/svnwork/dune-trunk/dune-grid -I/Users/oswald/svnwork/dune-trunk/dune-istl -DMPICH_IGNORE_CXX_SEEK -O2 -I/Users/oswald/extlib/boost-trunk/include -I/Users/oswald/extlib/rlog-trunk/includ
> e/  -I/Users/oswald/extlib/openmpi-1.4.2/include -DMPIPP_H -DENABLE_MPI=1 -I/Users/oswald/extlib/ALUGrid-1.22/include -I/Users/oswald/extlib/ALUGrid-1.22/include/serial -I/Users/oswald/extlib/ALUGrid-1.22/include/duneinterface -DENABLE_ALUGRID -I/Users/oswald/extlib/ALUGrid-1.22/i
> nclude/parallel   -I/Users/oswald/extlib/openmpi-1.4.2/include -DMPIPP_H -DENABLE_MPI=1  -DWITH_INDEX_SETS -DMPICH_IGNORE_CXX_SEEK -O2 -MT hades3d-hades3d.o -MD -MP -MF .deps/hades3d-hades3d.Tpo -c -o hades3d-hades3d.o `test -f 'hades3d.cc' || echo './'`hades3d.cc
> In file included from hades3d.cc:42:
> /Users/oswald/svnwork/dune-trunk/dune-grid/dune/grid/utility/gridtype.hh:4:2: warning: #warning "<dune/grid/utility/gridtype.hh>  has been deprecated."
> /Users/oswald/svnwork/dune-trunk/dune-grid/dune/grid/utility/gridtype.hh:5:2: warning: #warning "Use your projects<gridtype.hh>  instead (generated by adding DUNE_OUTPUT_GRIDTYPE to configure.ac)"
> In file included from hades3d.cc:43:
> /Users/oswald/svnwork/dune-trunk/dune-grid/dune/grid/io/file/dgfparser/dgfgridtype.hh:4:2: warning: #warning "<dune/grid/io/file/dgfgridtype.hh>  has been deprecated."
> /Users/oswald/svnwork/dune-trunk/dune-grid/dune/grid/io/file/dgfparser/dgfgridtype.hh:5:2: warning: #warning "Use your projects<dgfgridtype.hh>  instead (generated by adding DUNE_OUTPUT_GRIDTYPE to configure.ac)"
> In file included from ../stdincl/nonsciconst.hh:37,
>                   from ../stdincl/stringify.hh:30,
>                   from hades3d.cc:70:
> ../config.h:510:5: error: #error "Ambiguous definition of GRIDTYPE."
> In file included from ../stdincl/nonsciconst.hh:37,
>                   from ../stdincl/stringify.hh:30,                 from hades3d.cc:70:
> ../config.h:527: error: redefinition of ‘const int Dune::GridSelector::dimgrid’/Users/oswald/svnwork/dune-trunk/dune-grid/dune/grid/utility/griddim.hh:62: error: ‘const int Dune::GridSelector::dimgrid’ previously defined here
> ../config.h:528: error: redefinition of ‘const int Dune::GridSelector::dimworld’
> /Users/oswald/svnwork/dune-trunk/dune-grid/dune/grid/utility/griddim.hh:72: error: ‘const int Dune::GridSelector::dimworld’ previously defined here
> In file included from ../meshinfo/meshstatistics.hh:138,
>
> ===========================================
>
>
> Now, untile 'recently' this used to work perfectly well. We are of course aware that there were some
> changes w.r.t specifying the GridType, but it is somewhat difficult to find out how exactly I should
> this now ?
>
> Apart from this, we have added DUNE_OUTPUT_GRIDTYPE  to the configure.ac file.
>
> Can you give us some enlightment ? That would be highly appreciated.
>
> I should also add that if I add
>
> #define USED_ALUGRID_SIMPLEX_GRIDTYPE
>
> before the inclusion of config.h
>
> then this error goes away.
>
>
>
>
> Greetings, Benedikt
>
>
>
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Benedikt Oswald, Dr. sc. techn., dipl. El. Ing. ETH, www.psi.ch, Computational Accelerator Scientist, http://amas.web.psi.ch
> Paul Scherrer  Institute (PSI), CH-5232 Villigen, Suisse, benedikt.oswald at psi.ch, +41(0)56 310 32 12
>
> "Passion is required for any great work, and for the revolution passion and audacity are required in big doses.",
>   Ernesto 'Che' Guevara, Letter to his parents.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
>
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune




More information about the Dune mailing list