testgeo.hh
00001 #ifndef TESTGEO_HH
00002 #define TESTGEO_HH
00003
00004 #include <dune/grid/alugrid/3d/topology.hh>
00005 #include <dune/grid/genericgeometry/geometry.hh>
00006
00007 namespace Dune
00008 {
00009
00010 template <int d1,int d2> class YaspGrid;
00011 template <int d1,int d2> class AlbertaGrid;
00012 template< int dim, int dimworld > class ALUSimplexGrid;
00013 template< int dim, int dimworld, ALU3dGridElementType elType > class ALU3dGrid;
00014 template <int dim> class UGGrid;
00015
00016
00017
00018
00019
00020
00021 template< class Grid >
00022 struct Topology;
00023
00024 template< int d >
00025 struct Topology< YaspGrid< d, d > >
00026 {
00027 static const GeometryType :: BasicType basicType = GeometryType :: cube;
00028 static const int dimension = d;
00029 static const bool correctJacobian = false;
00030
00031 typedef GenericGeometry :: Convert< basicType, dimension > Convert;
00032 typedef typename Convert :: type Type;
00033 };
00034
00035 template< int d >
00036 struct Topology< UGGrid< d > >
00037 {
00038 static const GeometryType :: BasicType basicType = GeometryType :: cube;
00039 static const int dimension = d;
00040 static const bool correctJacobian = false;
00041
00042 typedef GenericGeometry :: Convert< basicType, dimension > Convert;
00043 typedef typename Convert :: type Type;
00044 };
00045
00046 template< int d >
00047 struct Topology< AlbertaGrid< d, d > >
00048 {
00049 static const GeometryType :: BasicType basicType = GeometryType :: simplex;
00050 static const int dimension = d;
00051 static const bool correctJacobian = false;
00052
00053 typedef GenericGeometry :: Convert< basicType, dimension > Convert;
00054 typedef typename Convert :: type Type;
00055 };
00056
00057 template<>
00058 struct Topology< ALU3dGrid< 3, 3, tetra > >
00059 {
00060 static const GeometryType :: BasicType basicType = GeometryType :: simplex;
00061 static const int dimension = 3;
00062 static const bool correctJacobian = true;
00063
00064 typedef GenericGeometry :: Convert< basicType, dimension > Convert;
00065 typedef Convert :: type Type;
00066 };
00067
00068 template<>
00069 struct Topology< ALUSimplexGrid< 3, 3 > >
00070 {
00071 static const GeometryType :: BasicType basicType = GeometryType :: simplex;
00072 static const int dimension = 3;
00073 static const bool correctJacobian = true;
00074
00075 typedef GenericGeometry :: Convert< basicType, dimension > Convert;
00076 typedef Convert :: type Type;
00077 };
00078
00079 template<>
00080 struct Topology< ALUSimplexGrid< 2, 2 > >
00081 {
00082 static const GeometryType :: BasicType basicType = GeometryType :: simplex;
00083 static const int dimension = 2;
00084 static const bool correctJacobian = true;
00085
00086 typedef GenericGeometry :: Convert< basicType, dimension > Convert;
00087 typedef Convert :: type Type;
00088 };
00089
00090
00091
00092
00093
00094
00095 namespace GenericGeometry
00096 {
00097
00098 template< class Grid >
00099 struct GlobalGeometryTraits
00100 {
00101 typedef typename Grid :: template Codim< 0 > :: Geometry DuneGeometryType;
00102
00103 typedef DuneCoordTraits< typename DuneGeometryType :: ctype > CoordTraits;
00104
00105 static const int dimGrid = DuneGeometryType :: dimension;
00106 static const int dimWorld = DuneGeometryType :: coorddimension;
00107
00108 static const bool hybrid = true;
00109
00110 static const GeometryType :: BasicType linetype = GeometryType :: simplex;
00111
00112 template< class Topology >
00113 struct Mapping
00114 {
00115 typedef CornerMapping< CoordTraits, Topology, dimWorld > type;
00116 };
00117
00118 struct Caching
00119 {
00120 static const EvaluationType evaluateJacobianTransposed = ComputeOnDemand;
00121 static const EvaluationType evaluateJacobianInverseTransposed = ComputeOnDemand;
00122 static const EvaluationType evaluateIntegrationElement = ComputeOnDemand;
00123 static const EvaluationType evaluateNormal = ComputeOnDemand;
00124 };
00125 };
00126
00127 }
00128
00129 }
00130
00131 #endif