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

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