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 #include "Vector2D.H"
00028
00029
00030
00031 namespace Foam
00032 {
00033
00034
00035
00036
00037 template <class Cmpt>
00038 inline SphericalTensor2D<Cmpt>::SphericalTensor2D()
00039 {}
00040
00041
00042
00043 template <class Cmpt>
00044 inline SphericalTensor2D<Cmpt>::SphericalTensor2D
00045 (
00046 const VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>& vs
00047 )
00048 :
00049 VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>(vs)
00050 {}
00051
00052
00053
00054 template <class Cmpt>
00055 inline SphericalTensor2D<Cmpt>::SphericalTensor2D(const Cmpt& stii)
00056 {
00057 this->v_[II] = stii;
00058 }
00059
00060
00061
00062 template <class Cmpt>
00063 inline SphericalTensor2D<Cmpt>::SphericalTensor2D(Istream& is)
00064 :
00065 VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>(is)
00066 {}
00067
00068
00069
00070
00071 template <class Cmpt>
00072 inline const Cmpt& SphericalTensor2D<Cmpt>::ii() const
00073 {
00074 return this->v_[II];
00075 }
00076
00077
00078 template <class Cmpt>
00079 inline Cmpt& SphericalTensor2D<Cmpt>::ii()
00080 {
00081 return this->v_[II];
00082 }
00083
00084
00085
00086
00087
00088 template <class Cmpt>
00089 inline SphericalTensor2D<Cmpt>
00090 operator&
00091 (
00092 const SphericalTensor2D<Cmpt>& st1,
00093 const SphericalTensor2D<Cmpt>& st2
00094 )
00095 {
00096 return SphericalTensor2D<Cmpt>(st1.ii()*st2.ii());
00097 }
00098
00099
00100
00101 template <class Cmpt>
00102 inline Vector2D<Cmpt>
00103 operator&(const SphericalTensor2D<Cmpt>& st, const Vector2D<Cmpt>& v)
00104 {
00105 return Vector2D<Cmpt>
00106 (
00107 st.ii()*v.x(),
00108 st.ii()*v.y()
00109 );
00110 }
00111
00112
00113
00114 template <class Cmpt>
00115 inline Vector2D<Cmpt>
00116 operator&(const Vector2D<Cmpt>& v, const SphericalTensor2D<Cmpt>& st)
00117 {
00118 return Vector2D<Cmpt>
00119 (
00120 v.x()*st.ii(),
00121 v.y()*st.ii()
00122 );
00123 }
00124
00125
00126
00127 template <class Cmpt>
00128 inline SphericalTensor2D<Cmpt>
00129 operator/(const scalar s, const SphericalTensor2D<Cmpt>& st)
00130 {
00131 return SphericalTensor2D<Cmpt>(s/st.ii());
00132 }
00133
00134
00135
00136 template <class Cmpt>
00137 inline Cmpt tr(const SphericalTensor2D<Cmpt>& st)
00138 {
00139 return 2*st.ii();
00140 }
00141
00142
00143
00144 template <class Cmpt>
00145 inline SphericalTensor2D<Cmpt> sph(const SphericalTensor2D<Cmpt>& st)
00146 {
00147 return st;
00148 }
00149
00150
00151
00152 template <class Cmpt>
00153 inline Cmpt det(const SphericalTensor2D<Cmpt>& st)
00154 {
00155 return st.ii()*st.ii();
00156 }
00157
00158
00159
00160 template <class Cmpt>
00161 inline SphericalTensor2D<Cmpt> inv(const SphericalTensor2D<Cmpt>& st)
00162 {
00163 return SphericalTensor2D<Cmpt>(1.0/st.ii());
00164 }
00165
00166
00167 template<class Cmpt>
00168 class outerProduct<SphericalTensor2D<Cmpt>, Cmpt>
00169 {
00170 public:
00171
00172 typedef SphericalTensor2D<Cmpt> type;
00173 };
00174
00175 template<class Cmpt>
00176 class outerProduct<Cmpt, SphericalTensor2D<Cmpt> >
00177 {
00178 public:
00179
00180 typedef SphericalTensor2D<Cmpt> type;
00181 };
00182
00183
00184 template<class Cmpt>
00185 class innerProduct<SphericalTensor2D<Cmpt>, SphericalTensor2D<Cmpt> >
00186 {
00187 public:
00188
00189 typedef SphericalTensor2D<Cmpt> type;
00190 };
00191
00192
00193 template<class Cmpt>
00194 class innerProduct<SphericalTensor2D<Cmpt>, Vector2D<Cmpt> >
00195 {
00196 public:
00197
00198 typedef Vector2D<Cmpt> type;
00199 };
00200
00201 template<class Cmpt>
00202 class innerProduct<Vector2D<Cmpt>, SphericalTensor2D<Cmpt> >
00203 {
00204 public:
00205
00206 typedef Vector2D<Cmpt> type;
00207 };
00208
00209
00210
00211
00212 }
00213
00214
Copyright © 2000-2007 OpenCFD Ltd