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 can also contain an embedded coordinateSystem specification.
43 
44 SourceFiles
45  arraySet.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef arraySet_H
50 #define arraySet_H
51 
52 #include "sampledSet.H"
53 #include "labelVector.H"
54 #include "DynamicList.H"
55 #include "cartesianCS.H"
56 #include "cylindricalCS.H"
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class arraySet Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 class arraySet
68 :
69  public sampledSet
70 {
71  // Private data
72 
73  //- Local Cartesian coordinate system
74  coordSystem::cartesian csys_;
75 
76  //- Point density vector
77  labelVector pointsDensity_;
78 
79  //- Span box
80  vector spanBox_;
81 
82 
83  // Private Member Functions
84 
85  //- Samples all points in sampleCoords.
86  void calcSamples
87  (
88  DynamicList<point>& samplingPts,
89  DynamicList<label>& samplingCells,
90  DynamicList<label>& samplingFaces,
91  DynamicList<label>& samplingSegments,
92  DynamicList<scalar>& samplingCurveDist
93  ) const;
94 
95  //- Uses calcSamples to obtain samples. Copies them into *this.
96  void genSamples();
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("array");
103 
104 
105  // Constructors
106 
107  //- Construct from components
108  arraySet
109  (
110  const word& name,
111  const polyMesh& mesh,
112  const meshSearch& searchEngine,
113  const word& axis,
114  const coordSystem::cartesian& csys,
115  const Vector<label>& pointsDensity,
116  const Vector<scalar>& spanBox
117  );
118 
119  //- Construct from dictionary
120  arraySet
121  (
122  const word& name,
123  const polyMesh& mesh,
124  const meshSearch& searchEngine,
125  const dictionary& dict
126  );
127 
128 
129  //- Destructor
130  virtual ~arraySet() = default;
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Foam::sampledSet
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:83
Foam::coordSet::name
const word & name() const
Definition: coordSet.H:125
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::meshSearch
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:60
Foam::DynamicList< point >
Foam::sampledSet::searchEngine
const meshSearch & searchEngine() const
Definition: sampledSet.H:286
labelVector.H
cartesianCS.H
Foam::coordSet::axis
word axis() const
Definition: coordSet.H:130
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::labelVector
Vector< label > labelVector
Vector of labels.
Definition: labelVector.H:51
sampledSet.H
Foam::arraySet::arraySet
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:137
cylindricalCS.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::arraySet::~arraySet
virtual ~arraySet()=default
Destructor.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::arraySet::TypeName
TypeName("array")
Runtime type information.
Foam::arraySet
Specifies an x,y,z array of uniformly distributed sampling points.
Definition: arraySet.H:91
Foam::sampledSet::mesh
const polyMesh & mesh() const
Definition: sampledSet.H:281
Foam::coordSystem::cartesian
A Cartesian coordinate system.
Definition: cartesianCS.H:69
Foam::Vector< label >
DynamicList.H