FreeFOAM The Cross-Platform CFD Toolkit
faceOnlySet.H
Go to the documentation of this file.
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.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::faceOnlySet
26 
27 Description
28 
29 SourceFiles
30  faceOnlySet.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef faceOnlySet_H
35 #define faceOnlySet_H
36 
37 #include <sampling/sampledSet.H>
38 #include <OpenFOAM/DynamicList.H>
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Forward declaration of classes
46 class passiveParticle;
47 template<class Type> class Particle;
48 
49 /*---------------------------------------------------------------------------*\
50  Class faceOnlySet Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public sampledSet
56 {
57  // Private data
58 
59  //- Starting point
60  point start_;
61 
62  //- End point
63  point end_;
64 
65 
66  // Private Member Functions
67 
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;
80 
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;
91 
92  //- Uses calcSamples to obtain samples. Copies them into *this.
93  void genSamples();
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("face");
99 
100  // Constructors
101 
102  //- Construct from components
104  (
105  const word& name,
106  const polyMesh& mesh,
108  const word& axis,
109  const point& start,
110  const point& end
111  );
112 
113  //- Construct from dictionary
115  (
116  const word& name,
117  const polyMesh& mesh,
118  meshSearch& searchEngine,
119  const dictionary& dict
120  );
121 
122 
123  // Destructor
124 
125  virtual ~faceOnlySet();
126 
127 
128  // Member Functions
129 
130  const point& start() const
131  {
132  return start_;
133  }
134 
135  const point& end() const
136  {
137  return end_;
138  }
139 
140  //- Get reference point
141  virtual point getRefPoint(const List<point>&) const;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************ vim: set sw=4 sts=4 et: ************************ //