ENH: patchCloudSet: new sampledSet
[OpenFOAM-1.7.x.git] / src / sampling / sampledSet / face / faceOnlySet.H
blob0b08b9b5800ae0b0a9faf1406e121b633677e007
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::faceOnlySet
27 Description
29 SourceFiles
30     faceOnlySet.C
32 \*---------------------------------------------------------------------------*/
34 #ifndef faceOnlySet_H
35 #define faceOnlySet_H
37 #include "sampledSet.H"
38 #include "DynamicList.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 // Forward declaration of classes
46 class passiveParticle;
47 template<class Type> class Particle;
49 /*---------------------------------------------------------------------------*\
50                            Class faceOnlySet Declaration
51 \*---------------------------------------------------------------------------*/
53 class faceOnlySet
55     public sampledSet
57     // Private data
59         //- Starting point
60         point start_;
62         //- End point
63         point end_;
66     // Private Member Functions
68         //- Samples from startTrackPt/CellI. Updates particle/samplePt/sampleI
69         //  and puts
70         //  samples in the DynamicLists. Returns false if end of all samples
71         //  reached
72         bool trackToBoundary
73         (
74             Particle<passiveParticle>& singleParticle,
75             DynamicList<point>& samplingPts,
76             DynamicList<label>& samplingCells,
77             DynamicList<label>& samplingFaces,
78             DynamicList<scalar>& samplingCurve
79         ) const;
81         //- Samples from start_ to end_. samplingSegments contains segmentNo
82         //  for each sample.
83         void calcSamples
84         (
85             DynamicList<point>& samplingPts,
86             DynamicList<label>& samplingCells,
87             DynamicList<label>& samplingFaces,
88             DynamicList<label>& samplingSegments,
89             DynamicList<scalar>& samplingCurveDist
90         ) const;
92         //- Uses calcSamples to obtain samples. Copies them into *this.
93         void genSamples();
95 public:
97     //- Runtime type information
98     TypeName("face");
100     // Constructors
102         //- Construct from components
103         faceOnlySet
104         (
105             const word& name,
106             const polyMesh& mesh,
107             meshSearch& searchEngine,
108             const word& axis,
109             const point& start,
110             const point& end
111         );
113         //- Construct from dictionary
114         faceOnlySet
115         (
116             const word& name,
117             const polyMesh& mesh,
118             meshSearch& searchEngine,
119             const dictionary& dict
120         );
123     // Destructor
125         virtual ~faceOnlySet();
128     // Member Functions
130         const point& start() const
131         {
132             return start_;
133         }
135         const point& end() const
136         {
137             return end_;
138         }
140         //- Get reference point
141         virtual point getRefPoint(const List<point>&) const;
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 } // End namespace Foam
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 #endif
153 // ************************************************************************* //