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-2018 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>& samplingPts,
104  DynamicList<label>& samplingCells,
105  DynamicList<label>& samplingFaces,
106  DynamicList<label>& samplingSegments,
107  DynamicList<scalar>& samplingCurveDist
108  ) const;
109 
110  //- Calculate all the sampling points
111  void calcSamplesOrdered
112  (
113  DynamicList<point>& samplingPts,
114  DynamicList<label>& samplingCells,
115  DynamicList<label>& samplingFaces,
116  DynamicList<label>& samplingSegments,
117  DynamicList<scalar>& samplingCurveDist
118  ) const;
119 
120  //- Uses calcSamples to obtain samples and copies them into *this
121  void genSamples();
122 
123 
124 public:
125 
126  //- Runtime type information
127  TypeName("points");
128 
129 
130  // Constructors
131 
132  //- Construct from dictionary
133  points
134  (
135  const word& name,
136  const polyMesh& mesh,
137  const meshSearch& searchEngine,
138  const dictionary& dict
139  );
140 
141 
142  //- Destructor
143  virtual ~points();
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace sampledSets
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
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:194
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual ~points()
Destructor.
Definition: points.C:199
TypeName("points")
Runtime type information.
const pointField & points
A class for handling words, derived from string.
Definition: word.H:59
const word & name() const
Definition: coordSet.H:111
points(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: points.C:177
const meshSearch & searchEngine() const
Definition: sampledSet.H:199
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.