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 VectorSpace_H
00040 #define VectorSpace_H
00041 
00042 #include <OpenFOAM/direction.H>
00043 #include <OpenFOAM/scalar.H>
00044 #include <OpenFOAM/word.H>
00045 
00046 
00047 
00048 namespace Foam
00049 {
00050 
00051 
00052 
00053 template<class Form, class Cmpt, int nCmpt> class VectorSpace;
00054 
00055 template<class Form, class Cmpt, int nCmpt>
00056 Istream& operator>>
00057 (
00058     Istream&,
00059     VectorSpace<Form, Cmpt, nCmpt>&
00060 );
00061 
00062 template<class Form, class Cmpt, int nCmpt>
00063 Ostream& operator<<
00064 (
00065     Ostream&,
00066     const VectorSpace<Form, Cmpt, nCmpt>&
00067 );
00068 
00069 
00070 
00071 
00072 
00073 
00074 template<class Form, class Cmpt, int nCmpt>
00075 class VectorSpace
00076 {
00077 
00078 public:
00079 
00080     
00081     typedef Cmpt cmptType;
00082 
00083 
00084     
00085 
00086         enum
00087         {
00088             dim = 3,            
00089             nComponents = nCmpt 
00090         };
00091 
00092 
00093     
00094 
00095         
00096         Cmpt v_[nCmpt];
00097 
00098 
00099     
00100 
00101         
00102         inline VectorSpace();
00103 
00104         
00105         VectorSpace(Istream&);
00106 
00107         
00108         inline VectorSpace(const VectorSpace<Form, Cmpt, nCmpt>&);
00109 
00110 
00111     
00112 
00113         
00114         inline label size() const;
00115 
00116         inline const Cmpt& component(const direction) const;
00117         inline Cmpt& component(const direction);
00118 
00119         inline void component(Cmpt&, const direction) const;
00120         inline void replace(const direction, const Cmpt&);
00121 
00122 
00123     
00124 
00125         inline const Cmpt& operator[](const direction) const;
00126         inline Cmpt& operator[](const direction);
00127 
00128         inline void operator=(const VectorSpace<Form, Cmpt, nCmpt>&);
00129         inline void operator+=(const VectorSpace<Form, Cmpt, nCmpt>&);
00130         inline void operator-=(const VectorSpace<Form, Cmpt, nCmpt>&);
00131 
00132         inline void operator*=(const scalar);
00133         inline void operator/=(const scalar);
00134 
00135 
00136     
00137 
00138         friend Istream& operator>> <Form, Cmpt, nCmpt>
00139         (
00140             Istream&,
00141             VectorSpace<Form, Cmpt, nCmpt>&
00142         );
00143 
00144         friend Ostream& operator<< <Form, Cmpt, nCmpt>
00145         (
00146             Ostream&,
00147             const VectorSpace<Form, Cmpt, nCmpt>&
00148         );
00149 };
00150 
00151 
00152 
00153 
00154 
00155 template<class Form, class Cmpt, int nCmpt>
00156 word name(const VectorSpace<Form, Cmpt, nCmpt>&);
00157 
00158 
00159 
00160 } 
00161 
00162 
00163 
00164 #include <OpenFOAM/VectorSpaceI.H>
00165 
00166 #ifdef NoRepository
00167 #   include <OpenFOAM/VectorSpace.C>
00168 #endif
00169 
00170 
00171 
00172 #endif
00173 
00174