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