lineCell.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::lineCell
26 
27 Description
28  Cell-samples along a line at the mid-points in-between face-intersections
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 lineCell;
42  start (0.5 0.6 0.5);
43  end (0.5 -0.3 -0.1);
44  axis x;
45  }
46  \endverbatim
47 
48 SourceFiles
49  lineCell.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef lineCell_H
54 #define lineCell_H
55 
56 #include "lineFace.H"
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 namespace sampledSets
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class lineCell Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 class lineCell
70 :
71  public sampledSet
72 {
73  // Private Data
74 
75  //- Start point
76  const point start_;
77 
78  //- End point
79  const point end_;
80 
81 
82  // Private Member Functions
83 
84  //- Calculate all the sampling points
85  virtual void calcSamples
86  (
87  DynamicList<point>& samplingPositions,
88  DynamicList<scalar>& samplingDistances,
89  DynamicList<label>& samplingSegments,
90  DynamicList<label>& samplingCells,
91  DynamicList<label>& samplingFaces
92  ) const;
93 
94  //- Uses calcSamples to obtain samples and copies them into *this
95  void genSamples();
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("lineCell");
102 
103 
104  // Constructors
105 
106  //- Construct from dictionary
107  lineCell
108  (
109  const word& name,
110  const polyMesh& mesh,
111  const meshSearch& searchEngine,
112  const dictionary& dict
113  );
114 
115 
116  //- Destructor
117  virtual ~lineCell();
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace sampledSets
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
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
virtual ~lineCell()
Destructor.
Definition: lineCell.C:126
lineCell(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: lineCell.C:109
TypeName("lineCell")
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.
vector point
Point is a vector.
Definition: point.H:41
dictionary dict