00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::SphericalTensor2D 00026 00027 Description 00028 Templated 2D sphericalTensor derived from VectorSpace adding construction 00029 from 1 component, element access using ii() member function and the 00030 inner-product (dot-product) and outer-product operators. 00031 00032 SourceFiles 00033 SphericalTensor2DI_.H 00034 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #ifndef SphericalTensor2D__H 00038 #define SphericalTensor2D__H 00039 00040 #include <OpenFOAM/VectorSpace.H> 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class SphericalTensor2D Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 template<class Cmpt> 00052 class SphericalTensor2D 00053 : 00054 public VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1> 00055 { 00056 00057 public: 00058 00059 // Member constants 00060 00061 enum 00062 { 00063 rank = 2 // Rank of SphericalTensor2D is 2 00064 }; 00065 00066 00067 // Static data members 00068 00069 static const char* const typeName; 00070 static const char* componentNames[]; 00071 static const SphericalTensor2D zero; 00072 static const SphericalTensor2D one; 00073 static const SphericalTensor2D max; 00074 static const SphericalTensor2D min; 00075 static const SphericalTensor2D I; 00076 static const SphericalTensor2D oneThirdI; 00077 static const SphericalTensor2D twoThirdsI; 00078 00079 00080 //- Component labeling enumeration 00081 enum components { II }; 00082 00083 00084 // Constructors 00085 00086 //- Construct null 00087 inline SphericalTensor2D(); 00088 00089 //- Construct given VectorSpace 00090 inline SphericalTensor2D 00091 ( 00092 const VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>& 00093 ); 00094 00095 //- Construct given the component 00096 inline SphericalTensor2D(const Cmpt& tii); 00097 00098 //- Construct from Istream 00099 inline SphericalTensor2D(Istream&); 00100 00101 00102 // Member Functions 00103 00104 // Access 00105 00106 inline const Cmpt& ii() const; 00107 inline Cmpt& ii(); 00108 }; 00109 00110 00111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00112 00113 } // End namespace Foam 00114 00115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00116 00117 // Include inline implementations 00118 #include "SphericalTensor2DI_.H" 00119 00120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00121 00122 #endif 00123 00124 // ************************ vim: set sw=4 sts=4 et: ************************ //