products.H
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef products_H
00034 #define products_H
00035
00036 #include "pTraits.H"
00037
00038
00039
00040 namespace Foam
00041 {
00042
00043
00044
00045 template<class Cmpt, int rank>
00046 class typeOfRank
00047 {};
00048
00049
00050 template<class Cmpt, int rank>
00051 class symmTypeOfRank
00052 {};
00053
00054
00055 template<class arg1, class arg2>
00056 class typeOfSum
00057 {
00058 public:
00059
00060 typedef arg1 type;
00061 };
00062
00063
00064 template<class arg1, class arg2>
00065 class outerProduct
00066 {
00067 public:
00068
00069 typedef typename typeOfRank
00070 <
00071 typename pTraits<arg1>::cmptType,
00072 int(pTraits<arg1>::rank) + int(pTraits<arg2>::rank)
00073 >::type type;
00074 };
00075
00076
00077 template<class arg1, class arg2>
00078 class crossProduct
00079 {
00080 public:
00081
00082 typedef typename typeOfRank
00083 <
00084 typename pTraits<arg2>::cmptType,
00085 int(pTraits<arg1>::rank) + int(pTraits<arg2>::rank) - 1
00086 >::type type;
00087 };
00088
00089 template<class arg1, class arg2>
00090 class innerProduct
00091 {
00092 public:
00093
00094 typedef typename typeOfRank
00095 <
00096 typename pTraits<arg1>::cmptType,
00097 int(pTraits<arg1>::rank) + int(pTraits<arg2>::rank) - 2
00098 >::type type;
00099 };
00100
00101 template<class arg1, class arg2>
00102 class scalarProduct
00103 {
00104 public:
00105
00106 typedef typename pTraits<arg1>::cmptType type;
00107 };
00108
00109
00110 template<class arg1, int arg2>
00111 class powProduct
00112 {
00113 public:
00114
00115 typedef typename symmTypeOfRank
00116 <
00117 typename pTraits<arg1>::cmptType,
00118 arg2*int(pTraits<arg1>::rank)
00119 >::type type;
00120 };
00121
00122
00123
00124
00125 }
00126
00127
00128
00129 #endif
00130
00131
Copyright © 2000-2009 OpenCFD Ltd