1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
29 Container for cuts of edges of mesh. Cuts either exactly through existing
30 vertices or through edges.
34 \*---------------------------------------------------------------------------*/
36 #ifndef meshEdgeCuts_H
37 #define meshEdgeCuts_H
39 #include "labelList.H"
40 #include "labelHashSet.H"
41 #include "scalarField.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Forward declaration of classes
51 /*---------------------------------------------------------------------------*\
52 Class meshEdgeCuts Declaration
53 \*---------------------------------------------------------------------------*/
59 const primitiveMesh& mesh_;
61 // Private Member Functions
63 //- Disallow default bitwise copy construct
64 meshEdgeCuts(const meshEdgeCuts&);
66 //- Disallow default bitwise assignment
67 void operator=(const meshEdgeCuts&);
72 //- List of cells containing the cuts
75 //- Points exactly cut by cuts
78 //- List of edge labels cut
81 //- Positions on edges
82 scalarField meshEdgeWeights_;
85 // Protected Static Functions
87 //- Mark element in a hashSet
88 static void mark(const label elem, labelHashSet& markedElems);
90 //- Mark list of elements in a hashSet
91 static void mark(const labelList& elems, labelHashSet& markedElems);
93 //- Return true and set weight if linear interpolation between
94 // val0 and val1 crosses isoVal. weight=1 if isoVal==val1
107 //- Construct from components
110 const primitiveMesh& mesh,
111 const labelList& cells,
112 const labelList& meshVerts,
113 const labelList& meshEdges,
114 const scalarField& meshEdgeWeights
120 const primitiveMesh& mesh() const
125 const labelList& cells() const
130 const labelList& meshVerts() const
135 const labelList& meshEdges() const
140 const scalarField& meshEdgeWeights() const
142 return meshEdgeWeights_;
147 return meshVerts_.size() + meshEdges_.size();
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //