polyLineSet.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::polyLineSet
26 
27 Description
28  Sample along poly line defined by a list of points (knots)
29 
30 SourceFiles
31  polyLineSet.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef polyLineSet_H
36 #define polyLineSet_H
37 
38 #include "sampledSet.H"
39 #include "DynamicList.H"
40 #include "passiveParticleCloud.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class polyLineSet Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class polyLineSet
52 :
53  public sampledSet
54 {
55  // Private data
56 
57  //- Sampling points
58  List<point> sampleCoords_;
59 
60 
61  // Private Member Functions
62 
63  //- Sample till hits boundary. Called with singleParticle at position
64  // inbetween sampleCoords_[sampleI] and sampleCoords_[sampleI+1].
65  // Returns false if end of samples reached.
66  bool trackToBoundary
67  (
68  passiveParticleCloud& particleCloud,
69  passiveParticle& singleParticle,
70  label& sampleI,
71  DynamicList<point>& samplingPts,
72  DynamicList<label>& samplingCells,
73  DynamicList<label>& samplingFaces,
74  DynamicList<scalar>& samplingCurveDist
75  ) const;
76 
77  //- Samples all point in sampleCoords_
78  // samplingSegments contains segmentNo for each sample.
79  void calcSamples
80  (
81  DynamicList<point>& samplingPts,
82  DynamicList<label>& samplingCells,
83  DynamicList<label>& samplingFaces,
84  DynamicList<label>& samplingSegments,
85  DynamicList<scalar>& samplingCurveDist
86  ) const;
87 
88  //- Uses calcSamples to obtain samples. Copies them into *this.
89  void genSamples();
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("polyLine");
96 
97 
98  // Static data
99 
100  //- Tolerance when comparing points relative to difference between
101  // start_ and end_
102  static const scalar tol;
103 
104 
105  // Constructors
106 
107  //- Construct from components
109  (
110  const word& name,
111  const polyMesh& mesh,
112  const meshSearch& searchEngine,
113  const word& axis,
114  const List<point>& samplePoints
115  );
116 
117  //- Construct from dictionary
119  (
120  const word& name,
121  const polyMesh& mesh,
122  const meshSearch& searchEngine,
123  const dictionary& dict
124  );
125 
126 
127  //- Destructor
128  virtual ~polyLineSet();
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
Definition: meshSearch.H:57
Sample along poly line defined by a list of points (knots)
Definition: polyLineSet.H:50
dictionary dict
const polyMesh & mesh() const
Definition: sampledSet.H:241
word axis() const
Definition: coordSet.H:116
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual ~polyLineSet()
Destructor.
Definition: polyLineSet.C:385
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:60
TypeName("polyLine")
Runtime type information.
A Cloud of passive particles.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
static const scalar tol
Tolerance when comparing points relative to difference between.
Definition: polyLineSet.H:101
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
const word & name() const
Definition: coordSet.H:111
const meshSearch & searchEngine() const
Definition: sampledSet.H:246
polyLineSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const List< point > &samplePoints)
Construct from components.
Definition: polyLineSet.C:343
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Copy of base particle.
Namespace for OpenFOAM.