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