lineFace.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::lineFace
26 
27 Description
28  Face-intersections along a line
29 
30 Usage
31  \table
32  Property | Description | Req'd? | Default
33  start | The start point of the line | yes |
34  end | The end point of the line | yes |
35  axis | The coordinate axis that is written | yes |
36  \endtable
37 
38  Example specification:
39  \verbatim
40  {
41  type lineFace;
42  start (0.6 0.6 0.5);
43  end (0.6 -0.3 -0.1);
44  axis x;
45  }
46  \endverbatim
47 
48 SourceFiles
49  lineFace.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef lineFace_H
54 #define lineFace_H
55 
56 #include "sampledSet.H"
57 #include "DynamicList.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace sampledSets
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class lineFace Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 class lineFace
71 :
72  public sampledSet
73 {
74  // Private Data
75 
76  //- Start point
77  const point start_;
78 
79  //- End point
80  const point end_;
81 
82 
83  // Protected Member Functions
84 
85  //- Calculate all the sampling points
86  virtual bool calcSamples
87  (
88  DynamicList<point>& samplingPositions,
89  DynamicList<scalar>& samplingDistances,
90  DynamicList<label>& samplingSegments,
91  DynamicList<label>& samplingCells,
92  DynamicList<label>& samplingFaces
93  ) const;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("lineFace");
100 
101 
102  // Static Member Functions
103 
104  //- Calculate all the sampling points
105  static void calcSamples
106  (
107  const polyMesh& mesh,
108  const vector& start,
109  const vector& end,
110  const label storeFaces,
111  const bool storeCells,
112  DynamicList<point>& samplingPositions,
113  DynamicList<scalar>& samplingDistances,
114  DynamicList<label>& samplingSegments,
115  DynamicList<label>& samplingCells,
116  DynamicList<label>& samplingFaces
117  );
118 
119 
120  // Constructors
121 
122  //- Construct from dictionary
123  lineFace
124  (
125  const word& name,
126  const polyMesh& mesh,
127  const dictionary& dict
128  );
129 
130 
131  //- Destructor
132  virtual ~lineFace();
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace sampledSets
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
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
lineFace(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Definition: lineFace.C:310
virtual ~lineFace()
Destructor.
Definition: lineFace.C:324
TypeName("lineFace")
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:63
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
vector point
Point is a vector.
Definition: point.H:41
dictionary dict