arraySet.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9  Copyright (C) 2018 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::arraySet
29 
30 Description
31  Specifies an x,y,z array of uniformly distributed sampling points.
32 
33  For a dictionary specification:
34  \table
35  Property | Description | Required | Default
36  type | array | yes |
37  axis | x, y, z, xyz, distance | yes |
38  pointsDensity | The sampling density as (x y z) integers | yes |
39  spanBox | The sample box dimensions (vector) | yes |
40  \endtable
41 
42  The dictionary should also contain an embedded (Cartesian) coordinateSystem
43  specification, for example,
44 
45  \verbatim
46  origin (-0.05 -0.05 -0.05);
47  rotation
48  {
49  type axes;
50  e1 (1 0 0);
51  e2 (0 1 0);
52  }
53  \endverbatim
54 
55 SourceFiles
56  arraySet.C
57 
58 \*---------------------------------------------------------------------------*/
59 
60 #ifndef arraySet_H
61 #define arraySet_H
62 
63 #include "sampledSet.H"
64 #include "labelVector.H"
65 #include "DynamicList.H"
66 #include "cartesianCS.H"
67 #include "cylindricalCS.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class arraySet Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 class arraySet
79 :
80  public sampledSet
81 {
82  // Private data
83 
84  //- Local Cartesian coordinate system
85  coordSystem::cartesian csys_;
86 
87  //- Point density vector
88  labelVector pointsDensity_;
89 
90  //- Span box
91  vector spanBox_;
92 
93 
94  // Private Member Functions
95 
96  //- Samples all points in sampleCoords.
97  void calcSamples
98  (
99  DynamicList<point>& samplingPts,
100  DynamicList<label>& samplingCells,
101  DynamicList<label>& samplingFaces,
102  DynamicList<label>& samplingSegments,
103  DynamicList<scalar>& samplingCurveDist
104  ) const;
105 
106  //- Uses calcSamples to obtain samples. Copies them into *this.
107  void genSamples();
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("array");
114 
115 
116  // Constructors
117 
118  //- Construct from components
119  arraySet
120  (
121  const word& name,
122  const polyMesh& mesh,
123  const meshSearch& searchEngine,
124  const word& axis,
125  const coordSystem::cartesian& csys,
126  const Vector<label>& pointsDensity,
127  const Vector<scalar>& spanBox
128  );
129 
130  //- Construct from dictionary
131  arraySet
132  (
133  const word& name,
134  const polyMesh& mesh,
135  const meshSearch& searchEngine,
136  const dictionary& dict
137  );
138 
139 
140  //- Destructor
141  virtual ~arraySet() = default;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
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:56
dictionary dict
const word & axis() const
The sort axis name.
Definition: coordSet.H:160
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual ~arraySet()=default
Destructor.
A Cartesian coordinate system.
Definition: cartesianCS.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:63
Vector< scalar > vector
Definition: vector.H:57
const word & name() const noexcept
The coord-set name.
Definition: coordSet.H:152
const polyMesh & mesh() const noexcept
Definition: sampledSet.H:373
const meshSearch & searchEngine() const noexcept
Definition: sampledSet.H:378
arraySet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const coordSystem::cartesian &csys, const Vector< label > &pointsDensity, const Vector< scalar > &spanBox)
Construct from components.
Definition: arraySet.C:139
Vector< label > labelVector
Vector of labels.
Definition: labelVector.H:47
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
TypeName("array")
Runtime type information.
Namespace for OpenFOAM.