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::curveSet 00026 00027 Description 00028 00029 SourceFiles 00030 curveSet.C 00031 00032 \*---------------------------------------------------------------------------*/ 00033 00034 #ifndef curveSet_H 00035 #define curveSet_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 curveSet Declaration 00051 \*---------------------------------------------------------------------------*/ 00052 00053 class curveSet 00054 : 00055 public sampledSet 00056 { 00057 // Private data 00058 00059 //- sampling points 00060 List<point> sampleCoords_; 00061 00062 00063 // Private Member Functions 00064 00065 //- Sample till hits boundary. Called with singleParticle at position 00066 // inbetween sampleCoords_[sampleI] and sampleCoords_[sampleI+1]. 00067 // Returns false if end of samples reached. 00068 bool trackToBoundary 00069 ( 00070 Particle<passiveParticle>& singleParticle, 00071 label& sampleI, 00072 DynamicList<point>& samplingPts, 00073 DynamicList<label>& samplingCells, 00074 DynamicList<label>& samplingFaces, 00075 DynamicList<scalar>& samplingCurveDist 00076 ) const; 00077 00078 //- Samples all point in sampleCoords_ 00079 // samplingSegments contains segmentNo for each sample. 00080 void calcSamples 00081 ( 00082 DynamicList<point>& samplingPts, 00083 DynamicList<label>& samplingCells, 00084 DynamicList<label>& samplingFaces, 00085 DynamicList<label>& samplingSegments, 00086 DynamicList<scalar>& samplingCurveDist 00087 ) const; 00088 00089 //- Uses calcSamples to obtain samples. Copies them into *this. 00090 void genSamples(); 00091 00092 00093 public: 00094 00095 //- Runtime type information 00096 TypeName("curve"); 00097 00098 00099 // Constructors 00100 00101 //- Construct from components 00102 curveSet 00103 ( 00104 const word& name, 00105 const polyMesh& mesh, 00106 meshSearch& searchEngine, 00107 const word& axis, 00108 const List<point>& samplePoints 00109 ); 00110 00111 //- Construct from dictionary 00112 curveSet 00113 ( 00114 const word& name, 00115 const polyMesh& mesh, 00116 meshSearch& searchEngine, 00117 const dictionary& dict 00118 ); 00119 00120 00121 // Destructor 00122 00123 virtual ~curveSet(); 00124 00125 00126 // Member Functions 00127 00128 //- Get reference point 00129 virtual point getRefPoint(const List<point>&) const; 00130 }; 00131 00132 00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00134 00135 } // End namespace Foam 00136 00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00138 00139 #endif 00140 00141 // ************************ vim: set sw=4 sts=4 et: ************************ //