boxUniform.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-2018 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::boxUniform
26 
27 Description
28  Uniform 3D-grid of samples
29 
30 Usage
31  \table
32  Property | Description | Req'd? | Default
33  box | The box which contains the samples | yes |
34  nPoints | The number of points in each direction | yes |
35  axis | The coordinate axis that is written | yes |
36  \endtable
37 
38  Example specification:
39  \verbatim
40  {
41  type boxUniform;
42  box (0.95 0 0.25) (1.2 0.25 0.5);
43  nPoints (2 4 6);
44  axis x;
45  }
46  \endverbatim
47 
48 SourceFiles
49  boxUniform.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef boxUniform_H
54 #define boxUniform_H
55 
56 #include "sampledSet.H"
57 #include "DynamicList.H"
58 #include "labelVector.H"
59 #include "boundBox.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 
66 // Forward declaration of classes
67 class passiveParticle;
68 template<class Type> class particle;
69 
70 namespace sampledSets
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class boxUniform Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 class boxUniform
78 :
79  public sampledSet
80 {
81  // Private data
82 
83  //- Box
84  const boundBox box_;
85 
86  //- The number of points across each direction of the box
87  const labelVector nPoints_;
88 
89 
90  // Private Member Functions
91 
92  //- Samples all points in sampleCoords.
93  void calcSamples
94  (
95  DynamicList<point>& samplingPts,
96  DynamicList<label>& samplingCells,
97  DynamicList<label>& samplingFaces,
98  DynamicList<label>& samplingSegments,
99  DynamicList<scalar>& samplingCurveDist
100  ) const;
101 
102  //- Uses calcSamples to obtain samples. Copies them into *this.
103  void genSamples();
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("boxUniform");
110 
111 
112  // Constructors
113 
114  //- Construct from dictionary
115  boxUniform
116  (
117  const word& name,
118  const polyMesh& mesh,
119  const meshSearch& searchEngine,
120  const dictionary& dict
121  );
122 
123 
124  //- Destructor
125  virtual ~boxUniform();
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace sampledSets
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A class for handling words, derived from string.
Definition: word.H:59
TypeName("boxUniform")
Runtime type information.
const word & name() const
Definition: coordSet.H:111
boxUniform(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: boxUniform.C:125
virtual ~boxUniform()
Destructor.
Definition: boxUniform.C:147
const meshSearch & searchEngine() const
Definition: sampledSet.H:199
Vector< label > labelVector
Vector of labels.
Definition: labelVector.H:49
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.