OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

edgeMesh.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::edgeMesh
00027 
00028 Description
00029     points connected by edges.
00030 
00031 SourceFiles
00032     edgeMeshI.H
00033     edgeMesh.C
00034     edgeMeshIO.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef edgeMesh_H
00039 #define edgeMesh_H
00040 
00041 #include "pointField.H"
00042 #include "edgeList.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050                            Class edgeMesh Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class edgeMesh
00054 {
00055     // Private data
00056 
00057         //- Vertices of the edges
00058         pointField points_;
00059 
00060         //- The edges defining the boundary
00061         edgeList edges_;
00062 
00063         //- From point to edges
00064         mutable autoPtr<labelListList> pointEdgesPtr_;
00065 
00066     // Private Member Functions
00067 
00068         //- Calculate point-edge addressing (inverse of edges)
00069         void calcPointEdges() const;
00070 
00071 public:
00072 
00073     // Constructors
00074 
00075         //- Construct from components
00076         edgeMesh(const pointField&, const edgeList&);
00077 
00078         //- Construct from file
00079         edgeMesh(const fileName&);
00080 
00081         //- Construct from Istream
00082         edgeMesh(Istream&);
00083 
00084         //- Construct as copy
00085         edgeMesh(const edgeMesh&);
00086 
00087 
00088 
00089     // Member Functions
00090 
00091         inline const pointField& points() const;
00092 
00093         inline const edgeList& edges() const;
00094 
00095         inline const labelListList& pointEdges() const;
00096 
00097         //- Find connected regions. Set region number per edge.
00098         //  Returns number of regions.
00099         label regions(labelList& edgeRegion) const;
00100 
00101         //- Merge common points (points within mergeDist)
00102         void mergePoints(const scalar mergeDist);
00103 
00104     // Member Operators
00105 
00106         inline void operator=(const edgeMesh&);
00107 
00108     // Ostream Operator
00109 
00110         friend Ostream& operator<<(Ostream&, const edgeMesh&);
00111         friend Istream& operator>>(Istream&, edgeMesh&);
00112 };
00113 
00114 
00115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00116 
00117 } // End namespace Foam
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 #include "edgeMeshI.H"
00122 
00123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00124 
00125 #endif
00126 
00127 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd