dune-alugrid  2.6-git
capabilities.hh
Go to the documentation of this file.
1 #ifndef DUNE_ALUGRID_CAPABILITIES_HH
2 #define DUNE_ALUGRID_CAPABILITIES_HH
3 
4 #include <dune/common/version.hh>
5 #include <dune/grid/common/capabilities.hh>
7 
8 #if DUNE_VERSION_NEWER(DUNE_GEOMETRY,2,5)
9 #include <dune/geometry/type.hh>
10 #else
11 #include <dune/geometry/genericgeometry/topologytypes.hh>
12 #endif
13 
19 namespace Dune
20 {
21 
22 #if ! DUNE_VERSION_NEWER(DUNE_GEOMETRY,2,5)
23  namespace Impl
24  {
25  using Dune :: GenericGeometry :: SimplexTopology ;
26  using Dune :: GenericGeometry :: CubeTopology ;
27  }
28 #endif
29 
30  namespace Capabilities
31  {
32 
33  // Capabilities for ALUGrid
34  // ------------------------
35 
39  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
40  struct hasSingleGeometryType< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
41  {
42  static const bool v = true;
43  static const unsigned int topologyId = (eltype == cube) ?
44  Impl :: CubeTopology< dim > :: type :: id :
45  Impl :: SimplexTopology< dim > :: type :: id ;
46  };
47 
51  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm, int cdim >
52  struct hasEntity< ALUGrid< dim, dimworld, eltype, refinementtype, Comm >, cdim >
53  {
54  static const bool v = true;
55  };
56 
57 #if !DUNE_VERSION_NEWER(DUNE_GRID,2,5)
61  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype >
62  struct isParallel< ALUGrid< dim, dimworld, eltype, refinementtype, ALUGridNoComm > >
63  {
64  static const bool v = false;
65  };
66 
70  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype >
71  struct isParallel< ALUGrid< dim, dimworld, eltype, refinementtype, ALUGridMPIComm > >
72  {
73  static const bool v = true;
74  };
75 #endif //#if !DUNE_VERSION_NEWER(DUNE_GRID,2,5)
76 
80  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, int codim >
81  struct canCommunicate< ALUGrid< dim, dimworld, eltype, refinementtype, ALUGridNoComm >, codim >
82  {
83  static const bool v = false;
84  };
85 
89  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, int codim >
90  struct canCommunicate< ALUGrid< dim, dimworld, eltype, refinementtype, ALUGridMPIComm >, codim >
91  {
92  static const bool v = true;
93  };
94 
98  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
99  struct isLevelwiseConforming< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
100  {
101  static const bool v = refinementtype == nonconforming;
102  };
103 
107  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
108  struct isLeafwiseConforming< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
109  {
110  static const bool v = refinementtype == conforming ;
111  };
112 
116  template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
117  struct hasBackupRestoreFacilities< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
118  {
119  static const bool v = true;
120  };
121 
122  } // end namespace Capabilities
123 
124 } //end namespace Dune
125 
126 #endif // #ifdef DUNE_ALUGRID_CAPABILITIES_HH
Definition: alu3dinclude.hh:50
Definition: alu3dinclude.hh:80
@ cube
use only cube elements (i.e., quadrilaterals or hexahedra)
Definition: declaration.hh:19
@ nonconforming
use non-conforming (red) refinement
Definition: declaration.hh:26
@ conforming
use conforming bisection refinement
Definition: declaration.hh:25
type of class for specialization of serial ALUGrid (No_Comm as communicator)
Definition: declaration.hh:31
type of class for specialization of parallel ALUGrid (MPI_Comm as communicator)
Definition: declaration.hh:39