FreeFOAM The Cross-Platform CFD Toolkit
edgeMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::edgeMesh
26 
27 Description
28  points connected by edges.
29 
30 SourceFiles
31  edgeMeshI.H
32  edgeMesh.C
33  edgeMeshIO.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef edgeMesh_H
38 #define edgeMesh_H
39 
40 #include <OpenFOAM/pointField.H>
41 #include <OpenFOAM/edgeList.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class edgeMesh Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class edgeMesh
53 {
54  // Private data
55 
56  //- Vertices of the edges
57  pointField points_;
58 
59  //- The edges defining the boundary
60  edgeList edges_;
61 
62  //- From point to edges
63  mutable autoPtr<labelListList> pointEdgesPtr_;
64 
65  // Private Member Functions
66 
67  //- Calculate point-edge addressing (inverse of edges)
68  void calcPointEdges() const;
69 
70 public:
71 
72  // Constructors
73 
74  //- Construct from components
75  edgeMesh(const pointField&, const edgeList&);
76 
77  //- Construct from file
78  edgeMesh(const fileName&);
79 
80  //- Construct from Istream
81  edgeMesh(Istream&);
82 
83  //- Construct as copy
84  edgeMesh(const edgeMesh&);
85 
86 
87 
88  // Member Functions
89 
90  inline const pointField& points() const;
91 
92  inline const edgeList& edges() const;
93 
94  inline const labelListList& pointEdges() const;
95 
96  //- Find connected regions. Set region number per edge.
97  // Returns number of regions.
98  label regions(labelList& edgeRegion) const;
99 
100  //- Merge common points (points within mergeDist)
101  void mergePoints(const scalar mergeDist);
102 
103  // Member Operators
104 
105  inline void operator=(const edgeMesh&);
106 
107  // Ostream Operator
108 
109  friend Ostream& operator<<(Ostream&, const edgeMesh&);
110  friend Istream& operator>>(Istream&, edgeMesh&);
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #include <edgeMesh/edgeMeshI.H>
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************ vim: set sw=4 sts=4 et: ************************ //