BUG: PointEdgeWave : n cyclics bool instead of label
[OpenFOAM-1.6.x.git] / src / meshTools / searchableSurface / searchableSurfaceCollection.H
blob38fd03b80a0f15d35c8088224fd59b8d3a91d9cf
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 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
19     for more details.
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
25 Class
26     Foam::searchableSurfaceCollection
28 Description
29     Set of transformed searchableSurfaces. Does not do boolean operations.
30     So when meshing might find parts 'inside'.
32 SourceFiles
33     searchableSurfaceCollection.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef searchableSurfaceCollection_H
38 #define searchableSurfaceCollection_H
40 #include "searchableSurface.H"
41 #include "treeBoundBox.H"
42 #include "coordinateSystem.H"
43 #include "UPtrList.H"
44 #include "Switch.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 // Forward declaration of classes
53 /*---------------------------------------------------------------------------*\
54                  Class searchableSurfaceCollection Declaration
55 \*---------------------------------------------------------------------------*/
57 class searchableSurfaceCollection
59     public searchableSurface
61 private:
63     // Private Member Data
65         // Per instance data
67             //- instance name
68             wordList instance_;
70             //- scaling vector
71             vectorField scale_;
73             //- transformation
74             PtrList<coordinateSystem> transform_;
76             UPtrList<searchableSurface> subGeom_;
78             Switch mergeSubRegions_;
80             //- offsets for indices coming from different surfaces
81             //  (sized with size() of each surface)
82             labelList indexOffset_;
84         //- Region names
85         mutable wordList regions_;
86         //- From individual regions to collection regions
87         mutable labelList regionOffset_;
90     // Private Member Functions
92         //- Find point nearest to sample. Updates minDistSqr. Sets nearestInfo
93         //  and surface index
94         void findNearest
95         (
96             const pointField& samples,
97             scalarField& minDistSqr,
98             List<pointIndexHit>& nearestInfo,
99             labelList& nearestSurf
100         ) const;
102         //- Sort hits into per-surface bins. Misses are rejected.
103         //  Maintains map back to position
104         void sortHits
105         (
106             const List<pointIndexHit>& info,
107             List<List<pointIndexHit> >& surfInfo,
108             labelListList& infoMap
109         ) const;
112         //- Disallow default bitwise copy construct
113         searchableSurfaceCollection(const searchableSurfaceCollection&);
115         //- Disallow default bitwise assignment
116         void operator=(const searchableSurfaceCollection&);
119 public:
121     //- Runtime type information
122     TypeName("searchableSurfaceCollection");
125     // Constructors
127         //- Construct from dictionary (used by searchableSurface)
128         searchableSurfaceCollection
129         (
130             const IOobject& io,
131             const dictionary& dict
132         );
134     // Destructor
136         virtual ~searchableSurfaceCollection();
139     // Member Functions
141         virtual const wordList& regions() const;
143         //- Whether supports volume type below
144         virtual bool hasVolumeType() const
145         {
146             return false;
147         }
149         //- Range of local indices that can be returned.
150         virtual label size() const;
152         //- Get representative set of element coordinates
153         //  Usually the element centres (should be of length size()).
154         virtual pointField coordinates() const;
157         // Multiple point queries.
159             virtual void findNearest
160             (
161                 const pointField& sample,
162                 const scalarField& nearestDistSqr,
163                 List<pointIndexHit>&
164             ) const;
166             virtual void findLine
167             (
168                 const pointField& start,
169                 const pointField& end,
170                 List<pointIndexHit>&
171             ) const;
173             virtual void findLineAny
174             (
175                 const pointField& start,
176                 const pointField& end,
177                 List<pointIndexHit>&
178             ) const;
180             //- Get all intersections in order from start to end.
181             virtual void findLineAll
182             (
183                 const pointField& start,
184                 const pointField& end,
185                 List<List<pointIndexHit> >&
186             ) const;
188             //- From a set of points and indices get the region
189             virtual void getRegion
190             (
191                 const List<pointIndexHit>&,
192                 labelList& region
193             ) const;
195             //- From a set of points and indices get the normal
196             virtual void getNormal
197             (
198                 const List<pointIndexHit>&,
199                 vectorField& normal
200             ) const;
202             //- Determine type (inside/outside/mixed) for point. unknown if
203             //  cannot be determined (e.g. non-manifold surface)
204             virtual void getVolumeType
205             (
206                 const pointField&,
207                 List<volumeType>&
208             ) const;
210         // Other
212             //- Set bounds of surface. Bounds currently set as list of
213             //  bounding boxes. The bounds are hints to the surface as for
214             //  the range of queries it can expect. faceMap/pointMap can be
215             //  set if the surface has done any redistribution.
216             virtual void distribute
217             (
218                 const List<treeBoundBox>&,
219                 const bool keepNonLocal,
220                 autoPtr<mapDistribute>& faceMap,
221                 autoPtr<mapDistribute>& pointMap
222             );
224             //- WIP. Store element-wise field.
225             virtual void setField(const labelList& values);
227             //- WIP. From a set of hits (points and
228             //  indices) get the specified field. Misses do not get set. Return
229             //  empty field if not supported.
230             virtual void getField(const List<pointIndexHit>&, labelList&) const;
232         // regIOobject implementation
234             bool writeData(Ostream&) const
235             {
236                 notImplemented
237                 (
238                     "searchableSurfaceCollection::writeData(Ostream&) const"
239                 );
240                 return false;
241             }
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 } // End namespace Foam
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 #endif
254 // ************************************************************************* //