faceOnlySet.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::faceOnlySet
28 
29 Description
30  Sample on faces along a specified path
31 
32  For a dictionary specification:
33  \table
34  Property | Description | Required | Default
35  type | face | yes |
36  axis | x, y, z, xyz, distance | yes |
37  start | The start point | yes |
38  end | The end point | yes |
39  \endtable
40 
41 SourceFiles
42  faceOnlySet.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef faceOnlySet_H
47 #define faceOnlySet_H
48 
49 #include "sampledSet.H"
50 #include "DynamicList.H"
51 #include "passiveParticleCloud.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class faceOnlySet Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class faceOnlySet
63 :
64  public sampledSet
65 {
66  // Private data
67 
68  //- Starting point
69  point start_;
70 
71  //- End point
72  point end_;
73 
74 
75  // Private Member Functions
76 
77  //- Samples from startTrackPt/Celli. Updates particle/samplePt/sampleI
78  // and puts
79  // samples in the DynamicLists. Returns false if end of all samples
80  // reached
81  bool trackToBoundary
82  (
83  passiveParticleCloud& particleCloud,
84  passiveParticle& singleParticle,
85  const scalar smallDist,
86  DynamicList<point>& samplingPts,
87  DynamicList<label>& samplingCells,
88  DynamicList<label>& samplingFaces,
89  DynamicList<scalar>& samplingCurve
90  ) const;
91 
92  //- Samples from start_ to end_. samplingSegments contains segmentNo
93  // for each sample.
94  void calcSamples
95  (
96  DynamicList<point>& samplingPts,
97  DynamicList<label>& samplingCells,
98  DynamicList<label>& samplingFaces,
99  DynamicList<label>& samplingSegments,
100  DynamicList<scalar>& samplingCurveDist
101  ) const;
102 
103  //- Uses calcSamples to obtain samples. Copies them into *this.
104  void genSamples();
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("face");
111 
112 
113  // Static data
114 
115  //- Tolerance when comparing points relative to difference between
116  // start_ and end_
117  static const scalar tol;
118 
119 
120  // Constructors
121 
122  //- Construct from components
124  (
125  const word& name,
126  const polyMesh& mesh,
127  const meshSearch& searchEngine,
128  const word& axis,
129  const point& start,
130  const point& end
131  );
132 
133  //- Construct from dictionary
135  (
136  const word& name,
137  const polyMesh& mesh,
138  const meshSearch& searchEngine,
139  const dictionary& dict
140  );
141 
142 
143  //- Destructor
144  virtual ~faceOnlySet() = default;
145 
146 
147  // Member Functions
148 
149  const point& start() const
150  {
151  return start_;
152  }
153 
154  const point& end() const
155  {
156  return end_;
157  }
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
Foam::sampledSet
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:83
Foam::coordSet::name
const word & name() const
Definition: coordSet.H:125
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::meshSearch
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:60
Foam::DynamicList< point >
Foam::sampledSet::searchEngine
const meshSearch & searchEngine() const
Definition: sampledSet.H:286
Foam::faceOnlySet::start
const point & start() const
Definition: faceOnlySet.H:173
Foam::passiveParticle
Copy of base particle.
Definition: passiveParticle.H:53
Foam::faceOnlySet::faceOnlySet
faceOnlySet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const point &start, const point &end)
Construct from components.
Definition: faceOnlySet.C:339
Foam::coordSet::axis
word axis() const
Definition: coordSet.H:130
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::faceOnlySet::tol
static const scalar tol
Tolerance when comparing points relative to difference between.
Definition: faceOnlySet.H:141
Foam::faceOnlySet::TypeName
TypeName("face")
Runtime type information.
sampledSet.H
Foam::faceOnlySet
Sample on faces along a specified path.
Definition: faceOnlySet.H:86
Foam::passiveParticleCloud
A Cloud of passive particles.
Definition: passiveParticleCloud.H:52
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faceOnlySet::~faceOnlySet
virtual ~faceOnlySet()=default
Destructor.
Foam::sampledSet::mesh
const polyMesh & mesh() const
Definition: sampledSet.H:281
passiveParticleCloud.H
Foam::Vector< scalar >
Foam::faceOnlySet::end
const point & end() const
Definition: faceOnlySet.H:178
DynamicList.H
Foam::point
vector point
Point is a vector.
Definition: point.H:43