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 | 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::triSurfaceMeshPointSet
28 
29 Description
30  A sampleSet from all points of a triSurfaceMesh.
31 
32  For a dictionary specification:
33  \table
34  Property | Description | Required | Default
35  type | triSurfaceMeshPointSet | yes |
36  axis | x, y, z, xyz, distance | yes |
37  surface | The surface name | yes |
38  \endtable
39 
40 SourceFiles
41  triSurfaceMeshPointSet.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef triSurfaceMeshPointSet_H
46 #define triSurfaceMeshPointSet_H
47 
48 #include "sampledSet.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class triSurfaceMeshPointSet Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class triSurfaceMeshPointSet
60 :
61  public sampledSet
62 {
63  // Private Data
64 
65  //- The surface name
66  const word surfaceName_;
67 
68  //- Sampling points
69  List<point> sampleCoords_;
70 
71 
72  // Private Member Functions
73 
74  //- Samples all points in sampleCoords.
75  void calcSamples
76  (
77  DynamicList<point>& samplingPts,
78  DynamicList<label>& samplingCells,
79  DynamicList<label>& samplingFaces,
80  DynamicList<label>& samplingSegments,
81  DynamicList<scalar>& samplingCurveDist
82  ) const;
83 
84  //- Uses calcSamples to obtain samples. Copies them into *this.
85  void genSamples();
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("triSurfaceMeshPointSet");
92 
93 
94  // Constructors
95 
96  //- Construct from dictionary
98  (
99  const word& name,
100  const polyMesh& mesh,
101  const meshSearch& searchEngine,
102  const dictionary& dict
103  );
104 
105 
106  //- Destructor
107  virtual ~triSurfaceMeshPointSet() = default;
108 
109 
110  // Member Functions
111 
112  //- Get reference point
113  virtual point getRefPoint(const List<point>& pts) const;
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
Foam::sampledSet
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:83
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::triSurfaceMeshPointSet::triSurfaceMeshPointSet
triSurfaceMeshPointSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: triSurfaceMeshPointSet.C:117
Foam::triSurfaceMeshPointSet::~triSurfaceMeshPointSet
virtual ~triSurfaceMeshPointSet()=default
Destructor.
Foam::triSurfaceMeshPointSet::getRefPoint
virtual point getRefPoint(const List< point > &pts) const
Get reference point.
Definition: triSurfaceMeshPointSet.C:163
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
sampledSet.H
Foam::triSurfaceMeshPointSet::TypeName
TypeName("triSurfaceMeshPointSet")
Runtime type information.
Foam::triSurfaceMeshPointSet
A sampleSet from all points of a triSurfaceMesh.
Definition: triSurfaceMeshPointSet.H:78
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::Vector< scalar >
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