FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

toroidalCS.H

Go 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-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::toroidalCS
00026 
00027 Description
00028     Toroidal coordinate system, always in degrees
00029 
00030 Note
00031     The maintenance of this class may lag that of the main types.
00032 
00033 SourceFiles
00034     toroidalCS.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef toroidalCS_H
00039 #define toroidalCS_H
00040 
00041 #include <meshTools/coordinateSystem.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 
00049 /*---------------------------------------------------------------------------*\
00050                         Class toroidalCS Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class toroidalCS
00054 :
00055     public coordinateSystem
00056 {
00057     // Private data
00058 
00059         //- Radius of the torus
00060         scalar radius_;
00061 
00062     // Private 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("toroidal");
00092 
00093 
00094     // Constructors
00095 
00096         //- Construct from origin, rotation and radius
00097         toroidalCS
00098         (
00099             const word& name,
00100             const point& origin,
00101             const coordinateRotation&,
00102             const scalar radius
00103         );
00104 
00105 
00106         //- Construct from dictionary
00107         toroidalCS(const word& name, const dictionary&);
00108 
00109 
00110     // Member Functions
00111 
00112         //- Return radius
00113         scalar radius() const
00114         {
00115             return radius_;
00116         }
00117 
00118         //- Write
00119         virtual void write(Ostream&) const;
00120 
00121         //- Write dictionary
00122         virtual void writeDict(Ostream&, bool subDict=true) const;
00123 };
00124 
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 } // End namespace Foam
00129 
00130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00131 
00132 #endif
00133 
00134 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines