dune-grid  2.2.0
alugrid/common/capabilities.hh
Go to the documentation of this file.
00001 #ifndef DUNE_ALUGRID_CAPABILITIES_HH
00002 #define DUNE_ALUGRID_CAPABILITIES_HH
00003 
00004 // only include this code, if ENABLE_ALUGRID is defined
00005 #ifdef ENABLE_ALUGRID
00006 
00007 #include <dune/grid/common/capabilities.hh>
00008 #include <dune/grid/alugrid/common/declaration.hh>
00009 #include <dune/grid/alugrid/common/checkparallel.hh>
00010 #include <dune/geometry/genericgeometry/topologytypes.hh>
00011 
00017 namespace Dune
00018 {
00019 
00020   namespace Capabilities
00021   {
00022 
00023     // Capabilities for ALUGrid
00024     // -------------------------------
00025 
00029     template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
00030     struct hasSingleGeometryType< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
00031     {
00032       static const bool v = true;
00033       static const unsigned int topologyId = (eltype == cube) ? 
00034         GenericGeometry :: CubeTopology< dim > :: type :: id :
00035         GenericGeometry :: SimplexTopology< dim > :: type :: id ;
00036     };
00037 
00041     template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm, int cdim >
00042     struct hasEntity< ALUGrid< dim, dimworld, eltype, refinementtype, Comm >, cdim >
00043     {
00044       static const bool v = true;
00045     };
00046 
00050     template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype >
00051     struct isParallel< ALUGrid< dim, dimworld, eltype, refinementtype, No_Comm > >
00052     {
00053       static const bool v = false;
00054     };
00055 
00059 #if ALU3DGRID_PARALLEL
00060     template< ALUGridElementType eltype, ALUGridRefinementType refinementtype >
00061     struct isParallel< ALUGrid< 3, 3, eltype, refinementtype,  MPI_Comm > >
00062     {
00063       static const bool v = true;
00064     };
00065 #endif
00066 
00070     template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, int codim >
00071     struct canCommunicate< ALUGrid< dim, dimworld, eltype, refinementtype, No_Comm >, codim >
00072     {
00073       static const bool v = false;
00074     };
00075 
00079 #if ALU3DGRID_PARALLEL
00080     template< ALUGridElementType eltype, ALUGridRefinementType refinementtype, int codim >
00081     struct canCommunicate< ALUGrid< 3, 3, eltype, refinementtype, MPI_Comm >, codim >
00082     {
00083       static const bool v = true;
00084     };
00085 #endif
00086 
00090     template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
00091     struct isLevelwiseConforming< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
00092     {
00093       static const bool v = refinementtype == nonconforming;
00094     };
00095 
00099     template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
00100     struct isLeafwiseConforming< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
00101     {
00102       static const bool v = refinementtype == conforming ;
00103     };
00104 
00108     template< int dim, int dimworld, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm >
00109     struct hasBackupRestoreFacilities< ALUGrid< dim, dimworld, eltype, refinementtype, Comm > >
00110     {
00111       static const bool v = true;
00112     };
00113 
00114   } // end namespace Capabilities
00115 
00116 } //end  namespace Dune 
00117 
00118 #endif // #ifdef ENABLE_ALUGRID
00119 
00120 #endif // #ifdef DUNE_ALUGRID_CAPABILITIES_HH