FreeFOAM The Cross-Platform CFD Toolkit
splineEdge.C
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) 2009-2010 OpenCFD Ltd.
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 \*---------------------------------------------------------------------------*/
25 
26 #include "splineEdge.H"
28 
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34  defineTypeNameAndDebug(splineEdge, 0);
35 
37  (
38  curvedEdge,
39  splineEdge,
40  Istream
41  );
42 
43  // compatibility with old names
45  (
46  curvedEdge,
47  splineEdge,
48  Istream,
49  simpleSpline
50  );
51 
52  // compatibility with old names
54  (
55  curvedEdge,
56  splineEdge,
57  Istream,
58  polySpline
59  );
60 
61 }
62 
63 
64 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
65 
66 Foam::splineEdge::splineEdge
67 (
68  const pointField& points,
69  const label start,
70  const label end,
71  const pointField& internalPoints
72 )
73 :
74  curvedEdge(points, start, end),
75  CatmullRomSpline(appendEndPoints(points, start, end, internalPoints))
76 {}
77 
78 
79 Foam::splineEdge::splineEdge(const pointField& points, Istream& is)
80 :
81  curvedEdge(points, is),
82  CatmullRomSpline(appendEndPoints(points, start_, end_, pointField(is)))
83 {
84  token t(is);
85  is.putBack(t);
86 
87  // compatibility - might also have start/end tangents - discard them
88  if (t == token::BEGIN_LIST)
89  {
90  vector tangent0Ignored(is);
91  vector tangent1Ignored(is);
92  }
93 }
94 
95 
96 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
97 
99 {}
100 
101 
102 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
103 
104 Foam::point Foam::splineEdge::position(const scalar mu) const
105 {
106  return CatmullRomSpline::position(mu);
107 }
108 
109 
110 Foam::scalar Foam::splineEdge::length() const
111 {
112  return CatmullRomSpline::length();
113 }
114 
115 
116 // ************************ vim: set sw=4 sts=4 et: ************************ //