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 | Copyright (C) 2011-2014 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::faceOnlySet
26 
27 Description
28 
29 SourceFiles
30  faceOnlySet.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef faceOnlySet_H
35 #define faceOnlySet_H
36 
37 #include "sampledSet.H"
38 #include "DynamicList.H"
39 #include "passiveParticleCloud.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class faceOnlySet Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class faceOnlySet
51 :
52  public sampledSet
53 {
54  // Private data
55 
56  //- Starting point
57  point start_;
58 
59  //- End point
60  point end_;
61 
62 
63  // Private Member Functions
64 
65  //- Samples from startTrackPt/CellI. Updates particle/samplePt/sampleI
66  // and puts
67  // samples in the DynamicLists. Returns false if end of all samples
68  // reached
69  bool trackToBoundary
70  (
71  passiveParticleCloud& particleCloud,
72  passiveParticle& singleParticle,
73  DynamicList<point>& samplingPts,
74  DynamicList<label>& samplingCells,
75  DynamicList<label>& samplingFaces,
76  DynamicList<scalar>& samplingCurve
77  ) const;
78 
79  //- Samples from start_ to end_. samplingSegments contains segmentNo
80  // for each sample.
81  void calcSamples
82  (
83  DynamicList<point>& samplingPts,
84  DynamicList<label>& samplingCells,
85  DynamicList<label>& samplingFaces,
86  DynamicList<label>& samplingSegments,
87  DynamicList<scalar>& samplingCurveDist
88  ) const;
89 
90  //- Uses calcSamples to obtain samples. Copies them into *this.
91  void genSamples();
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("face");
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  const word& name,
105  const polyMesh& mesh,
106  const meshSearch& searchEngine,
107  const word& axis,
108  const point& start,
109  const point& end
110  );
111 
112  //- Construct from dictionary
114  (
115  const word& name,
116  const polyMesh& mesh,
117  const meshSearch& searchEngine,
118  const dictionary& dict
119  );
120 
121 
122  //- Destructor
123  virtual ~faceOnlySet();
124 
125 
126  // Member Functions
127 
128  const point& start() const
129  {
130  return start_;
131  }
132 
133  const point& end() const
134  {
135  return end_;
136  }
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
Foam::sampledSet
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:64
Foam::coordSet::name
const word & name() const
Definition: coordSet.H:111
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::meshSearch
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:57
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:56
Foam::faceOnlySet::end_
point end_
End point.
Definition: faceOnlySet.H:59
Foam::sampledSet::searchEngine
const meshSearch & searchEngine() const
Definition: sampledSet.H:253
Foam::faceOnlySet::start
const point & start() const
Definition: faceOnlySet.H:127
Foam::passiveParticle
Copy of base particle.
Definition: passiveParticle.H:50
Foam::faceOnlySet::trackToBoundary
bool trackToBoundary(passiveParticleCloud &particleCloud, passiveParticle &singleParticle, DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< scalar > &samplingCurve) const
Samples from startTrackPt/CellI. Updates particle/samplePt/sampleI.
Definition: faceOnlySet.C:45
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:336
Foam::coordSet::axis
word axis() const
Definition: coordSet.H:116
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::faceOnlySet::TypeName
TypeName("face")
Runtime type information.
sampledSet.H
Foam::faceOnlySet
Definition: faceOnlySet.H:49
Foam::passiveParticleCloud
A Cloud of passive particles.
Definition: passiveParticleCloud.H:49
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::faceOnlySet::calcSamples
void calcSamples(DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< label > &samplingSegments, DynamicList< scalar > &samplingCurveDist) const
Samples from start_ to end_. samplingSegments contains segmentNo.
Definition: faceOnlySet.C:94
Foam::sampledSet::mesh
const polyMesh & mesh() const
Definition: sampledSet.H:248
Foam::faceOnlySet::start_
point start_
Starting point.
Definition: faceOnlySet.H:56
passiveParticleCloud.H
Foam::Vector< scalar >
Foam::faceOnlySet::end
const point & end() const
Definition: faceOnlySet.H:132
Foam::faceOnlySet::genSamples
void genSamples()
Uses calcSamples to obtain samples. Copies them into *this.
Definition: faceOnlySet.C:297
Foam::faceOnlySet::~faceOnlySet
virtual ~faceOnlySet()
Destructor.
Definition: faceOnlySet.C:381
DynamicList.H