triSurfaceMeshPointSet.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) 2011-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::triSurfaceMeshPointSet
26 
27 Description
28  sampleSet from all points of a triSurfaceMesh.
29 
30 SourceFiles
31  triSurfaceMeshPointSet.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef triSurfaceMeshPointSet_H
36 #define triSurfaceMeshPointSet_H
37 
38 #include "sampledSet.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Forward declaration of classes
46 
47 /*---------------------------------------------------------------------------*\
48  Class triSurfaceMeshPointSet Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public sampledSet
54 {
55  // Private data
56 
57  //- Name of triSurfaceMesh
58  const word surface_;
59 
60  //- Sampling points
61  List<point> sampleCoords_;
62 
63 
64  // Private Member Functions
65 
66  //- Samples all points in sampleCoords.
67  void calcSamples
68  (
69  DynamicList<point>& samplingPts,
70  DynamicList<label>& samplingCells,
71  DynamicList<label>& samplingFaces,
72  DynamicList<label>& samplingSegments,
73  DynamicList<scalar>& samplingCurveDist
74  ) const;
75 
76  //- Uses calcSamples to obtain samples. Copies them into *this.
77  void genSamples();
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("triSurfaceMeshPointSet");
84 
85 
86  // Constructors
87 
88  //- Construct from dictionary
90  (
91  const word& name,
92  const polyMesh& mesh,
93  const meshSearch& searchEngine,
94  const dictionary& dict
95  );
96 
97 
98  //- Destructor
99  virtual ~triSurfaceMeshPointSet();
100 
101 
102  // Member Functions
103 
104  //- Get reference point
105  virtual point getRefPoint(const List<point>&) const;
106 };
107 
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #endif
116 
117 // ************************************************************************* //
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:241
TypeName("triSurfaceMeshPointSet")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:60
virtual ~triSurfaceMeshPointSet()
Destructor.
sampleSet from all points of a triSurfaceMesh.
virtual point getRefPoint(const List< point > &) const
Get reference point.
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
triSurfaceMeshPointSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
const word & name() const
Definition: coordSet.H:111
const meshSearch & searchEngine() const
Definition: sampledSet.H:246
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.