dune-grid  2.2.0
alugrid/common/capabilities.hh
Go to the documentation of this file.
1 #ifndef DUNE_ALUGRID_CAPABILITIES_HH
2 #define DUNE_ALUGRID_CAPABILITIES_HH
3 
4 // only include this code, if ENABLE_ALUGRID is defined
5 #ifdef ENABLE_ALUGRID
6 
10 #include <dune/geometry/genericgeometry/topologytypes.hh>
11 
17 namespace Dune
18 {
19 
20  namespace Capabilities
21  {
22 
23  // Capabilities for ALUGrid
24  // -------------------------------
25 
29  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
30  struct hasSingleGeometryType< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
31  {
32  static const bool v = true;
33  static const unsigned int topologyId = (eltype == cube) ?
34  GenericGeometry :: CubeTopology< dim > :: type :: id :
35  GenericGeometry :: SimplexTopology< dim > :: type :: id ;
36  };
37 
41  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm, int cdim >
42  struct hasEntity< ALUGrid< dim, dimworld, eltype, refinementtype, Comm >, cdim >
43  {
44  static const bool v = true;
45  };
46 
50  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype >
51  struct isParallel< ALUGrid< dim, dimworld, eltype, refinementtype, No_Comm > >
52  {
53  static const bool v = false;
54  };
55 
59 #if ALU3DGRID_PARALLEL
60  template< ALUGridElementType eltype, ALUGridRefinementType refinementtype >
61  struct isParallel< ALUGrid< 3, 3, eltype, refinementtype, MPI_Comm > >
62  {
63  static const bool v = true;
64  };
65 #endif
66 
70  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, int codim >
71  struct canCommunicate< ALUGrid< dim, dimworld, eltype, refinementtype, No_Comm >, codim >
72  {
73  static const bool v = false;
74  };
75 
79 #if ALU3DGRID_PARALLEL
80  template< ALUGridElementType eltype, ALUGridRefinementType refinementtype, int codim >
81  struct canCommunicate< ALUGrid< 3, 3, eltype, refinementtype, MPI_Comm >, codim >
82  {
83  static const bool v = true;
84  };
85 #endif
86 
90  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
91  struct isLevelwiseConforming< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
92  {
93  static const bool v = refinementtype == nonconforming;
94  };
95 
99  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
100  struct isLeafwiseConforming< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
101  {
102  static const bool v = refinementtype == conforming ;
103  };
104 
108  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
109  struct hasBackupRestoreFacilities< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
110  {
111  static const bool v = true;
112  };
113 
114  } // end namespace Capabilities
115 
116 } //end namespace Dune
117 
118 #endif // #ifdef ENABLE_ALUGRID
119 
120 #endif // #ifdef DUNE_ALUGRID_CAPABILITIES_HH