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
26 library functions that will define a curvedEdge in space
27 parameterised for 0<lambda<1 from the beginning
28 point to the end point.
30 \*---------------------------------------------------------------------------*/
34 #include "curvedEdge.H"
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
43 defineTypeNameAndDebug(curvedEdge, 0);
44 defineRunTimeSelectionTable(curvedEdge, Istream);
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 // Construct from components
50 curvedEdge::curvedEdge
52 const pointField& points,
63 // Construct from Istream
64 curvedEdge::curvedEdge(const pointField& points, Istream& is)
67 start_(readLabel(is)),
73 curvedEdge::curvedEdge(const curvedEdge& c)
82 autoPtr<curvedEdge> curvedEdge::clone() const
84 notImplemented("curvedEdge::clone() const");
85 return autoPtr<curvedEdge>(NULL);
89 //- New function which constructs and returns pointer to a curvedEdge
90 autoPtr<curvedEdge> curvedEdge::New(const pointField& points, Istream& is)
94 Info<< "curvedEdge::New(const pointField&, Istream&) : "
95 << "constructing curvedEdge"
99 word curvedEdgeType(is);
101 IstreamConstructorTable::iterator cstrIter =
102 IstreamConstructorTablePtr_
103 ->find(curvedEdgeType);
105 if (cstrIter == IstreamConstructorTablePtr_->end())
107 FatalErrorIn("curvedEdge::New(const pointField&, Istream&)")
108 << "Unknown curvedEdge type " << curvedEdgeType << endl << endl
109 << "Valid curvedEdge types are" << endl
110 << IstreamConstructorTablePtr_->toc()
111 << abort(FatalError);
114 return autoPtr<curvedEdge>(cstrIter()(points, is));
118 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
120 //- Return the complete knotList by adding the start and end points to the
124 const pointField& points,
127 const pointField& otherknots
130 label listsize(otherknots.size() + 2);
131 pointField tmp(listsize);
133 tmp[0] = points[start];
135 for (register label i=1; i<listsize-1; i++)
137 tmp[i] = otherknots[i-1];
140 tmp[listsize-1] = points[end];
146 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
148 void curvedEdge::operator=(const curvedEdge&)
150 notImplemented("void curvedEdge::operator=(const curvedEdge&)");
154 Ostream& operator<<(Ostream& os, const curvedEdge& p)
156 os << p.start_ << tab << p.end_ << endl;
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 } // End namespace Foam
166 // ************************************************************************* //