ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / mesh / autoMesh / autoHexMesh / refinementFeatures / refinementFeatures.H
blob3e56be043c4ee08c35837972976e0cf425583230
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::refinementFeatures
27 Description
28     Encapsulates queries for features.
30 SourceFiles
31     refinementFeatures.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef refinementFeatures_H
36 #define refinementFeatures_H
38 #include "featureEdgeMesh.H"
39 #include "indexedOctree.H"
40 #include "treeDataEdge.H"
41 #include "treeDataPoint.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class refinementFeatures Declaration
50 \*---------------------------------------------------------------------------*/
52 class refinementFeatures
54     public PtrList<featureEdgeMesh>
56 private:
58     // Private data
60         //- Refinement levels
61         labelList levels_;
63         //- Edge
64         PtrList<indexedOctree<treeDataEdge> > edgeTrees_;
66         //- Features points
67         PtrList<indexedOctree<treeDataPoint> > pointTrees_;
70     // Private Member Functions
72 public:
74     // Constructors
76         //- Construct from components
77         refinementFeatures
78         (
79             const objectRegistry& io,
80             const PtrList<dictionary>& featDicts
81         );
84     // Member Functions
86         // Access
88             const labelList& levels() const
89             {
90                 return levels_;
91             }
93             const PtrList<indexedOctree<treeDataEdge> >& edgeTrees() const
94             {
95                 return edgeTrees_;
96             }
98             const PtrList<indexedOctree<treeDataPoint> >& pointTrees() const
99             {
100                 return pointTrees_;
101             }
104         // Query
106             //- Find nearest point on nearest feature edge
107             void findNearestEdge
108             (
109                 const pointField& samples,
110                 const scalarField& nearestDistSqr,
111                 labelList& nearFeature,
112                 List<pointIndexHit>& nearInfo
113             ) const;
115             //- Find nearest feature point. Is an index into feature points
116             //  which itself is an index into the edgeMesh points.
117             //  So the point index is
118             //      pointTrees()[nearFeature].shapes().pointLabels()[nearIndex]
119             //  Wip.
120             void findNearestPoint
121             (
122                 const pointField& samples,
123                 const scalarField& nearestDistSqr,
124                 labelList& nearFeature,
125                 labelList& nearIndex
126             ) const;
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 } // End namespace Foam
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 #endif
139 // ************************************************************************* //