boundaryPoints.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::boundaryPoints
26 
27 Description
28  Specified point samples within patches
29 
30 Usage
31  \table
32  Property | Description | Req'd? | Default
33  patches | The patches on which to sample | yes |
34  points | The points to sample | yes |
35  maxDistance | The maximum distance from patch to point | yes |
36  axis | The coordinate axis that is written | yes |
37  \endtable
38 
39  Example specification:
40  \verbatim
41  {
42  type boundaryPoints;
43  patches (inlet1 inlet2);
44  points
45  (
46  (0 -0.05 0.05)
47  (0 -0.05 0.15)
48  (0 0.05 0.15)
49  (0 0.05 0.05)
50  );
51  maxDistance 0.01;
52  axis x;
53  }
54  \endverbatim
55 
56 SourceFiles
57  boundaryPoints.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef boundaryPoints_H
62 #define boundaryPoints_H
63 
64 #include "sampledSet.H"
65 #include "DynamicList.H"
66 #include "HashSet.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace sampledSets
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class boundaryPoints Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class boundaryPoints
80 :
81  public sampledSet
82 {
83  // Private data
84 
85  //- Sampling points
86  const List<point> points_;
87 
88  //- Patches to sample
89  const labelHashSet patches_;
90 
91  //- Maximum distance to to search for a nearby patch
92  const scalar maxDistance_;
93 
94 
95  // Private Member Functions
96 
97  //- Samples all points in sampleCoords
98  void calcSamples
99  (
100  DynamicList<point>& samplingPts,
101  DynamicList<label>& samplingCells,
102  DynamicList<label>& samplingFaces,
103  DynamicList<label>& samplingSegments,
104  DynamicList<scalar>& samplingCurveDist
105  ) const;
106 
107  //- Uses calcSamples to obtain samples. Copies them into *this.
108  void genSamples();
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("boundaryPoints");
115 
116 
117  // Constructors
118 
119  //- Construct from dictionary
121  (
122  const word& name,
123  const polyMesh& mesh,
124  const meshSearch& searchEngine,
125  const dictionary& dict
126  );
127 
128 
129  //- Destructor
130  virtual ~boundaryPoints();
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace sampledSets
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
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
boundaryPoints(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
TypeName("boundaryPoints")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:210
A class for handling words, derived from string.
Definition: word.H:59
virtual ~boundaryPoints()
Destructor.
const word & name() const
Definition: coordSet.H:111
const meshSearch & searchEngine() const
Definition: sampledSet.H:199
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.