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::uniformSet 00026 00027 Description 00028 00029 SourceFiles 00030 uniformSet.C 00031 00032 \*---------------------------------------------------------------------------*/ 00033 00034 #ifndef uniformSet_H 00035 #define uniformSet_H 00036 00037 #include <sampling/sampledSet.H> 00038 #include <OpenFOAM/DynamicList.H> 00039 00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00041 00042 namespace Foam 00043 { 00044 00045 // Forward declaration of classes 00046 class passiveParticle; 00047 template<class Type> class Particle; 00048 00049 /*---------------------------------------------------------------------------*\ 00050 Class uniformSet Declaration 00051 \*---------------------------------------------------------------------------*/ 00052 00053 class uniformSet 00054 : 00055 public sampledSet 00056 { 00057 // Private data 00058 00059 //- Starting point 00060 point start_; 00061 00062 //- End point 00063 point end_; 00064 00065 //- Number of points 00066 label nPoints_; 00067 00068 // Private Member Functions 00069 00070 //- Calculates - starting at samplePt - the first sampling point 00071 // on or after currentPt. smallDist is the tolerance used to compare 00072 // positions. Returns false if end of samples reached. 00073 bool nextSample 00074 ( 00075 const point& currentPt, 00076 const vector& offset, 00077 const scalar smallDist, 00078 point& samplePt, 00079 label& sampleI 00080 ) const; 00081 00082 //- Samples from startTrackPt/CellI. Updates particle/samplePt/sampleI 00083 // and puts 00084 // samples in the DynamicLists. Returns false if end of all samples 00085 // reached 00086 bool trackToBoundary 00087 ( 00088 Particle<passiveParticle>& singleParticle, 00089 point& samplePt, 00090 label& sampleI, 00091 DynamicList<point>& samplingPts, 00092 DynamicList<label>& samplingCells, 00093 DynamicList<label>& samplingFaces, 00094 DynamicList<scalar>& samplingCurveDist 00095 ) const; 00096 00097 //- Samples from start_ to end_. samplingSegments contains segmentNo 00098 // for each sample. 00099 void calcSamples 00100 ( 00101 DynamicList<point>& samplingPts, 00102 DynamicList<label>& samplingCells, 00103 DynamicList<label>& samplingFaces, 00104 DynamicList<label>& samplingSegments, 00105 DynamicList<scalar>& samplingCurveDist 00106 ) const; 00107 00108 //- Uses calcSamples to obtain samples. Copies them into *this. 00109 void genSamples(); 00110 00111 00112 public: 00113 00114 //- Runtime type information 00115 TypeName("uniform"); 00116 00117 // Constructors 00118 00119 //- Construct from components 00120 uniformSet 00121 ( 00122 const word& name, 00123 const polyMesh& mesh, 00124 meshSearch& searchEngine, 00125 const word& axis, 00126 const point& start, 00127 const point& end, 00128 const label nPoints 00129 ); 00130 00131 //- Construct from dictionary 00132 uniformSet 00133 ( 00134 const word& name, 00135 const polyMesh& mesh, 00136 meshSearch& searchEngine, 00137 const dictionary& dict 00138 ); 00139 00140 00141 // Destructor 00142 00143 virtual ~uniformSet(); 00144 00145 00146 // Member Functions 00147 00148 //- Get reference point 00149 virtual point getRefPoint(const List<point>&) const; 00150 }; 00151 00152 00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00154 00155 } // End namespace Foam 00156 00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00158 00159 #endif 00160 00161 // ************************ vim: set sw=4 sts=4 et: ************************ //