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-2021 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>& samplingPositions,
87  DynamicList<label>& samplingSegments,
88  DynamicList<label>& samplingCells,
89  DynamicList<label>& samplingFaces
90  ) const;
91 
92  //- Uses calcSamples to obtain samples. Copies them into *this.
93  void genSamples();
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("triSurfaceMesh");
100 
101 
102  // Constructors
103 
104  //- Construct from dictionary
106  (
107  const word& name,
108  const polyMesh& mesh,
109  const meshSearch& searchEngine,
110  const dictionary& dict
111  );
112 
113 
114  //- Destructor
115  virtual ~triSurfaceMeshSampledSet();
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace sampledSets
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:78
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:58
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
const meshSearch & searchEngine() const
Access the search engine.
Definition: sampledSet.H:216
const word & name() const
Access the name.
Definition: sampledSet.H:204
const polyMesh & mesh() const
Access the mesh.
Definition: sampledSet.H:210
triSurfaceMeshSampledSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
TypeName("triSurfaceMesh")
Runtime type information.
Set of sets to sample. Call sampledSets.write() to sample&write files.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict