1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
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 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
33 const char* Foam::NamedEnum
35 Foam::coordSet::coordFormat,
48 const Foam::NamedEnum<Foam::coordSet::coordFormat, 5>
49 Foam::coordSet::coordFormatNames_;
52 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
54 //- Construct from components
55 Foam::coordSet::coordSet
63 axis_(coordFormatNames_[axis]),
68 //- Construct from components
69 Foam::coordSet::coordSet
73 const List<point>& points,
74 const scalarList& curveDist
79 axis_(coordFormatNames_[axis]),
84 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
86 bool Foam::coordSet::hasVectorAxis() const
92 Foam::scalar Foam::coordSet::scalarCoord
97 const point& p = operator[](index);
111 else if (axis_ == DISTANCE)
113 // Use distance to reference point
114 return curveDist_[index];
120 "coordSet::scalarCoord(const label)"
121 ) << "Illegal axis specification " << axis_
122 << " for sampling line " << name_
130 Foam::point Foam::coordSet::vectorCoord(const label index) const
132 const point& p = operator[](index);
138 Foam::Ostream& Foam::coordSet::write(Ostream& os) const
140 os << "name:" << name_ << " axis:" << axis_
142 << endl << "\t(coord)"
145 forAll(*this, sampleI)
147 os << '\t' << operator[](sampleI) << endl;
154 // ************************************************************************* //