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
26 Foam::searchableSphere
34 \*---------------------------------------------------------------------------*/
36 #ifndef searchableSphere_H
37 #define searchableSphere_H
39 #include "treeBoundBox.H"
40 #include "searchableSurface.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 // Forward declaration of classes
49 /*---------------------------------------------------------------------------*\
50 Class searchableSphere Declaration
51 \*---------------------------------------------------------------------------*/
53 class searchableSphere
55 public searchableSurface
59 // Private Member Data
68 mutable wordList regions_;
71 // Private Member Functions
73 //- Find nearest point on sphere.
74 pointIndexHit findNearest
77 const scalar nearestDistSqr
80 //- Find intersection with sphere
90 //- Disallow default bitwise copy construct
91 searchableSphere(const searchableSphere&);
93 //- Disallow default bitwise assignment
94 void operator=(const searchableSphere&);
99 //- Runtime type information
100 TypeName("searchableSphere");
105 //- Construct from components
106 searchableSphere(const IOobject& io, const point&, const scalar radius);
108 //- Construct from dictionary (used by searchableSurface)
112 const dictionary& dict
117 virtual ~searchableSphere();
122 virtual const wordList& regions() const;
124 //- Whether supports volume type below
125 virtual bool hasVolumeType() const
130 //- Range of local indices that can be returned.
131 virtual label size() const
137 // Multiple point queries.
139 virtual void findNearest
141 const pointField& sample,
142 const scalarField& nearestDistSqr,
146 virtual void findLine
148 const pointField& start,
149 const pointField& end,
153 virtual void findLineAny
155 const pointField& start,
156 const pointField& end,
160 //- Get all intersections in order from start to end.
161 virtual void findLineAll
163 const pointField& start,
164 const pointField& end,
165 List<List<pointIndexHit> >&
168 //- From a set of points and indices get the region
169 virtual void getRegion
171 const List<pointIndexHit>&,
175 //- From a set of points and indices get the normal
176 virtual void getNormal
178 const List<pointIndexHit>&,
182 //- Determine type (inside/outside/mixed) for point. unknown if
183 // cannot be determined (e.g. non-manifold surface)
184 virtual void getVolumeType
191 // regIOobject implementation
193 bool writeData(Ostream&) const
195 notImplemented("searchableSphere::writeData(Ostream&) const");
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 // ************************************************************************* //