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