00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::curvedEdge 00026 00027 Description 00028 Define a curved edge that is parameterized for 0<lambda<1 00029 between the start and end point. 00030 00031 SourceFiles 00032 curvedEdge.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef curvedEdges_H 00037 #define curvedEdges_H 00038 00039 #include <OpenFOAM/edge.H> 00040 #include <OpenFOAM/pointField.H> 00041 #include <OpenFOAM/typeInfo.H> 00042 #include <OpenFOAM/HashTable.H> 00043 #include <OpenFOAM/autoPtr.H> 00044 00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00046 00047 namespace Foam 00048 { 00049 00050 /*---------------------------------------------------------------------------*\ 00051 Class curvedEdge Declaration 00052 \*---------------------------------------------------------------------------*/ 00053 00054 class curvedEdge 00055 { 00056 protected: 00057 00058 // Protected data 00059 00060 const pointField& points_; 00061 const label start_; 00062 const label end_; 00063 00064 // Protected Member Functions 00065 00066 //- Return a complete point field by appending the start/end points 00067 // to the given list 00068 static pointField appendEndPoints 00069 ( 00070 const pointField&, 00071 const label start, 00072 const label end, 00073 const pointField& otherKnots 00074 ); 00075 00076 00077 public: 00078 00079 //- Runtime type information 00080 TypeName("curvedEdge"); 00081 00082 // Declare run-time constructor selection tables 00083 00084 declareRunTimeSelectionTable 00085 ( 00086 autoPtr, 00087 curvedEdge, 00088 Istream, 00089 ( 00090 const pointField& points, 00091 Istream& is 00092 ), 00093 (points, is) 00094 ); 00095 00096 00097 // Constructors 00098 00099 //- Construct from components 00100 curvedEdge 00101 ( 00102 const pointField& points, 00103 const label start, 00104 const label end 00105 ); 00106 00107 //- Construct from Istream setting pointsList 00108 curvedEdge(const pointField&, Istream&); 00109 00110 //- Copy construct 00111 curvedEdge(const curvedEdge&); 00112 00113 //- Clone function 00114 virtual autoPtr<curvedEdge> clone() const; 00115 00116 //- New function which constructs and returns pointer to a curvedEdge 00117 static autoPtr<curvedEdge> New(const pointField&, Istream&); 00118 00119 00120 // Destructor 00121 00122 virtual ~curvedEdge(){} 00123 00124 00125 // Member Functions 00126 00127 //- Return label of start point 00128 inline label start() const; 00129 00130 //- Return label of end point 00131 inline label end() const; 00132 00133 //- Compare the given start and end points with this curve 00134 // - 0: different 00135 // - +1: identical 00136 // - -1: same edge, but different orientation 00137 inline int compare(const curvedEdge&) const; 00138 00139 //- Compare the given start and end points with this curve 00140 // - 0: different 00141 // - +1: identical 00142 // - -1: same edge, but different orientation 00143 inline int compare(const edge&) const; 00144 00145 //- Compare the given start and end points with this curve 00146 // - 0: different 00147 // - +1: identical 00148 // - -1: same edge, but different orientation 00149 inline int compare(const label start, const label end) const; 00150 00151 //- Return the point position corresponding to the curve parameter 00152 // 0 <= lambda <= 1 00153 virtual point position(const scalar) const = 0; 00154 00155 //- Return the length of the curve 00156 virtual scalar length() const = 0; 00157 00158 00159 // Member operators 00160 00161 void operator=(const curvedEdge&); 00162 00163 // Ostream operator 00164 00165 friend Ostream& operator<<(Ostream&, const curvedEdge&); 00166 }; 00167 00168 00169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00170 00171 } // End namespace Foam 00172 00173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00174 00175 #include "curvedEdgeI.H" 00176 00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00178 00179 #endif 00180 00181 // ************************ vim: set sw=4 sts=4 et: ************************ //