arcUniform.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-2023 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::arcUniform
26 
27 Description
28  Uniform samples along an arc
29 
30 Usage
31  \table
32  Property | Description | Req'd? | Default
33  centre | Centre of the circle | yes |
34  normal | Direction normal to the plane of the circle | yes |
35  radial | Vector from the centre to a point on the arc | yes |
36  startAngle | The angle of the start of the arc in radians | yes |
37  endAngle | The angle of the end of the arc in radians | yes |
38  nPoints | The number of points | yes |
39  axis | The coordinate axis that is written | yes |
40  \endtable
41 
42  Example specification:
43  \verbatim
44  {
45  type arcUniform;
46  centre (0.95 0 0.25);
47  normal (1 0 0);
48  radial (0 0 0.25);
49  startAngle -1.57079633;
50  endAngle 0.52359878;
51  nPoints 200;
52  axis x;
53  }
54  \endverbatim
55 
56 SourceFiles
57  arcUniform.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef arcUniform_H
62 #define arcUniform_H
63 
64 #include "sampledSet.H"
65 #include "DynamicList.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 namespace sampledSets
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class arcUniform Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 class arcUniform
79 :
80  public sampledSet
81 {
82  // Private Data
83 
84  // Arc definition
85 
86  //- Centre of the circle of which the arc is a part
87  const point centre_;
88 
89  //- Normal direction to the circle of which the arc is a part
90  const vector normal_;
91 
92  //- Radial vector from the centre to the point on the arc from
93  // which the angles are measured
94  const vector radial_;
95 
96  //- Start angle
97  const scalar startAngle_;
98 
99  //- End angle
100  const scalar endAngle_;
101 
102  //- Number of points spaced along the arc
103  const label nPoints_;
104 
105 
106  // Private Member Functions
107 
108  //- Calculate all the sampling points
109  void calcSamples
110  (
111  DynamicList<point>& samplingPositions,
112  DynamicList<scalar>& samplingDistances,
113  DynamicList<label>& samplingSegments,
114  DynamicList<label>& samplingCells,
115  DynamicList<label>& samplingFaces
116  ) const;
117 
118  //- Uses calcSamples to obtain samples and copies them into *this
119  void genSamples();
120 
121 
122 public:
123 
124  //- Runtime type information
125  TypeName("arcUniform");
126 
127 
128  // Constructors
129 
130  //- Construct from dictionary
131  arcUniform
132  (
133  const word& name,
134  const polyMesh& mesh,
135  const meshSearch& searchEngine,
136  const dictionary& dict
137  );
138 
139 
140  //- Destructor
141  virtual ~arcUniform();
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace sampledSets
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
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
virtual ~arcUniform()
Destructor.
Definition: arcUniform.C:151
arcUniform(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: arcUniform.C:130
TypeName("arcUniform")
Runtime type information.
Set of sets to sample. Call sampledSets.write() to sample&write files.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
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
vector point
Point is a vector.
Definition: point.H:41
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
dictionary dict