00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CARTESIAN_STENCIL_SETUP_H
00012 #define CARTESIAN_STENCIL_SETUP_H
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 template<unsigned Dim> struct Divergence {};
00026 template<unsigned Dim> struct Gradient {};
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 template<> struct PETEUnaryReturn< Divergence<1>, Vektor<double,1> >
00041 { typedef double type; };
00042 template<> struct PETEUnaryReturn< Divergence<2>, Vektor<double,2> >
00043 { typedef double type; };
00044 template<> struct PETEUnaryReturn< Divergence<3>, Vektor<double,3> >
00045 { typedef double type; };
00046
00047 template<> struct PETEUnaryReturn< Divergence<1>, Vektor<float,1> >
00048 { typedef float type; };
00049 template<> struct PETEUnaryReturn< Divergence<2>, Vektor<float,2> >
00050 { typedef float type; };
00051 template<> struct PETEUnaryReturn< Divergence<3>, Vektor<float,3> >
00052 { typedef float type; };
00053
00054 template<> struct PETEUnaryReturn< Gradient<1>, double >
00055 { typedef Vektor<double,1> type; };
00056 template<> struct PETEUnaryReturn< Gradient<2>, double >
00057 { typedef Vektor<double,2> type; };
00058 template<> struct PETEUnaryReturn< Gradient<3>, double >
00059 { typedef Vektor<double,3> type; };
00060
00061 template<> struct PETEUnaryReturn< Gradient<1>, float >
00062 { typedef Vektor<float,1> type; };
00063 template<> struct PETEUnaryReturn< Gradient<2>, float >
00064 { typedef Vektor<float,2> type; };
00065 template<> struct PETEUnaryReturn< Gradient<3>, float >
00066 { typedef Vektor<float,3> type; };
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 template<unsigned Dim, class Mesh, class From, class To>
00080 struct CenteredDivergence
00081 {
00082 typedef Divergence<Dim> operator_type;
00083 };
00084
00085 template<unsigned Dim, class Mesh, class From, class To>
00086 class CenteredGradient
00087 {
00088 typedef Gradient<Dim> operator_type;
00089 };
00090
00091 #endif // CARTESIAN_STENCIL_SETUP_H
00092
00093
00094
00095
00096
00097
00098