|
|
|
toroidalCS.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2007 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 the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 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, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 toroidalCS 00027 00028 Description 00029 toroidal coordinates 00030 00031 SourceFiles 00032 toroidalCS.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef toroidalCS_H 00037 #define toroidalCS_H 00038 00039 #include "coordinateSystem.H" 00040 00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00042 00043 namespace Foam 00044 { 00045 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class toroidalCS Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class toroidalCS 00052 : 00053 public coordinateSystem 00054 { 00055 // Private data 00056 00057 //- Radius of the torus 00058 scalar radius_; 00059 00060 // Private Member Functions 00061 00062 //- Convert from local coordinate system to the global Cartesian system 00063 // with optional translation for the origin 00064 virtual vector localToGlobal(const vector&, bool translate) const; 00065 00066 //- Convert from local coordinate system to the global Cartesian system 00067 // with optional translation for the origin 00068 virtual tmp<vectorField> localToGlobal 00069 ( 00070 const vectorField&, 00071 bool translate 00072 ) const; 00073 00074 //- Convert from global Cartesian system to the local coordinate system 00075 // with optional translation for the origin 00076 virtual vector globalToLocal(const vector&, bool translate) const; 00077 00078 //- Convert from global Cartesian system to the local coordinate system 00079 // with optional translation for the origin 00080 virtual tmp<vectorField> globalToLocal 00081 ( 00082 const vectorField&, 00083 bool translate 00084 ) const; 00085 00086 public: 00087 00088 //- Runtime type information 00089 TypeName("toroidal"); 00090 00091 00092 // Constructors 00093 00094 //- Construct from components 00095 toroidalCS 00096 ( 00097 const word& name, 00098 const point& origin, 00099 const vector& axis, 00100 const vector& direction, 00101 const scalar radius 00102 ); 00103 00104 //- Construct from origin and rotation angles 00105 toroidalCS 00106 ( 00107 const word& name, 00108 const point& origin, 00109 const coordinateRotation& cr, 00110 const scalar radius 00111 ); 00112 00113 //- Construct from dictionary 00114 toroidalCS(const word& name, const dictionary& dict); 00115 00116 00117 // Member Functions 00118 00119 //- Return radius 00120 scalar radius() const 00121 { 00122 return radius_; 00123 } 00124 00125 //- Write 00126 virtual void write(Ostream&) const; 00127 00128 //- Write dictionary 00129 virtual void writeDict(Ostream&, bool subDict = true) const; 00130 }; 00131 00132 00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00134 00135 } // End namespace Foam 00136 00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00138 00139 #endif 00140 00141 // ************************************************************************* // |