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

coordSet.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::coordSet
00026 
00027 Description
00028     Holds list of sampling positions
00029 
00030 SourceFiles
00031     coordSet.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef coordSet_H
00036 #define coordSet_H
00037 
00038 #include <OpenFOAM/pointField.H>
00039 #include <OpenFOAM/word.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class coordSet Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class coordSet
00051 :
00052     public pointField
00053 {
00054 
00055 protected:
00056 
00057         //- Name
00058         const word name_;
00059 
00060         //- Axis write type
00061         const word axis_;
00062 
00063         //- Reference point for "distance" write specifier.
00064         point refPoint_;
00065 
00066 public:
00067 
00068     // Constructors
00069 
00070         //- Construct from components
00071         coordSet
00072         (
00073             const word& name,
00074             const word& axis
00075         );
00076 
00077 
00078         //- Construct from components
00079         coordSet
00080         (
00081             const word& name,
00082             const word& axis,
00083             const List<point>& points,
00084             const point& refPoint = point::zero
00085         );
00086 
00087         //- Construct from components
00088         coordSet
00089         (
00090             const word& name,
00091             const word& axis,
00092             const scalarField& points,
00093             const scalar refPoint = 0.0
00094         );
00095 
00096 
00097     // Member functions
00098 
00099         const word& name() const
00100         {
00101             return name_;
00102         }
00103 
00104         const word& axis() const
00105         {
00106             return axis_;
00107         }
00108 
00109         const point& refPoint() const
00110         {
00111             return refPoint_;
00112         }
00113 
00114         //- Is axis specification a vector
00115         bool hasVectorAxis() const;
00116 
00117         //- Get coordinate of point according to axis specification.
00118         //  If axis="distance" can be: -distance to starting point (e.g.
00119         //  uniformSet) or -distance to first sampling point
00120         //  (e.g. cloudSet)
00121         scalar scalarCoord
00122         (
00123             const label index
00124         ) const;
00125 
00126         //- Get point according to axis="full" specification
00127         vector vectorCoord
00128         (
00129             const label index
00130         ) const;
00131 
00132         Ostream& write(Ostream& os) const;
00133 };
00134 
00135 
00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00137 
00138 } // End namespace Foam
00139 
00140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00141 
00142 #endif
00143 
00144 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines