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-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::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  virtual bool 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 
119 public:
120 
121  //- Runtime type information
122  TypeName("arcUniform");
123 
124 
125  // Constructors
126 
127  //- Construct from dictionary
128  arcUniform
129  (
130  const word& name,
131  const polyMesh& mesh,
132  const dictionary& dict
133  );
134 
135 
136  //- Destructor
137  virtual ~arcUniform();
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace sampledSets
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
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
virtual ~arcUniform()
Destructor.
Definition: arcUniform.C:114
arcUniform(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Definition: arcUniform.C:96
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:63
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