Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / sampling / sampledSet / face / faceOnlySet.H
blobf910c1f965152f2874ba34182d63f0270ee82772
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2011 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"
39 #include "passiveParticleCloud.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                          Class faceOnlySet Declaration
48 \*---------------------------------------------------------------------------*/
50 class faceOnlySet
52     public sampledSet
54     // Private data
56         //- Starting point
57         point start_;
59         //- End point
60         point end_;
63     // Private Member Functions
65         //- Samples from startTrackPt/CellI. Updates particle/samplePt/sampleI
66         //  and puts
67         //  samples in the DynamicLists. Returns false if end of all samples
68         //  reached
69         bool trackToBoundary
70         (
71             passiveParticle& singleParticle,
72             DynamicList<point>& samplingPts,
73             DynamicList<label>& samplingCells,
74             DynamicList<label>& samplingFaces,
75             DynamicList<scalar>& samplingCurve
76         ) const;
78         //- Samples from start_ to end_. samplingSegments contains segmentNo
79         //  for each sample.
80         void calcSamples
81         (
82             DynamicList<point>& samplingPts,
83             DynamicList<label>& samplingCells,
84             DynamicList<label>& samplingFaces,
85             DynamicList<label>& samplingSegments,
86             DynamicList<scalar>& samplingCurveDist
87         ) const;
89         //- Uses calcSamples to obtain samples. Copies them into *this.
90         void genSamples();
93 public:
95     //- Runtime type information
96     TypeName("face");
98     // Constructors
100         //- Construct from components
101         faceOnlySet
102         (
103             const word& name,
104             const polyMesh& mesh,
105             meshSearch& searchEngine,
106             const word& axis,
107             const point& start,
108             const point& end
109         );
111         //- Construct from dictionary
112         faceOnlySet
113         (
114             const word& name,
115             const polyMesh& mesh,
116             meshSearch& searchEngine,
117             const dictionary& dict
118         );
121     //- Destructor
122     virtual ~faceOnlySet();
125     // Member Functions
127         const point& start() const
128         {
129             return start_;
130         }
132         const point& end() const
133         {
134             return end_;
135         }
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 } // End namespace Foam
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 #endif
147 // ************************************************************************* //