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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::faceOnlySet
28
29Description
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
41SourceFiles
42 faceOnlySet.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef faceOnlySet_H
47#define faceOnlySet_H
48
49#include "sampledSet.H"
50#include "DynamicList.H"
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55namespace Foam
56{
57
58/*---------------------------------------------------------------------------*\
59 Class faceOnlySet Declaration
60\*---------------------------------------------------------------------------*/
61
62class 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
107public:
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,
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,
139 const dictionary& dict
140 );
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
169// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
const word & axis() const
The sort axis name.
Definition: coordSet.H:140
const word & name() const noexcept
The coord-set name.
Definition: coordSet.H:134
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Sample on faces along a specified path.
Definition: faceOnlySet.H:89
const point & start() const
Definition: faceOnlySet.H:173
const point & end() const
Definition: faceOnlySet.H:178
static const scalar tol
Tolerance when comparing points relative to difference between.
Definition: faceOnlySet.H:141
virtual ~faceOnlySet()=default
Destructor.
TypeName("face")
Runtime type information.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:61
A Cloud of passive particles.
Copy of base particle.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:86
const meshSearch & searchEngine() const noexcept
Definition: sampledSet.H:324
const polyMesh & mesh() const noexcept
Definition: sampledSet.H:319
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
vector point
Point is a vector.
Definition: point.H:43
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73