1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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
31 Constructs feature edges and feature points, which are edges/points with
32 and angle > given specification.
33 Can be asked for 'superFaces' which can be used to see if a cell is a
39 \*---------------------------------------------------------------------------*/
41 #ifndef cellFeatures_H
42 #define cellFeatures_H
44 #include <OpenFOAM/faceList.H>
45 #include <OpenFOAM/labelList.H>
46 #include <OpenFOAM/boolList.H>
47 #include <OpenFOAM/HashSet.H>
48 #include <OpenFOAM/Map.H>
49 #include <OpenFOAM/DynamicList.H>
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 // Forward declaration of classes
59 /*---------------------------------------------------------------------------*\
60 Class cellFeatures Declaration
61 \*---------------------------------------------------------------------------*/
67 const primitiveMesh& mesh_;
69 //- cos of angle between two connected faces or two connected edges on
70 // same face before edge/point is 'feature'.
76 labelHashSet featureEdge_;
78 //- (demand driven) Faces after removing internal points&edges
79 mutable faceList* facesPtr_;
81 //- New to old face mapping
82 mutable List<DynamicList<label> > faceMap_;
85 // Private Member Functions
87 bool faceAlignedEdge(const label, const label) const;
91 const Map<label>& toSuperFace,
92 const label superFaceI,
93 const label thisEdgeI,
97 bool isCellFeatureEdge(const scalar, const label) const;
102 const label superFaceI,
103 Map<label>& toSuperFace
106 void calcSuperFaces() const;
109 //- Disallow default bitwise copy construct
110 cellFeatures(const cellFeatures&);
112 //- Disallow default bitwise assignment
113 void operator=(const cellFeatures&);
119 //- Construct from cell in mesh
122 const primitiveMesh&,
123 const scalar minCos, // angle to use for feature recognition.
137 const labelHashSet& featureEdge() const
142 const faceList& faces() const
151 //- New to old faceMap. Guaranteed to be shrunk.
152 const List<DynamicList<label> >& faceMap() const
164 //- Is edge a feature edge (uniquely determined since on cell
165 // only two faces sharing edge)
166 bool isFeatureEdge(const label edgeI) const
168 return featureEdge().found(edgeI);
171 //- Are two edges connected at feature point?
172 // Is local to face since point might be seen as feature point
173 // from one face but not from another.
174 bool isFeaturePoint(const label edge0, const label edge1) const;
176 //- Is vertexI on faceI used by two edges that form feature
178 bool isFeatureVertex(const label faceI, const label vertI) const;
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 } // End namespace Foam
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 // ************************ vim: set sw=4 sts=4 et: ************************ //