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-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::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 #include "passiveParticleCloud.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 namespace sampledSets
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class lineFace Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 class lineFace
72 :
73  public sampledSet
74 {
75  // Private Data
76 
77  //- Start point
78  const point start_;
79 
80  //- End point
81  const point end_;
82 
83 
84  // Protected Member Functions
85 
86  //- Calculate all the sampling points
87  void calcSamples
88  (
89  DynamicList<point>& samplingPts,
90  DynamicList<label>& samplingCells,
91  DynamicList<label>& samplingFaces,
92  DynamicList<label>& samplingSegments,
93  DynamicList<scalar>& samplingCurveDist
94  ) const;
95 
96  //- Uses calcSamples to obtain samples and copies them into *this
97  void genSamples();
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("lineFace");
104 
105 
106  // Static Member Functions
107 
108  //- Calculate all the sampling points
109  static void calcSamples
110  (
111  const polyMesh& mesh,
112  const meshSearch& searchEngine,
113  const vector& start,
114  const vector& end,
115  DynamicList<point>& samplingPts,
116  DynamicList<label>& samplingCells,
117  DynamicList<label>& samplingFaces,
118  DynamicList<label>& samplingSegments,
119  DynamicList<scalar>& samplingCurveDist
120  );
121 
122 
123  // Constructors
124 
125  //- Construct from dictionary
126  lineFace
127  (
128  const word& name,
129  const polyMesh& mesh,
130  const meshSearch& searchEngine,
131  const dictionary& dict
132  );
133 
134 
135  //- Destructor
136  virtual ~lineFace();
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace sampledSets
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
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
TypeName("lineFace")
Runtime type information.
virtual ~lineFace()
Destructor.
Definition: lineFace.C:303
iterator end()
Return an iterator to end traversing the UList.
Definition: UListI.H:224
A class for handling words, derived from string.
Definition: word.H:59
const word & name() const
Definition: coordSet.H:111
vector point
Point is a vector.
Definition: point.H:41
const meshSearch & searchEngine() const
Definition: sampledSet.H:199
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
lineFace(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: lineFace.C:281
Namespace for OpenFOAM.