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
29 Description of surface in form of 'cloud of edges'.
35 - parentEdge (edge on surface this edge originates from)
38 (pointEdges constructed from above data)
40 Constructed from triSurface and surfaceIntersection. (uses localPoints
43 Used to easily insert cuts and split faces.
46 - points with surface (local)points first, intersection points last
47 - edges with (split) surface edges first, intersection edges last.
52 \*---------------------------------------------------------------------------*/
58 #include "labelList.H"
59 #include "pointField.H"
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 // Forward declaration of classes
69 class surfaceIntersection;
71 /*---------------------------------------------------------------------------*\
72 Class edgeSurface Declaration
73 \*---------------------------------------------------------------------------*/
81 //- All points (0 .. nSurfacePoints_-1 are points from surface)
84 label nSurfacePoints_;
86 //- All edges (0 .. nSurfaceEdges_-1 are (possibly split) surface edges)
91 //- Original surface edge. Valid only surfaceEdges.
92 labelList parentEdges_;
94 //- From face to our edges_
95 labelListList faceEdges_;
98 //- Constructed from above: pointEdges
99 labelListList pointEdges_;
102 // Private Member Functions
104 //- Dump edges in obj format
105 static void writeOBJ(const pointField&, const edgeList&, Ostream&);
107 //- Dump selected edges in obj format
116 //- Calculate pointEdges
117 void calcPointEdges();
123 ClassName("edgeSurface");
127 //- Construct from surface and intersection description
130 const triSurface& surf,
131 const bool isFirstSurface,
132 const surfaceIntersection& inter
140 const pointField& points() const
145 label nSurfacePoints() const
147 return nSurfacePoints_;
150 const edgeList& edges() const
155 label nSurfaceEdges() const
157 return nSurfaceEdges_;
160 bool isSurfaceEdge(const label edgeI) const
162 return edgeI < nSurfaceEdges_;
165 //- Parent edge (original surface edge this edge came from).
166 // Valid only for edgeI < nSurfaceEdges_.
167 label parentEdge(const label edgeI) const
169 if (edgeI < nSurfaceEdges_)
171 return parentEdges_[edgeI];
177 "edgeSurface::parentEdge(const label edgeI) const"
178 ) << "Trying to get parent (i.e. surface) edge for"
179 << " intersection edge " << edgeI
180 << abort(FatalError);
185 //- From face to our edges_
186 const labelListList& faceEdges() const
191 //- point to edge addressing
192 const labelListList& pointEdges() const
200 //- Add intersection edges to a face. Used for connecting
201 // floating intersection on face to rest of face.
202 void addIntersectionEdges(const label faceI, const edgeList&);
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 } // End namespace Foam
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 // ************************************************************************* //