triSurfaceSampledSet.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-2025 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::triSurface
26 
27 Description
28  Samples from all the points of a triSurface. 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 triSurface;
42  surface "surface.stl";
43  axis x;
44  }
45  \endverbatim
46 
47 SourceFiles
48  triSurface.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef triSurfaceSampledSet_H
53 #define triSurfaceSampledSet_H
54 
55 #include "sampledSet.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 namespace sampledSets
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class triSurface Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class triSurface
69 :
70  public sampledSet
71 {
72  // Private Data
73 
74  //- Name of triSurface
75  const word surface_;
76 
77  //- Sampling points
78  const List<point> points_;
79 
80 
81  // Private Member Functions
82 
83  //- Calculate all the sampling points
84  virtual bool calcSamples
85  (
86  DynamicList<point>& samplingPositions,
88  DynamicList<label>& samplingSegments,
89  DynamicList<label>& samplingCells,
90  DynamicList<label>& samplingFaces
91  ) const;
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("triSurface");
98 
99 
100  // Constructors
101 
102  //- Construct from dictionary
103  triSurface
104  (
105  const word& name,
106  const polyMesh& mesh,
107  const dictionary& dict
108  );
109 
110 
111  //- Destructor
112  virtual ~triSurface();
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace sampledSets
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
const polyMesh & mesh() const
Access the mesh.
Definition: sampledSetI.H:36
const word & name() const
Access the name.
Definition: sampledSetI.H:30
triSurface(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
TypeName("triSurface")
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