initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / edgeMesh / edgeMesh.H
blob55934f3824c5a628ee62177b430f246e2ae6f03c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::edgeMesh
28 Description
29     points connected by edges.
31 SourceFiles
32     edgeMeshI.H
33     edgeMesh.C
34     edgeMeshIO.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef edgeMesh_H
39 #define edgeMesh_H
41 #include "pointField.H"
42 #include "edgeList.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                            Class edgeMesh Declaration
51 \*---------------------------------------------------------------------------*/
53 class edgeMesh
55     // Private data
57         //- Vertices of the edges
58         pointField points_;
60         //- The edges defining the boundary
61         edgeList edges_;
63         //- From point to edges
64         mutable autoPtr<labelListList> pointEdgesPtr_;
66     // Private Member Functions
68         //- Calculate point-edge addressing (inverse of edges)
69         void calcPointEdges() const;
71 public:
73     // Constructors
75         //- Construct from components
76         edgeMesh(const pointField&, const edgeList&);
78         //- Construct from file
79         edgeMesh(const fileName&);
81         //- Construct from Istream
82         edgeMesh(Istream&);
84         //- Construct as copy
85         edgeMesh(const edgeMesh&);
89     // Member Functions
91         inline const pointField& points() const;
93         inline const edgeList& edges() const;
95         inline const labelListList& pointEdges() const;
97         //- Find connected regions. Set region number per edge.
98         //  Returns number of regions.
99         label regions(labelList& edgeRegion) const;
101         //- Merge common points (points within mergeDist)
102         void mergePoints(const scalar mergeDist);
104     // Member Operators
106         inline void operator=(const edgeMesh&);
108     // Ostream Operator
110         friend Ostream& operator<<(Ostream&, const edgeMesh&);
111         friend Istream& operator>>(Istream&, edgeMesh&);
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 } // End namespace Foam
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 #include "edgeMeshI.H"
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 #endif
127 // ************************************************************************* //