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/>.
28 Description of surface in form of 'cloud of edges'.
34 - parentEdge (edge on surface this edge originates from)
37 (pointEdges constructed from above data)
39 Constructed from triSurface and surfaceIntersection. (uses localPoints
42 Used to easily insert cuts and split faces.
45 - points with surface (local)points first, intersection points last
46 - edges with (split) surface edges first, intersection edges last.
51 \*---------------------------------------------------------------------------*/
57 #include "labelList.H"
58 #include "pointField.H"
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 // Forward declaration of classes
68 class surfaceIntersection;
70 /*---------------------------------------------------------------------------*\
71 Class edgeSurface Declaration
72 \*---------------------------------------------------------------------------*/
80 //- All points (0 .. nSurfacePoints_-1 are points from surface)
83 label nSurfacePoints_;
85 //- All edges (0 .. nSurfaceEdges_-1 are (possibly split) surface edges)
90 //- Original surface edge. Valid only surfaceEdges.
91 labelList parentEdges_;
93 //- From face to our edges_
94 labelListList faceEdges_;
97 //- Constructed from above: pointEdges
98 labelListList pointEdges_;
101 // Private Member Functions
103 //- Dump edges in obj format
104 static void writeOBJ(const pointField&, const edgeList&, Ostream&);
106 //- Dump selected edges in obj format
115 //- Calculate pointEdges
116 void calcPointEdges();
121 ClassName("edgeSurface");
125 //- Construct from surface and intersection description
128 const triSurface& surf,
129 const bool isFirstSurface,
130 const surfaceIntersection& inter
138 const pointField& points() const
143 label nSurfacePoints() const
145 return nSurfacePoints_;
148 const edgeList& edges() const
153 label nSurfaceEdges() const
155 return nSurfaceEdges_;
158 bool isSurfaceEdge(const label edgeI) const
160 return edgeI < nSurfaceEdges_;
163 //- Parent edge (original surface edge this edge came from).
164 // Valid only for edgeI < nSurfaceEdges_.
165 label parentEdge(const label edgeI) const
167 if (edgeI < nSurfaceEdges_)
169 return parentEdges_[edgeI];
175 "edgeSurface::parentEdge(const label edgeI) const"
176 ) << "Trying to get parent (i.e. surface) edge for"
177 << " intersection edge " << edgeI
178 << abort(FatalError);
183 //- From face to our edges_
184 const labelListList& faceEdges() const
189 //- point to edge addressing
190 const labelListList& pointEdges() const
198 //- Add intersection edges to a face. Used for connecting
199 // floating intersection on face to rest of face.
200 void addIntersectionEdges(const label faceI, const edgeList&);
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 } // End namespace Foam
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 // ************************************************************************* //