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-2021 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 wordReList 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>& samplingPositions,
101  DynamicList<label>& samplingSegments,
102  DynamicList<label>& samplingCells,
103  DynamicList<label>& samplingFaces
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("boundaryPoints");
114 
115 
116  // Constructors
117 
118  //- Construct from dictionary
120  (
121  const word& name,
122  const polyMesh& mesh,
123  const meshSearch& searchEngine,
124  const dictionary& dict
125  );
126 
127 
128  //- Destructor
129  virtual ~boundaryPoints();
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace sampledSets
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
Definition: meshSearch.H:57
dictionary dict
const polyMesh & mesh() const
Access the mesh.
Definition: sampledSet.H:210
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:156
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
A class for handling words, derived from string.
Definition: word.H:59
virtual ~boundaryPoints()
Destructor.
const word & name() const
Access the name.
Definition: sampledSet.H:204
const meshSearch & searchEngine() const
Access the search engine.
Definition: sampledSet.H:216
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
List< wordRe > wordReList
A List of wordRe (word or regular expression)
Definition: wordReList.H:50
Namespace for OpenFOAM.