patchCloudSet.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2012 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::patchCloudSet
28 
29 Description
30  Like Foam::cloudSet but samples nearest patch face
31 
32  For a dictionary specification:
33  \table
34  Property | Description | Required | Default
35  type | patchCloud | yes |
36  axis | x, y, z, xyz, distance | yes |
37  patches | List of patch names or regexs | yes |
38  points | List of selected locations | yes |
39  maxDistance | Max search distance | yes |
40  \endtable
41 
42 SourceFiles
43  patchCloudSet.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef patchCloudSet_H
48 #define patchCloudSet_H
49 
50 #include "sampledSet.H"
51 #include "DynamicList.H"
52 #include "HashSet.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class patchCloudSet Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class patchCloudSet
64 :
65  public sampledSet
66 {
67  // Private data
68 
69  //- Sampling points
70  const pointField sampleCoords_;
71 
72  //- Patches to sample
73  const labelHashSet patchSet_;
74 
75  //- Maximum distance to look for nearest
76  const scalar searchDist_;
77 
78 
79  // Private Member Functions
80 
81  //- Samples all points in sampleCoords.
82  void calcSamples
83  (
84  DynamicList<point>& samplingPts,
85  DynamicList<label>& samplingCells,
86  DynamicList<label>& samplingFaces,
87  DynamicList<label>& samplingSegments,
88  DynamicList<scalar>& samplingCurveDist
89  ) const;
90 
91  //- Uses calcSamples to obtain samples. Copies them into *this.
92  void genSamples();
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("patchCloud");
99 
100 
101  // Constructors
102 
103  //- Construct from components
105  (
106  const word& name,
107  const polyMesh& mesh,
108  const meshSearch& searchEngine,
109  const word& axis,
110  const List<point>& sampleCoords,
111  const labelHashSet& patchSet,
112  const scalar searchDist
113  );
114 
115  //- Construct from dictionary
117  (
118  const word& name,
119  const polyMesh& mesh,
120  const meshSearch& searchEngine,
121  const dictionary& dict
122  );
123 
124 
125  //- Destructor
126  virtual ~patchCloudSet() = default;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
Foam::sampledSet
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:83
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Foam::coordSet::name
const word & name() const
Definition: coordSet.H:125
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::meshSearch
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:60
Foam::DynamicList< point >
Foam::sampledSet::searchEngine
const meshSearch & searchEngine() const
Definition: sampledSet.H:286
Foam::patchCloudSet::TypeName
TypeName("patchCloud")
Runtime type information.
Foam::HashSet< label, Hash< label > >
Foam::coordSet::axis
word axis() const
Definition: coordSet.H:130
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::patchCloudSet::patchCloudSet
patchCloudSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const List< point > &sampleCoords, const labelHashSet &patchSet, const scalar searchDist)
Construct from components.
Definition: patchCloudSet.C:267
sampledSet.H
Foam::Field< vector >
Foam::patchCloudSet::~patchCloudSet
virtual ~patchCloudSet()=default
Destructor.
HashSet.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::sampledSet::mesh
const polyMesh & mesh() const
Definition: sampledSet.H:281
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::patchCloudSet
Like Foam::cloudSet but samples nearest patch face.
Definition: patchCloudSet.H:92
DynamicList.H
Foam::labelHashSet
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition: HashSet.H:85