initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / meshTools / searchableSurface / searchableSurfaceCollection.H
blobdd4c5fdce215c5ccf3743a97541f9075114c668e
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         //- Region names
81         mutable wordList regions_;
82         //- From individual regions to collection regions
83         mutable labelList regionOffset_;
86     // Private Member Functions
88         //- Find point nearest to sample. Updates minDistSqr. Sets nearestInfo
89         //  and surface index
90         void findNearest
91         (
92             const pointField& samples,
93             scalarField& minDistSqr,
94             List<pointIndexHit>& nearestInfo,
95             labelList& nearestSurf
96         ) const;
99         //- Disallow default bitwise copy construct
100         searchableSurfaceCollection(const searchableSurfaceCollection&);
102         //- Disallow default bitwise assignment
103         void operator=(const searchableSurfaceCollection&);
106 public:
108     //- Runtime type information
109     TypeName("searchableSurfaceCollection");
112     // Constructors
114         //- Construct from dictionary (used by searchableSurface)
115         searchableSurfaceCollection
116         (
117             const IOobject& io,
118             const dictionary& dict
119         );
121     // Destructor
123         virtual ~searchableSurfaceCollection();
126     // Member Functions
128         virtual const wordList& regions() const;
130         //- Whether supports volume type below
131         virtual bool hasVolumeType() const
132         {
133             return false;
134         }
136         //- Range of local indices that can be returned.
137         virtual label size() const;
140         // Multiple point queries.
142             virtual void findNearest
143             (
144                 const pointField& sample,
145                 const scalarField& nearestDistSqr,
146                 List<pointIndexHit>&
147             ) const;
149             virtual void findLine
150             (
151                 const pointField& start,
152                 const pointField& end,
153                 List<pointIndexHit>&
154             ) const;
156             virtual void findLineAny
157             (
158                 const pointField& start,
159                 const pointField& end,
160                 List<pointIndexHit>&
161             ) const;
163             //- Get all intersections in order from start to end.
164             virtual void findLineAll
165             (
166                 const pointField& start,
167                 const pointField& end,
168                 List<List<pointIndexHit> >&
169             ) const;
171             //- From a set of points and indices get the region
172             virtual void getRegion
173             (
174                 const List<pointIndexHit>&,
175                 labelList& region
176             ) const;
178             //- From a set of points and indices get the normal
179             virtual void getNormal
180             (
181                 const List<pointIndexHit>&,
182                 vectorField& normal
183             ) const;
185             //- Determine type (inside/outside/mixed) for point. unknown if
186             //  cannot be determined (e.g. non-manifold surface)
187             virtual void getVolumeType
188             (
189                 const pointField&,
190                 List<volumeType>&
191             ) const;
194         // regIOobject implementation
196             bool writeData(Ostream&) const
197             {
198                 notImplemented
199                 (
200                     "searchableSurfaceCollection::writeData(Ostream&) const"
201                 );
202                 return false;
203             }
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 } // End namespace Foam
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 #endif
216 // ************************************************************************* //