Tensor.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
00034
00035
00036
00037
00038
00039 #ifndef Tensor_H
00040 #define Tensor_H
00041
00042 #include "Vector.H"
00043 #include "SphericalTensor.H"
00044 #include "SymmTensor.H"
00045
00046
00047
00048 namespace Foam
00049 {
00050
00051
00052
00053
00054
00055 template <class Cmpt>
00056 class Tensor
00057 :
00058 public VectorSpace<Tensor<Cmpt>, Cmpt, 9>
00059 {
00060
00061 public:
00062
00063
00064 typedef Tensor<label> labelType;
00065
00066
00067
00068
00069 enum
00070 {
00071 rank = 2
00072 };
00073
00074
00075
00076
00077 static const char* const typeName;
00078 static const char* componentNames[];
00079
00080 static const Tensor zero;
00081 static const Tensor one;
00082 static const Tensor max;
00083 static const Tensor min;
00084
00085
00086
00087 enum components { XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ };
00088
00089
00090
00091
00092
00093 inline Tensor();
00094
00095
00096 inline Tensor(const VectorSpace<Tensor<Cmpt>, Cmpt, 9>&);
00097
00098
00099 inline Tensor(const SphericalTensor<Cmpt>&);
00100
00101
00102 inline Tensor(const SymmTensor<Cmpt>&);
00103
00104
00105 inline Tensor
00106 (
00107 const Cmpt txx, const Cmpt txy, const Cmpt txz,
00108 const Cmpt tyx, const Cmpt tyy, const Cmpt tyz,
00109 const Cmpt tzx, const Cmpt tzy, const Cmpt tzz
00110 );
00111
00112
00113 Tensor(Istream&);
00114
00115
00116
00117
00118
00119
00120 inline const Vector<Cmpt>& x() const;
00121 inline const Vector<Cmpt>& y() const;
00122 inline const Vector<Cmpt>& z() const;
00123
00124 inline Vector<Cmpt>& x();
00125 inline Vector<Cmpt>& y();
00126 inline Vector<Cmpt>& z();
00127
00128 inline const Cmpt& xx() const;
00129 inline const Cmpt& xy() const;
00130 inline const Cmpt& xz() const;
00131 inline const Cmpt& yx() const;
00132 inline const Cmpt& yy() const;
00133 inline const Cmpt& yz() const;
00134 inline const Cmpt& zx() const;
00135 inline const Cmpt& zy() const;
00136 inline const Cmpt& zz() const;
00137
00138 inline Cmpt& xx();
00139 inline Cmpt& xy();
00140 inline Cmpt& xz();
00141 inline Cmpt& yx();
00142 inline Cmpt& yy();
00143 inline Cmpt& yz();
00144 inline Cmpt& zx();
00145 inline Cmpt& zy();
00146 inline Cmpt& zz();
00147
00148
00149 inline Tensor<Cmpt> T() const;
00150
00151
00152
00153
00154
00155 inline void operator=(const SphericalTensor<Cmpt>&);
00156
00157
00158 inline void operator=(const SymmTensor<Cmpt>&);
00159 };
00160
00161
00162 template<class Cmpt>
00163 class typeOfRank<Cmpt, 2>
00164 {
00165 public:
00166
00167 typedef Tensor<Cmpt> type;
00168 };
00169
00170
00171
00172
00173 }
00174
00175
00176
00177
00178 #include "TensorI.H"
00179
00180
00181
00182 #endif
00183
00184
Copyright © 2000-2009 OpenCFD Ltd