1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Define a curved edge that is parameterized for 0<lambda<1
30 between the start and end point.
35 \*---------------------------------------------------------------------------*/
41 #include "pointField.H"
43 #include "HashTable.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class curvedEdge Declaration
53 \*---------------------------------------------------------------------------*/
61 const pointField& points_;
65 // Protected Member Functions
67 //- Return a complete point field by appending the start/end points
69 static pointField appendEndPoints
74 const pointField& otherKnots
80 //- Runtime type information
81 TypeName("curvedEdge");
83 // Declare run-time constructor selection tables
85 declareRunTimeSelectionTable
91 const pointField& points,
100 //- Construct from components
103 const pointField& points,
108 //- Construct from Istream setting pointsList
109 curvedEdge(const pointField&, Istream&);
112 curvedEdge(const curvedEdge&);
115 virtual autoPtr<curvedEdge> clone() const;
117 //- New function which constructs and returns pointer to a curvedEdge
118 static autoPtr<curvedEdge> New(const pointField&, Istream&);
123 virtual ~curvedEdge(){}
128 //- Return label of start point
129 inline label start() const;
131 //- Return label of end point
132 inline label end() const;
134 //- Compare the given start and end points with this curve
137 // - -1: same edge, but different orientation
138 inline int compare(const curvedEdge&) const;
140 //- Compare the given start and end points with this curve
143 // - -1: same edge, but different orientation
144 inline int compare(const edge&) const;
146 //- Compare the given start and end points with this curve
149 // - -1: same edge, but different orientation
150 inline int compare(const label start, const label end) const;
152 //- Return the point position corresponding to the curve parameter
154 virtual point position(const scalar) const = 0;
156 //- Return the length of the curve
157 virtual scalar length() const = 0;
162 void operator=(const curvedEdge&);
166 friend Ostream& operator<<(Ostream&, const curvedEdge&);
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 } // End namespace Foam
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 #include "curvedEdgeI.H"
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 // ************************************************************************* //