OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-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::toroidalCS
00027 
00028 Description
00029     Toroidal coordinate system, always in degrees
00030 
00031 Note
00032     The maintenance of this class may lag that of the main types.
00033 
00034 SourceFiles
00035     toroidalCS.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef toroidalCS_H
00040 #define toroidalCS_H
00041 
00042 #include "coordinateSystem.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 
00050 /*---------------------------------------------------------------------------*\
00051                         Class toroidalCS Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class toroidalCS
00055 :
00056     public coordinateSystem
00057 {
00058     // Private data
00059 
00060         //- Radius of the torus
00061         scalar radius_;
00062 
00063     // Private Member Functions
00064 
00065         //- Convert from local coordinate system to the global Cartesian system
00066         //  with optional translation for the origin
00067         virtual vector localToGlobal(const vector&, bool translate) const;
00068 
00069         //- Convert from local coordinate system to the global Cartesian system
00070         //  with optional translation for the origin
00071         virtual tmp<vectorField> localToGlobal
00072         (
00073             const vectorField&,
00074             bool translate
00075         ) const;
00076 
00077         //- Convert from global Cartesian system to the local coordinate system
00078         //  with optional translation for the origin
00079         virtual vector globalToLocal(const vector&, bool translate) const;
00080 
00081         //- Convert from global Cartesian system to the local coordinate system
00082         //  with optional translation for the origin
00083         virtual tmp<vectorField> globalToLocal
00084         (
00085             const vectorField&,
00086             bool translate
00087         ) const;
00088 
00089 public:
00090 
00091     //- Runtime type information
00092     TypeName("toroidal");
00093 
00094 
00095     // Constructors
00096 
00097         //- Construct from origin, rotation and radius
00098         toroidalCS
00099         (
00100             const word& name,
00101             const point& origin,
00102             const coordinateRotation&,
00103             const scalar radius
00104         );
00105 
00106 
00107         //- Construct from dictionary
00108         toroidalCS(const word& name, const dictionary&);
00109 
00110 
00111     // Member Functions
00112 
00113         //- Return radius
00114         scalar radius() const
00115         {
00116             return radius_;
00117         }
00118 
00119         //- Write
00120         virtual void write(Ostream&) const;
00121 
00122         //- Write dictionary
00123         virtual void writeDict(Ostream&, bool subDict=true) const;
00124 };
00125 
00126 
00127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00128 
00129 } // End namespace Foam
00130 
00131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00132 
00133 #endif
00134 
00135 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd