1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Mesh class to store edge-based connectivity structures.
33 \*---------------------------------------------------------------------------*/
38 #include "objectRegistry.H"
41 #include "edgeIOList.H"
42 #include "labelIOList.H"
43 #include "eBoundaryMesh.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Class forward declarations
52 /*---------------------------------------------------------------------------*\
53 Class eMesh Declaration
54 \*---------------------------------------------------------------------------*/
62 const polyMesh& mesh_;
65 mutable edgeIOList edges_;
68 mutable eBoundaryMesh boundary_;
70 // Primitive size data
73 mutable label nEdges_;
75 //- Number of internal edges
76 mutable label nInternalEdges_;
80 //- Mapping between ordered edge-data and regular edges.
81 labelList reverseEdgeMap_;
84 mutable labelListIOList* fePtr_;
87 mutable labelListIOList* efPtr_;
89 // Private Member Functions
91 //- Helper function to isolate points on triangular faces
92 label findIsolatedPoint(const face& f, const edge& e) const;
94 //- Helper function to determine the orientation of a triangular face
95 label edgeDirection(const face& f, const edge& e) const;
97 //- Disallow default bitwise copy construct
100 //- Disallow default bitwise assignment
101 void operator=(const eMesh&);
103 // Private member functions to calculate demand driven data
105 //- Calculate ordered edges (and edgeFaces)
106 void calcOrderedEdgeList();
108 //- Calculate face-edges
109 void calcFaceEdges() const;
111 //- Calculate edge-faces
112 void calcEdgeFaces() const;
115 void clearGeom() const;
118 void clearAddressing() const;
125 typedef eBoundaryMesh BoundaryMesh;
128 //- Runtime type information
131 //- Return the mesh sub-directory name (usually "eMesh")
132 static word meshSubDir;
137 //- Construct from IOobject and polyMesh reference
138 eMesh(const polyMesh& m, const word& subDir = eMesh::meshSubDir);
150 //- Add boundary patches. Constructor helper
151 void addEdgePatches(const List<ePatch*> &);
156 //- Return reference to the mesh database
157 virtual const objectRegistry& db() const;
159 //- Return the base mesh directory (dbDir())
160 fileName meshDir() const;
162 //- Return the local mesh directory (dbDir()/meshSubDir)
163 fileName meshSubDirectory() const;
165 //- Return reference to time
166 const Time& time() const;
169 //- Mesh size parameters
171 label nEdges() const;
173 label nInternalEdges() const;
175 // Primitive mesh data
177 //- Return constant reference to the ordered edge-list
178 const edgeList& edges() const;
182 //- Return constant reference to boundary mesh
183 const eBoundaryMesh& boundary() const;
186 // Demand-driven data
188 //- Return constant reference to the faceEdges list
189 const labelListList& faceEdges() const;
191 //- Return constant reference to the edgeFaces list
192 const labelListList& edgeFaces() const;
194 // Reset primitive data
198 labelListList& faceEdges,
199 labelListList& edgeFaces,
200 const labelList& patchSizes,
201 const labelList& patchStarts,
203 const bool storePrimitives
206 //- Clear demand-driven data
207 void clearOut() const;
209 //- Set the instance for mesh files
210 void setInstance(const fileName& inst);
213 virtual bool write() const;
218 bool operator!=(const eMesh& m) const;
220 bool operator==(const eMesh& m) const;
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 } // End namespace Foam
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 // ************************************************************************* //