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-2015 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
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  // Constructors
99 
100  //- Construct from components
102  (
103  const word& name,
104  const polyMesh& mesh,
105  const meshSearch& searchEngine,
106  const word& axis,
107  const List<point>& samplePoints
108  );
109 
110  //- Construct from dictionary
112  (
113  const word& name,
114  const polyMesh& mesh,
115  const meshSearch& searchEngine,
116  const dictionary& dict
117  );
118 
119 
120  //- Destructor
121  virtual ~polyLineSet();
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Foam::sampledSet
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:64
Foam::coordSet::name
const word & name() const
Definition: coordSet.H:111
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::meshSearch
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:57
Foam::polyLineSet::calcSamples
void calcSamples(DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< label > &samplingSegments, DynamicList< scalar > &samplingCurveDist) const
Samples all point in sampleCoords_.
Definition: polyLineSet.C:129
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:56
Foam::sampledSet::searchEngine
const meshSearch & searchEngine() const
Definition: sampledSet.H:253
Foam::passiveParticle
Copy of base particle.
Definition: passiveParticle.H:50
Foam::polyLineSet
Sample along poly line defined by a list of points (knots)
Definition: polyLineSet.H:50
Foam::coordSet::axis
word axis() const
Definition: coordSet.H:116
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::polyLineSet::trackToBoundary
bool trackToBoundary(passiveParticleCloud &particleCloud, passiveParticle &singleParticle, label &sampleI, DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< scalar > &samplingCurveDist) const
Sample till hits boundary. Called with singleParticle at position.
Definition: polyLineSet.C:45
sampledSet.H
Foam::label
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
Foam::polyLineSet::TypeName
TypeName("polyLine")
Runtime type information.
Foam::passiveParticleCloud
A Cloud of passive particles.
Definition: passiveParticleCloud.H:49
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::polyLineSet::polyLineSet
polyLineSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const List< point > &samplePoints)
Construct from components.
Definition: polyLineSet.C:354
Foam::polyLineSet::genSamples
void genSamples()
Uses calcSamples to obtain samples. Copies them into *this.
Definition: polyLineSet.C:316
Foam::polyLineSet::sampleCoords_
List< point > sampleCoords_
Sampling points.
Definition: polyLineSet.H:57
Foam::sampledSet::mesh
const polyMesh & mesh() const
Definition: sampledSet.H:248
Foam::polyLineSet::~polyLineSet
virtual ~polyLineSet()
Destructor.
Definition: polyLineSet.C:396
passiveParticleCloud.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
DynamicList.H