1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
27 #include "curvedEdge.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 defineTypeNameAndDebug(curvedEdge, 0);
34 defineRunTimeSelectionTable(curvedEdge, Istream);
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 Foam::curvedEdge::curvedEdge
42 const pointField& points,
53 Foam::curvedEdge::curvedEdge(const pointField& points, Istream& is)
56 start_(readLabel(is)),
61 Foam::curvedEdge::curvedEdge(const curvedEdge& c)
69 Foam::autoPtr<Foam::curvedEdge> Foam::curvedEdge::clone() const
71 notImplemented("curvedEdge::clone() const");
72 return autoPtr<curvedEdge>(NULL);
76 Foam::autoPtr<Foam::curvedEdge> Foam::curvedEdge::New
78 const pointField& points,
84 Info<< "curvedEdge::New(const pointField&, Istream&) : "
85 << "constructing curvedEdge"
89 const word edgeType(is);
91 IstreamConstructorTable::iterator cstrIter =
92 IstreamConstructorTablePtr_->find(edgeType);
94 if (cstrIter == IstreamConstructorTablePtr_->end())
96 FatalErrorIn("curvedEdge::New(const pointField&, Istream&)")
97 << "Unknown curvedEdge type "
98 << edgeType << nl << nl
99 << "Valid curvedEdge types are" << endl
100 << IstreamConstructorTablePtr_->sortedToc()
101 << abort(FatalError);
104 return autoPtr<curvedEdge>(cstrIter()(points, is));
108 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110 Foam::pointField Foam::curvedEdge::appendEndPoints
112 const pointField& points,
115 const pointField& otherKnots
118 pointField allKnots(otherKnots.size() + 2);
121 allKnots[0] = points[start];
122 allKnots[otherKnots.size() + 1] = points[end];
124 // intermediate knots
125 forAll(otherKnots, knotI)
127 allKnots[knotI+1] = otherKnots[knotI];
134 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
136 void Foam::curvedEdge::operator=(const curvedEdge&)
138 notImplemented("void curvedEdge::operator=(const curvedEdge&)");
142 Foam::Ostream& Foam::operator<<(Ostream& os, const curvedEdge& p)
144 os << p.start_ << tab << p.end_ << endl;
150 // ************************************************************************* //