lineUniform.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-2020 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::lineUniform
26 
27 Description
28  Uniform samples along a line
29 
30 Usage
31  \table
32  Property | Description | Req'd? | Default
33  start | The start point of the line | yes |
34  end | The end point of the line | yes |
35  nPoints | The number of points | yes |
36  axis | The coordinate axis that is written | yes |
37  \endtable
38 
39  Example specification:
40  \verbatim
41  {
42  type lineUniform;
43  start (0.65 0.3 0.3);
44  end (0.65 -0.3 -0.1);
45  nPoints 200;
46  axis x;
47  }
48  \endverbatim
49 
50 SourceFiles
51  lineUniform.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef lineUniform_H
56 #define lineUniform_H
57 
58 #include "passiveParticleCloud.H"
59 #include "sampledSet.H"
60 #include "DynamicList.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 namespace sampledSets
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class lineUniform Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 class lineUniform
74 :
75  public sampledSet
76 {
77  // Private Data
78 
79  //- Starting point
80  const point start_;
81 
82  //- End point
83  const point end_;
84 
85  //- Number of points
86  const label nPoints_;
87 
88 
89  // Private Member Functions
90 
91  //- Samples from start_ to end_. samplingSegments contains segmentNo
92  // for each sample.
93  void calcSamples
94  (
95  DynamicList<point>& samplingPts,
96  DynamicList<label>& samplingCells,
97  DynamicList<label>& samplingFaces,
98  DynamicList<label>& samplingSegments,
99  DynamicList<scalar>& samplingCurveDist
100  ) const;
101 
102  //- Uses calcSamples to obtain samples. Copies them into *this.
103  void genSamples();
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("lineUniform");
110 
111 
112  // Constructors
113 
114  //- Construct from dictionary
116  (
117  const word& name,
118  const polyMesh& mesh,
119  const meshSearch& searchEngine,
120  const dictionary& dict
121  );
122 
123 
124  //- Destructor
125  virtual ~lineUniform();
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace sampledSets
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
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
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:156
virtual ~lineUniform()
Destructor.
Definition: lineUniform.C:157
A class for handling words, derived from string.
Definition: word.H:59
TypeName("lineUniform")
Runtime type information.
const word & name() const
Definition: coordSet.H:111
lineUniform(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: lineUniform.C:134
vector point
Point is a vector.
Definition: point.H:41
const meshSearch & searchEngine() const
Definition: sampledSet.H:199
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.