arcEdge.H 3.48 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
     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
7
8
9
10
-------------------------------------------------------------------------------
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::blockEdges::arcEdge
26
27

Description
28
    Defines the arcEdge of a circle in terms of 3 points on its circumference
29
30
31
32
33
34

SourceFiles
    arcEdge.C

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

35
36
#ifndef blockEdges_arcEdge_H
#define blockEdges_arcEdge_H
37

38
#include "blockEdge.H"
39
40
41
42
43
44
#include "cylindricalCS.H"

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

namespace Foam
{
45
46
namespace blockEdges
{
47
48
49
50
51
52
53

/*---------------------------------------------------------------------------*\
                           Class arcEdge Declaration
\*---------------------------------------------------------------------------*/

class arcEdge
:
54
    public blockEdge
55
56
57
{
    // Private data

58
        // Begin, mid, end points
59
        point p1_, p2_, p3_;
60
61

        //- The arc angle (in degrees)
62
        scalar angle_;
63
64

        //- The arc radius
65
        scalar radius_;
66
67

        //- The local cylindrical coordinate system (degrees)
68
        cylindricalCS cs_;
69

70

71
72
    // Private Member Functions

73
74
        //- Calculate the angle, radius and axis
        //  \return the coordinate system
75
76
        cylindricalCS calcAngle();

77
78
        //- No copy construct
        arcEdge(const arcEdge&) = delete;
79

80
81
        //- No copy assignment
        void operator=(const arcEdge&) = delete;
82

83

84
85
86
87
88
89
90
91
92
93
94
95
public:

    //- Runtime type information
    TypeName("arc");


    // Constructors

        //- Construct from components
        arcEdge
        (
            const pointField& points,
96
97
            const label start,
            const label end,
Mark Olesen's avatar
Mark Olesen committed
98
            const point& pMid
99
100
101
        );

        //- Construct from Istream setting pointsList
102
103
        arcEdge
        (
104
105
            const dictionary& dict,
            const label index,
106
107
108
109
            const searchableSurfaces& geometry,
            const pointField& points,
            Istream&
        );
110
111


112
    //- Destructor
113
    virtual ~arcEdge() = default;
114
115
116
117


    // Member Functions

118
119
        //- The point corresponding to the curve parameter [0-1]
        point position(const scalar lambda) const;
120

121
        //- The length of the curve
122
123
124
125
126
127
        scalar length() const;
};


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

128
} // End namespace blockEdges
129
130
131
132
133
134
135
} // End namespace Foam

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

#endif

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