dune-grid  2.2.0
albertaheader.hh
Go to the documentation of this file.
1 #ifndef DUNE_ALBERTAHEADER_HH
2 #define DUNE_ALBERTAHEADER_HH
3 
4 #if HAVE_ALBERTA
5 
6 #if not (ALBERTA_DIM > 0)
7  #if HEADERCHECK
8  #undef ALBERTA_DIM
9  #define ALBERTA_DIM 2
10  #else
11  #error ALBERTA_DIM should be 1, 2, or 3
12  #endif
13 #endif
14 
15 // Set ALBERTA's DIM_OF_WORLD preprocessor variable
16 #ifndef ALBERTA_DIM
17 #error "ALBERTA_DIM needed to use AlbertaGrid."
18 #endif
19 #define DIM_OF_WORLD ALBERTA_DIM
20 
21 // if we have ALBERTA C++ lib define namespace for ALBERTA
22 #ifdef __ALBERTApp__
23 #define ALBERTA Alberta::
24 #else
25 #define ALBERTA ::
26 #endif
27 
28 #ifndef ALBERTA_DEBUG
29 #define ALBERTA_DEBUG 0
30 #endif
31 
32 // MAX, MIN, and ABS are defined macros of ALBERTA
33 // if they are not defined elsewhere, they are undefined here
34 #ifndef MAX
35 #define _MAX_NOT_DEFINED_
36 #endif
37 
38 #ifndef MIN
39 #define _MIN_NOT_DEFINED_
40 #endif
41 
42 #ifndef ABS
43 #define _ABS_NOT_DEFINED_
44 #endif
45 
46 #ifndef DIM_OF_WORLD
47 #error "DIM_OF_WORLD not defined."
48 #endif
49 
50 #ifdef HAVE_CONFIG_H
51 #define ALBERTASAVE_HAVE_CONFIG_H HAVE_CONFIG_H
52 #undef HAVE_CONFIG_H
53 #endif
54 
55 #include <alberta/alberta.h>
56 
57 #ifdef ALBERTASAVE_HAVE_CONFIG_H
58 #define HAVE_CONFIG_H ALBERTASAVE_HAVE_CONFIG_H
59 #undef ALBERTASAVE_HAVE_CONFIG_H
60 #endif
61 
62 #ifndef _ALBERTA_H_
63 #error "Unable to include alberta.h."
64 #endif
65 
66 // Macro nil may be defined by alberta_util.h. If so, undefine it.
67 #ifdef nil
68 #undef nil
69 #endif
70 
71 // Macro SQR may be defined by alberta_util.h. If so, undefine it to avoid
72 // clashes with Dune::SQR from dune/common/misc.hh
73 #ifdef SQR
74 #undef SQR
75 #endif
76 
77 #endif // #if HAVE_ALBERTA
78 
79 #endif // #ifndef DUNE_ALBERTAHEADER_HH