polyLineSet.H 3.95 KB
Newer Older
1
2
3
4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
5
    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
6
7
8
9
10
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

11
12
13
14
    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
15
16
17
18
19
20
21

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    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::polyLineSet
26
27

Description
28
    Sample along poly line defined by a list of points (knots)
29
30

SourceFiles
31
    polyLineSet.C
32
33
34

\*---------------------------------------------------------------------------*/

35
36
#ifndef polyLineSet_H
#define polyLineSet_H
37

38
39
#include "sampledSet.H"
#include "DynamicList.H"
40
#include "passiveParticleCloud.H"
41
42
43
44
45
46
47

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/*---------------------------------------------------------------------------*\
48
                        Class polyLineSet Declaration
49
50
\*---------------------------------------------------------------------------*/

51
class polyLineSet
52
:
53
    public sampledSet
54
{
55
    // Private data
56

57
        //- Sampling points
58
        List<point> sampleCoords_;
59
60


61
    // Private Member Functions
62

63
64
65
66
        //- Sample till hits boundary. Called with singleParticle at position
        //  inbetween sampleCoords_[sampleI] and sampleCoords_[sampleI+1].
        //  Returns false if end of samples reached.
        bool trackToBoundary
67
        (
68
            passiveParticleCloud& particleCloud,
69
            passiveParticle& singleParticle,
70
71
72
73
            label& sampleI,
            DynamicList<point>& samplingPts,
            DynamicList<label>& samplingCells,
            DynamicList<label>& samplingFaces,
74
            DynamicList<scalar>& samplingCurveDist
75
76
        ) const;

77
78
79
        //- Samples all point in sampleCoords_
        //  samplingSegments contains segmentNo for each sample.
        void calcSamples
80
        (
81
82
83
84
            DynamicList<point>& samplingPts,
            DynamicList<label>& samplingCells,
            DynamicList<label>& samplingFaces,
            DynamicList<label>& samplingSegments,
85
            DynamicList<scalar>& samplingCurveDist
86
87
        ) const;

88
89
        //- Uses calcSamples to obtain samples. Copies them into *this.
        void genSamples();
90
91
92
93
94


public:

    //- Runtime type information
95
    TypeName("polyLine");
96
97


98
99
100
101
102
103
104
    // Static data

        //- Tolerance when comparing points relative to difference between
        //  start_ and end_
        static const scalar tol;


105
106
    // Constructors

107
        //- Construct from components
108
        polyLineSet
109
110
111
        (
            const word& name,
            const polyMesh& mesh,
112
            const meshSearch& searchEngine,
113
114
115
116
117
            const word& axis,
            const List<point>& samplePoints
        );

        //- Construct from dictionary
118
        polyLineSet
119
120
121
        (
            const word& name,
            const polyMesh& mesh,
122
            const meshSearch& searchEngine,
123
124
            const dictionary& dict
        );
125
126


127
    //- Destructor
128
    virtual ~polyLineSet();
129
130
131
132
133
134
135
136
137
138
139
140
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //