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

faceOnlySet.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::faceOnlySet
00026 
00027 Description
00028 
00029 SourceFiles
00030     faceOnlySet.C
00031 
00032 \*---------------------------------------------------------------------------*/
00033 
00034 #ifndef faceOnlySet_H
00035 #define faceOnlySet_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 faceOnlySet Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class faceOnlySet
00054 :
00055     public sampledSet
00056 {
00057     // Private data
00058 
00059         //- Starting point
00060         point start_;
00061 
00062         //- End point
00063         point end_;
00064 
00065 
00066     // Private Member Functions
00067 
00068         //- Samples from startTrackPt/CellI. Updates particle/samplePt/sampleI
00069         //  and puts
00070         //  samples in the DynamicLists. Returns false if end of all samples
00071         //  reached
00072         bool trackToBoundary
00073         (
00074             Particle<passiveParticle>& singleParticle,
00075             DynamicList<point>& samplingPts,
00076             DynamicList<label>& samplingCells,
00077             DynamicList<label>& samplingFaces,
00078             DynamicList<scalar>& samplingCurve
00079         ) const;
00080 
00081         //- Samples from start_ to end_. samplingSegments contains segmentNo
00082         //  for each sample.
00083         void calcSamples
00084         (
00085             DynamicList<point>& samplingPts,
00086             DynamicList<label>& samplingCells,
00087             DynamicList<label>& samplingFaces,
00088             DynamicList<label>& samplingSegments,
00089             DynamicList<scalar>& samplingCurveDist
00090         ) const;
00091 
00092         //- Uses calcSamples to obtain samples. Copies them into *this.
00093         void genSamples();
00094 
00095 public:
00096 
00097     //- Runtime type information
00098     TypeName("face");
00099 
00100     // Constructors
00101 
00102         //- Construct from components
00103         faceOnlySet
00104         (
00105             const word& name,
00106             const polyMesh& mesh,
00107             meshSearch& searchEngine,
00108             const word& axis,
00109             const point& start,
00110             const point& end
00111         );
00112 
00113         //- Construct from dictionary
00114         faceOnlySet
00115         (
00116             const word& name,
00117             const polyMesh& mesh,
00118             meshSearch& searchEngine,
00119             const dictionary& dict
00120         );
00121 
00122 
00123     // Destructor
00124 
00125         virtual ~faceOnlySet();
00126 
00127 
00128     // Member Functions
00129 
00130         const point& start() const
00131         {
00132             return start_;
00133         }
00134 
00135         const point& end() const
00136         {
00137             return end_;
00138         }
00139 
00140         //- Get reference point
00141         virtual point getRefPoint(const List<point>&) const;
00142 };
00143 
00144 
00145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00146 
00147 } // End namespace Foam
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 #endif
00152 
00153 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines