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 | Copyright (C) 2011 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::arraySet
26 
27 Description
28 
29 SourceFiles
30  arraySet.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef arraySet_H
35 #define arraySet_H
36 
37 #include "sampledSet.H"
38 #include "DynamicList.H"
39 #include "coordinateSystem.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 class passiveParticle;
48 template<class Type> class particle;
49 
50 /*---------------------------------------------------------------------------*\
51  Class arraySet Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class arraySet
55 :
56  public sampledSet
57 {
58  // Private data
59 
60  //- Coordinate syste
61  coordinateSystem coordSys_;
62 
63  //- Point density vector
64  Vector<label> pointsDensity_;
65 
66  //- Span box
67  Vector<scalar> spanBox_;
68 
69 
70  // Private Member Functions
71 
72  //- Samples all points in sampleCoords.
73  void calcSamples
74  (
75  DynamicList<point>& samplingPts,
76  DynamicList<label>& samplingCells,
77  DynamicList<label>& samplingFaces,
78  DynamicList<label>& samplingSegments,
79  DynamicList<scalar>& samplingCurveDist
80  ) const;
81 
82  //- Uses calcSamples to obtain samples. Copies them into *this.
83  void genSamples();
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("array");
90 
91 
92  // Constructors
93 
94  //- Construct from components
95  arraySet
96  (
97  const word& name,
98  const polyMesh& mesh,
99  const meshSearch& searchEngine,
100  const word& axis,
101  const coordinateSystem& coordSys,
102  const Vector<label>& pointsDensity,
103  const Vector<scalar>& spanBox
104  );
105 
106  //- Construct from dictionary
107  arraySet
108  (
109  const word& name,
110  const polyMesh& mesh,
111  const meshSearch& searchEngine,
112  const dictionary& dict
113  );
114 
115 
116  //- Destructor
117  virtual ~arraySet();
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
arraySet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const coordinateSystem &coordSys, const Vector< label > &pointsDensity, const Vector< scalar > &spanBox)
Construct from components.
Definition: arraySet.C:143
Base class for other coordinate system specifications.
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:241
word axis() const
Definition: coordSet.H:116
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual ~arraySet()
Destructor.
Definition: arraySet.C:191
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:64
A class for handling words, derived from string.
Definition: word.H:59
const word & name() const
Definition: coordSet.H:111
const meshSearch & searchEngine() const
Definition: sampledSet.H:246
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
TypeName("array")
Runtime type information.
Namespace for OpenFOAM.