All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2019 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>& samplingPts,
88  DynamicList<label>& samplingCells,
89  DynamicList<label>& samplingFaces,
90  DynamicList<label>& samplingSegments,
91  DynamicList<scalar>& samplingCurveDist
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  // Static Member Functions
105 
106  //- Calculate the next mid point sample
107  static void calcMidPointSample
108  (
109  const polyMesh& mesh,
110  const point& prevPt,
111  const label prevFace,
112  const label prevSegment,
113  const scalar prevCurveDist,
114  const point& nextPt,
115  const label nextFace,
116  const label nextSegment,
117  DynamicList<point>& samplingPts,
118  DynamicList<label>& samplingCells,
119  DynamicList<label>& samplingFaces,
120  DynamicList<label>& samplingSegments,
121  DynamicList<scalar>& samplingCurveDist
122  );
123 
124 
125  // Constructors
126 
127  //- Construct from dictionary
128  lineCell
129  (
130  const word& name,
131  const polyMesh& mesh,
132  const meshSearch& searchEngine,
133  const dictionary& dict
134  );
135 
136 
137  //- Destructor
138  virtual ~lineCell();
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace sampledSets
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
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
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A class for handling words, derived from string.
Definition: word.H:59
lineCell(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Definition: lineCell.C:194
static void calcMidPointSample(const polyMesh &mesh, const point &prevPt, const label prevFace, const label prevSegment, const scalar prevCurveDist, const point &nextPt, const label nextFace, const label nextSegment, DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< label > &samplingSegments, DynamicList< scalar > &samplingCurveDist)
Calculate the next mid point sample.
Definition: lineCell.C:47
virtual ~lineCell()
Destructor.
Definition: lineCell.C:216
TypeName("lineCell")
Runtime type information.
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
Namespace for OpenFOAM.