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-2014 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 number of patch faces to seed (if in random subset mode)
62  const label maxPoints_;
63 
64  //- Random number generator (if maxPoints < num patch faces)
66 
67  //- Patch faces to seed selected based on nearness to supplied points
69 
70 
71  // Private Member Functions
72 
73  //- Samples all points in sampleCoords.
74  void calcSamples
75  (
76  DynamicList<point>& samplingPts,
77  DynamicList<label>& samplingCells,
78  DynamicList<label>& samplingFaces,
79  DynamicList<label>& samplingSegments,
80  DynamicList<scalar>& samplingCurveDist
81  );
82 
83  //- Uses calcSamples to obtain samples. Copies them into *this.
84  void genSamples();
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("patchSeed");
91 
92 
93  // Constructors
94 
95  //- Construct from dictionary
97  (
98  const word& name,
99  const polyMesh& mesh,
100  const meshSearch& searchEngine,
101  const dictionary& dict
102  );
103 
104 
105  //- Destructor
106  virtual ~patchSeedSet();
107 };
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace Foam
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 #endif
117 
118 // ************************************************************************* //
Foam::sampledSet
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:64
Foam::patchSeedSet::selectedLocations_
const pointField selectedLocations_
Patch faces to seed selected based on nearness to supplied points.
Definition: patchSeedSet.H:67
Foam::coordSet::name
const word & name() const
Definition: coordSet.H:111
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::meshSearch
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:57
Foam::patchSeedSet
Initialises points on or just off patch.
Definition: patchSeedSet.H:51
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:56
Foam::sampledSet::searchEngine
const meshSearch & searchEngine() const
Definition: sampledSet.H:253
Foam::patchSeedSet::patchSeedSet
patchSeedSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: patchSeedSet.C:333
Foam::patchSeedSet::TypeName
TypeName("patchSeed")
Runtime type information.
Foam::HashSet< label, Hash< label > >
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
sampledSet.H
Foam::label
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
Foam::patchSeedSet::maxPoints_
const label maxPoints_
Maximum number of patch faces to seed (if in random subset mode)
Definition: patchSeedSet.H:61
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
HashSet.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::patchSeedSet::genSamples
void genSamples()
Uses calcSamples to obtain samples. Copies them into *this.
Definition: patchSeedSet.C:295
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Random.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::patchSeedSet::~patchSeedSet
virtual ~patchSeedSet()
Destructor.
Definition: patchSeedSet.C:369
Foam::sampledSet::mesh
const polyMesh & mesh() const
Definition: sampledSet.H:248
Foam::patchSeedSet::patchSet_
const labelHashSet patchSet_
Patches to sample.
Definition: patchSeedSet.H:58
DynamicList.H
Foam::patchSeedSet::calcSamples
void calcSamples(DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< label > &samplingSegments, DynamicList< scalar > &samplingCurveDist)
Samples all points in sampleCoords.
Definition: patchSeedSet.C:48
Foam::patchSeedSet::rndGenPtr_
autoPtr< Random > rndGenPtr_
Random number generator (if maxPoints < num patch faces)
Definition: patchSeedSet.H:64