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-2025 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 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 namespace sampledSets
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class points Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class points
85 :
86  public sampledSet
87 {
88  // Private Data
89 
90  //- Sampling points
91  const List<point> points_;
92 
93  //- Do the points form an ordered sequence?
94  const bool ordered_;
95 
96 
97  // Private Member Functions
98 
99  //- Calculate all the sampling points
100  virtual bool calcSamples
101  (
102  DynamicList<point>& samplingPositions,
103  DynamicList<scalar>& samplingDistances,
104  DynamicList<label>& samplingSegments,
105  DynamicList<label>& samplingCells,
106  DynamicList<label>& samplingFaces
107  ) const;
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("points");
114 
115 
116  // Static Member Functions
117 
118  //- Calculate all the sampling points
119  static void calcSamples
120  (
121  const polyMesh& mesh,
122  const pointField& points,
123  DynamicList<point>& samplingPositons,
124  DynamicList<scalar>& samplingDistances,
125  DynamicList<label>& samplingSegments,
126  DynamicList<label>& samplingCells,
127  DynamicList<label>& samplingFaces
128  );
129 
130 
131  // Constructors
132 
133  //- Construct from dictionary
134  points
135  (
136  const word& name,
137  const polyMesh& mesh,
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 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Motion of the mesh specified as a list of pointMeshMovers.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
const polyMesh & mesh() const
Access the mesh.
Definition: sampledSetI.H:36
const word & name() const
Access the name.
Definition: sampledSetI.H:30
Specified point samples. Optionally ordered into a continuous path. Ordering is an optimisation; it e...
Definition: points.H:106
TypeName("points")
Runtime type information.
virtual ~points()
Destructor.
Definition: points.C:234
points(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Definition: points.C:220
Set of sets to sample. Call sampledSets.write() to sample&write files.
A class for handling words, derived from string.
Definition: word.H:63
const pointField & points
Namespace for OpenFOAM.
dictionary dict