points.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 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::sampledSets::points
26 
27 Description
28  Specified point samples. Optionally ordered into a continuous path.
29  Ordering is an optimisation; it enables tracking from one point to the
30  next. If ordering is off, each point is searched for individually.
31 
32 Usage
33  \table
34  Property | Description | Req'd? | Default
35  points | The points to sample | yes |
36  ordered | Are the points in order? | yes |
37  axis | The coordinate axis that is written | yes |
38  \endtable
39 
40  Example specification:
41  \verbatim
42  {
43  type points;
44  points
45  (
46  (0.95 0 0.25)
47  (0.951251 0 0.250119)
48  (0.952468 0 0.250473)
49  (0.953618 0 0.251057)
50  (0.954669 0 0.251859)
51  (0.95559 0 0.252865)
52  (0.956353 0 0.254057)
53  (0.956931 0 0.255413)
54  (0.9573 0 0.256908)
55  (0.957441 0 0.258513)
56  );
57  ordered yes;
58  axis x;
59  }
60  \endverbatim
61 
62 SourceFiles
63  points.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef points_H
68 #define points_H
69 
70 #include "sampledSet.H"
71 #include "DynamicList.H"
72 #include "passiveParticleCloud.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 namespace sampledSets
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class points Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class points
86 :
87  public sampledSet
88 {
89  // Private Data
90 
91  //- Sampling points
92  const List<point> points_;
93 
94  //- Do the points form an ordered sequence?
95  const Switch ordered_;
96 
97 
98  // Private Member Functions
99 
100  //- Calculate all the sampling points
101  void calcSamplesUnordered
102  (
103  DynamicList<point>& samplingPositions,
104  DynamicList<label>& samplingSegments,
105  DynamicList<label>& samplingCells,
106  DynamicList<label>& samplingFaces
107  ) const;
108 
109  //- Calculate all the sampling points
110  void calcSamplesOrdered
111  (
112  DynamicList<point>& samplingPositions,
113  DynamicList<scalar>& samplingDistances,
114  DynamicList<label>& samplingSegments,
115  DynamicList<label>& samplingCells,
116  DynamicList<label>& samplingFaces
117  ) const;
118 
119  //- Uses calcSamples to obtain samples and copies them into *this
120  void genSamples();
121 
122 
123 public:
124 
125  //- Runtime type information
126  TypeName("points");
127 
128 
129  // Static Member Functions
130 
131  //- Calculate all the sampling points
132  static void calcSamples
133  (
134  const polyMesh& mesh,
135  const meshSearch& searchEngine,
136  const pointField& points,
137  DynamicList<point>& samplingPositons,
138  DynamicList<scalar>& samplingDistances,
139  DynamicList<label>& samplingSegments,
140  DynamicList<label>& samplingCells,
141  DynamicList<label>& samplingFaces
142  );
143 
144 
145  // Constructors
146 
147  //- Construct from dictionary
148  points
149  (
150  const word& name,
151  const polyMesh& mesh,
152  const meshSearch& searchEngine,
153  const dictionary& dict
154  );
155 
156 
157  //- Destructor
158  virtual ~points();
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace sampledSets
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:58
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
const meshSearch & searchEngine() const
Access the search engine.
Definition: sampledSet.H:216
const word & name() const
Access the name.
Definition: sampledSet.H:204
const polyMesh & mesh() const
Access the mesh.
Definition: sampledSet.H:210
Specified point samples. Optionally ordered into a continuous path. Ordering is an optimisation; it e...
Definition: points.H:107
TypeName("points")
Runtime type information.
virtual ~points()
Destructor.
Definition: points.C:298
static void calcSamples(const polyMesh &mesh, const meshSearch &searchEngine, const pointField &points, DynamicList< point > &samplingPositons, DynamicList< scalar > &samplingDistances, DynamicList< label > &samplingSegments, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces)
Calculate all the sampling points.
Definition: points.C:48
points(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: points.C:281
Set of sets to sample. Call sampledSets.write() to sample&write files.
A class for handling words, derived from string.
Definition: word.H:62
const pointField & points
Namespace for OpenFOAM.
dictionary dict