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::sphericalCS 00026 00027 Description 00028 Spherical coordinate system 00029 00030 SourceFiles 00031 sphericalCS.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef sphericalCS_H 00036 #define sphericalCS_H 00037 00038 #include <meshTools/coordinateSystem.H> 00039 00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00041 00042 namespace Foam 00043 { 00044 00045 /*---------------------------------------------------------------------------*\ 00046 Class sphericalCS Declaration 00047 \*---------------------------------------------------------------------------*/ 00048 00049 class sphericalCS 00050 : 00051 public coordinateSystem 00052 { 00053 // Private data members 00054 00055 //- Are angles in degrees? (default = true) 00056 bool inDegrees_; 00057 00058 00059 protected: 00060 00061 // Protected Member Functions 00062 00063 //- Convert from local coordinate system to the global Cartesian system 00064 // with optional translation for the origin 00065 virtual vector localToGlobal(const vector&, bool translate) const; 00066 00067 //- Convert from local coordinate system to the global Cartesian system 00068 // with optional translation for the origin 00069 virtual tmp<vectorField> localToGlobal 00070 ( 00071 const vectorField&, 00072 bool translate 00073 ) const; 00074 00075 //- Convert from global Cartesian system to the local coordinate system 00076 // with optional translation for the origin 00077 virtual vector globalToLocal(const vector&, bool translate) const; 00078 00079 //- Convert from global Cartesian system to the local coordinate system 00080 // with optional translation for the origin 00081 virtual tmp<vectorField> globalToLocal 00082 ( 00083 const vectorField&, 00084 bool translate 00085 ) const; 00086 00087 public: 00088 00089 //- Runtime type information 00090 TypeName("spherical"); 00091 00092 00093 // Constructors 00094 00095 //- Construct null 00096 sphericalCS(const bool inDegrees=true); 00097 00098 //- Construct copy 00099 sphericalCS 00100 ( 00101 const coordinateSystem&, 00102 const bool inDegrees=true 00103 ); 00104 00105 //- Construct copy with a different name 00106 sphericalCS 00107 ( 00108 const word& name, 00109 const coordinateSystem&, 00110 const bool inDegrees=true 00111 ); 00112 00113 //- Construct from origin and rotation 00114 sphericalCS 00115 ( 00116 const word& name, 00117 const point& origin, 00118 const coordinateRotation&, 00119 const bool inDegrees=true 00120 ); 00121 00122 //- Construct from origin and 2 axes 00123 sphericalCS 00124 ( 00125 const word& name, 00126 const point& origin, 00127 const vector& axis, 00128 const vector& dirn, 00129 const bool inDegrees=true 00130 ); 00131 00132 //- Construct from dictionary 00133 sphericalCS(const word& name, const dictionary&); 00134 00135 00136 // Member Functions 00137 00138 //- Are angles in degrees? 00139 bool inDegrees() const; 00140 00141 //- Non-const access to inDegrees 00142 bool& inDegrees(); 00143 00144 }; 00145 00146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00147 00148 } // End namespace Foam 00149 00150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00151 00152 #endif 00153 00154 // ************************ vim: set sw=4 sts=4 et: ************************ //