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-2019 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>& samplingPts,
112  DynamicList<label>& samplingCells,
113  DynamicList<label>& samplingFaces,
114  DynamicList<label>& samplingSegments,
115  DynamicList<scalar>& samplingCurveDist
116  ) const;
118  //- Uses calcSamples to obtain samples and copies them into *this
119  void genSamples();
120 
121 public:
122 
123  //- Runtime type information
124  TypeName("arcUniform");
125 
126 
127  // Constructors
128 
129  //- Construct from dictionary
130  arcUniform
131  (
132  const word& name,
133  const polyMesh& mesh,
134  const meshSearch& searchEngine,
135  const dictionary& dict
136  );
137 
138 
139  // Destructor
140  virtual ~arcUniform();
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace sampledSets
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
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
arcUniform(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: arcUniform.C:121
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:158
TypeName("arcUniform")
Runtime type information.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
A class for handling words, derived from string.
Definition: word.H:59
const word & name() const
Definition: coordSet.H:111
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.