patchSeedSet.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) 2012 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::patchSeedSet
26 
27 Description
28  Initialises points on or just off patch
29 
30 SourceFiles
31  patchSeedSet.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef patchSeedSet_H
36 #define patchSeedSet_H
37 
38 #include "sampledSet.H"
39 #include "DynamicList.H"
40 #include "HashSet.H"
41 #include "Random.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class patchSeedSet Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class patchSeedSet
53 :
54  public sampledSet
55 {
56  // Private data
57 
58  //- Patches to sample
59  const labelHashSet patchSet_;
60 
61 // //- Maximum distance to look for nearest
62 // const scalar searchDist_;
63 //
64 // //- Offset distance
65 // const scalar offsetDist_;
66 
67  //- Maximum number of patch faces to seed
68  const label maxPoints_;
69 
70  //- Random number generator (if maxPoints < num patch faces)
71  autoPtr<Random> rndGenPtr_;
72 
73 
74  // Private Member Functions
75 
76  //- Samples all points in sampleCoords.
77  void calcSamples
78  (
79  DynamicList<point>& samplingPts,
80  DynamicList<label>& samplingCells,
81  DynamicList<label>& samplingFaces,
82  DynamicList<label>& samplingSegments,
83  DynamicList<scalar>& samplingCurveDist
84  );
85 
86  //- Uses calcSamples to obtain samples. Copies them into *this.
87  void genSamples();
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("patchSeed");
94 
95 
96  // Constructors
97 
98  //- Construct from dictionary
100  (
101  const word& name,
102  const polyMesh& mesh,
103  const meshSearch& searchEngine,
104  const dictionary& dict
105  );
106 
107 
108  //- Destructor
109  virtual ~patchSeedSet();
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
Definition: meshSearch.H:57
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Initialises points on or just off patch.
Definition: patchSeedSet.H:51
patchSeedSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: patchSeedSet.C:205
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
virtual ~patchSeedSet()
Destructor.
Definition: patchSeedSet.C:235
TypeName("patchSeed")
Runtime type information.
const polyMesh & mesh() const
Definition: sampledSet.H:241
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
const meshSearch & searchEngine() const
Definition: sampledSet.H:246
Namespace for OpenFOAM.