All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
triSurfaceMeshSampledSet.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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::sampledSets::triSurfaceMeshSampledSet
26 
27 Description
28  Samples from all the points of a triSurfaceMesh. Surface files are read
29  from constant/triSurface.
30 
31 Usage
32  \table
33  Property | Description | Req'd? | Default
34  surface | The surface file name | yes |
35  axis | The coordinate axis that is written | yes |
36  \endtable
37 
38  Example specification:
39  \verbatim
40  {
41  type triSurfaceMesh;
42  surface "surface.stl";
43  axis x;
44  }
45  \endverbatim
46 
47 SourceFiles
48  triSurfaceMeshSampledSet.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef triSurfaceMeshSampledSet_H
53 #define triSurfaceMeshSampledSet_H
54 
55 #include "sampledSet.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 namespace sampledSets
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class triSurfaceMeshSampledSet Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class triSurfaceMeshSampledSet
69 :
70  public sampledSet
71 {
72  // Private Data
73 
74  //- Name of triSurfaceMesh
75  const word surface_;
76 
77  //- Sampling points
78  const List<point> points_;
79 
80 
81  // Private Member Functions
82 
83  //- Samples all points in sampleCoords.
84  void calcSamples
85  (
86  DynamicList<point>& samplingPts,
87  DynamicList<label>& samplingCells,
88  DynamicList<label>& samplingFaces,
89  DynamicList<label>& samplingSegments,
90  DynamicList<scalar>& samplingCurveDist
91  ) const;
92 
93  //- Uses calcSamples to obtain samples. Copies them into *this.
94  void genSamples();
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("triSurfaceMesh");
101 
102 
103  // Constructors
104 
105  //- Construct from dictionary
107  (
108  const word& name,
109  const polyMesh& mesh,
110  const meshSearch& searchEngine,
111  const dictionary& dict
112  );
113 
114 
115  //- Destructor
116  virtual ~triSurfaceMeshSampledSet();
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace sampledSets
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
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:194
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
A class for handling words, derived from string.
Definition: word.H:59
const word & name() const
Definition: coordSet.H:111
TypeName("triSurfaceMesh")
Runtime type information.
triSurfaceMeshSampledSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
const meshSearch & searchEngine() const
Definition: sampledSet.H:199
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.