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) 2011-2016 OpenFOAM Foundation
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 "sampledSet.H"
38 #include "DynamicList.H"
39 #include "passiveParticleCloud.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class faceOnlySet Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class faceOnlySet
51 :
52  public sampledSet
53 {
54  // Private data
55 
56  //- Starting point
57  point start_;
58 
59  //- End point
60  point end_;
61 
62 
63  // Private Member Functions
64 
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  passiveParticleCloud& particleCloud,
72  passiveParticle& singleParticle,
73  const scalar smallDist,
74  DynamicList<point>& samplingPts,
75  DynamicList<label>& samplingCells,
76  DynamicList<label>& samplingFaces,
77  DynamicList<scalar>& samplingCurve
78  ) const;
79 
80  //- Samples from start_ to end_. samplingSegments contains segmentNo
81  // for each sample.
82  void calcSamples
83  (
84  DynamicList<point>& samplingPts,
85  DynamicList<label>& samplingCells,
86  DynamicList<label>& samplingFaces,
87  DynamicList<label>& samplingSegments,
88  DynamicList<scalar>& samplingCurveDist
89  ) const;
90 
91  //- Uses calcSamples to obtain samples. Copies them into *this.
92  void genSamples();
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("face");
99 
100 
101  // Static data
102 
103  //- Tolerance when comparing points relative to difference between
104  // start_ and end_
105  static const scalar tol;
106 
107 
108  // Constructors
109 
110  //- Construct from components
112  (
113  const word& name,
114  const polyMesh& mesh,
115  const meshSearch& searchEngine,
116  const word& axis,
117  const point& start,
118  const point& end
119  );
120 
121  //- Construct from dictionary
123  (
124  const word& name,
125  const polyMesh& mesh,
126  const meshSearch& searchEngine,
127  const dictionary& dict
128  );
129 
130 
131  //- Destructor
132  virtual ~faceOnlySet();
133 
134 
135  // Member Functions
137  const point& start() const
138  {
139  return start_;
140  }
142  const point& end() const
143  {
144  return end_;
145  }
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
Definition: meshSearch.H:57
dictionary dict
const polyMesh & mesh() const
Definition: sampledSet.H:241
word axis() const
Definition: coordSet.H:116
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const point & start() const
Definition: faceOnlySet.H:136
A Cloud of passive particles.
const point & end() const
Definition: faceOnlySet.H:141
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:64
A class for handling words, derived from string.
Definition: word.H:59
TypeName("face")
Runtime type information.
virtual ~faceOnlySet()
Destructor.
Definition: faceOnlySet.C:374
static const scalar tol
Tolerance when comparing points relative to difference between.
Definition: faceOnlySet.H:104
const word & name() const
Definition: coordSet.H:111
faceOnlySet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const point &start, const point &end)
Construct from components.
Definition: faceOnlySet.C:329
const meshSearch & searchEngine() const
Definition: sampledSet.H:246
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Copy of base particle.
Namespace for OpenFOAM.