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/>.
30 Constructs feature edges and feature points, which are edges/points with
31 and angle > given specification.
32 Can be asked for 'superFaces' which can be used to see if a cell is a
38 \*---------------------------------------------------------------------------*/
40 #ifndef cellFeatures_H
41 #define cellFeatures_H
44 #include "labelList.H"
48 #include "DynamicList.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Forward declaration of classes
58 /*---------------------------------------------------------------------------*\
59 Class cellFeatures Declaration
60 \*---------------------------------------------------------------------------*/
66 const primitiveMesh& mesh_;
68 //- cos of angle between two connected faces or two connected edges on
69 // same face before edge/point is 'feature'.
75 labelHashSet featureEdge_;
77 //- (demand driven) Faces after removing internal points&edges
78 mutable faceList* facesPtr_;
80 //- New to old face mapping
81 mutable List<dynamicLabelList > faceMap_;
84 // Private Member Functions
86 bool faceAlignedEdge(const label, const label) const;
90 const Map<label>& toSuperFace,
91 const label superFaceI,
92 const label thisEdgeI,
96 bool isCellFeatureEdge(const scalar, const label) const;
101 const label superFaceI,
102 Map<label>& toSuperFace
105 void calcSuperFaces() const;
108 //- Disallow default bitwise copy construct
109 cellFeatures(const cellFeatures&);
111 //- Disallow default bitwise assignment
112 void operator=(const cellFeatures&);
118 //- Construct from cell in mesh
121 const primitiveMesh&,
122 const scalar minCos, // angle to use for feature recognition.
136 const labelHashSet& featureEdge() const
141 const faceList& faces() const
150 //- New to old faceMap. Guaranteed to be shrunk.
151 const List<dynamicLabelList >& faceMap() const
163 //- Is edge a feature edge (uniquely determined since on cell
164 // only two faces sharing edge)
165 bool isFeatureEdge(const label edgeI) const
167 return featureEdge().found(edgeI);
170 //- Are two edges connected at feature point?
171 // Is local to face since point might be seen as feature point
172 // from one face but not from another.
173 bool isFeaturePoint(const label edge0, const label edge1) const;
175 //- Is vertexI on faceI used by two edges that form feature
177 bool isFeatureVertex(const label faceI, const label vertI) const;
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 } // End namespace Foam
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 // ************************************************************************* //